me.dll

Decompiled 8 months ago
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using HarmonyLib;
using TMPro;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("me")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("me")]
[assembly: AssemblyCopyright("Copyright ©  2021")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("3B95EEF7-4A97-4393-91A0-3626434F3631")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace tripping
{
	[BepInPlugin("1010101110.me", "me", "1.0.0")]
	public class Mod : BaseUnityPlugin
	{
		public static readonly Harmony harmony = new Harmony(typeof(Mod).GetCustomAttributes(typeof(BepInPlugin), inherit: false).Cast<BepInPlugin>().First()
			.GUID);

		private void Awake()
		{
			harmony.PatchAll();
		}

		private void OnDestroy()
		{
			harmony.UnpatchSelf();
		}
	}
}
namespace tripping.Patches
{
	public class TrippingPatches
	{
		[HarmonyPatch(typeof(Chat), "Awake")]
		private class awakepatch
		{
			private static void Postfix(ref Chat __instance)
			{
				((Terminal)__instance).AddString("/me textttttttt");
				((Terminal)__instance).AddString("");
			}
		}

		[HarmonyPatch(typeof(Chat), "InputText")]
		private class sendtextpatch
		{
			private static bool Prefix(ref Chat __instance)
			{
				if (((TMP_InputField)((Terminal)__instance).m_input).text.StartsWith("/me "))
				{
					try
					{
						string text = ((TMP_InputField)((Terminal)__instance).m_input).text.Substring(4);
						((TMP_InputField)((Terminal)__instance).m_input).text = text + "{|me|}";
					}
					catch
					{
						((Terminal)__instance).AddString("failed me... /me blah blah blah");
						return false;
					}
				}
				return true;
			}
		}

		[HarmonyPatch(typeof(Chat), "OnNewChatMessage")]
		private class addstringpatch
		{
			private static bool Prefix(GameObject go, long senderID, Vector3 pos, Type type, UserInfo user, string text, string senderNetworkUserId, ref Chat __instance)
			{
				if (text.Contains("{|me|}"))
				{
					string text2 = text.Replace("{|me|}", "");
					((Terminal)__instance).AddString("<color=#607D8B>" + user.GetDisplayName(senderNetworkUserId) + " " + text2 + "</color>");
					return false;
				}
				return true;
			}
		}
	}
}