Decompiled source of Buttered Lillys Simple Emotes v1.1.5

Mods/Emote_HotKeys.dll

Decompiled 15 hours ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using Emote_HotKeys;
using HarmonyLib;
using MelonLoader;
using Microsoft.CodeAnalysis;
using Mirror;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: MelonInfo(typeof(EmoteKeys), "Emote HotKeys", "1.0.0", "Lilly", null)]
[assembly: MelonGame("KisSoft", "ATLYSS")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("Emote_HotKeys")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+b7d532a589440aae63291bad94b81710b5877376")]
[assembly: AssemblyProduct("Emote_HotKeys")]
[assembly: AssemblyTitle("Emote_HotKeys")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace Emote_HotKeys
{
	public class EmoteKeys : MelonMod
	{
		[HarmonyPatch(typeof(Player), "OnGameConditionChange")]
		public static class playerspawn
		{
			private static void Postfix(ref Player __instance)
			{
				//IL_0003: Unknown result type (might be due to invalid IL or missing references)
				//IL_0009: Invalid comparison between Unknown and I4
				if ((int)__instance._currentGameCondition == 1 && ((NetworkBehaviour)__instance).isLocalPlayer)
				{
					instance.Localplayer = __instance;
				}
			}
		}

		private static EmoteKeys instance;

		public Player Localplayer;

		public override void OnInitializeMelon()
		{
			instance = this;
		}

		public override void OnUpdate()
		{
			try
			{
				if (!Localplayer._inChat && !Localplayer._inUI && !Localplayer._bufferingStatus && !HostConsole._current._isOpen)
				{
					if (Input.GetKeyDown((KeyCode)98))
					{
						ChatBehaviour._current.Cmd_SendChatMessage("/dance", (ChatChannel)1);
					}
					else if (Input.GetKeyDown((KeyCode)110))
					{
						ChatBehaviour._current.Cmd_SendChatMessage("/clap", (ChatChannel)1);
					}
					else if (Input.GetKeyDown((KeyCode)109))
					{
						ChatBehaviour._current.Cmd_SendChatMessage("/taunt", (ChatChannel)1);
					}
					else if (Input.GetKeyDown((KeyCode)55))
					{
						ChatBehaviour._current.Cmd_SendChatMessage("/point", (ChatChannel)1);
					}
					else if (Input.GetKeyDown((KeyCode)56))
					{
						ChatBehaviour._current.Cmd_SendChatMessage("/ponder", (ChatChannel)1);
					}
					else if (Input.GetKeyDown((KeyCode)57))
					{
						ChatBehaviour._current.Cmd_SendChatMessage("/nod", (ChatChannel)1);
					}
				}
			}
			catch (Exception)
			{
			}
		}
	}
}