Notice: Wrestling Empire is now using Steam Workshop for official mod support. This page is going to remain accessible, but it's likely the content is not going to be kept up to date.
Decompiled source of MultiBind v1.1.3
plugins/MultiBind.dll
Decompiled a year agousing System; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using UnityEngine; using UnityEngine.SceneManagement; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = ".NET Standard 2.0")] [assembly: AssemblyCompany("MultiBind")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("MultiBind")] [assembly: AssemblyTitle("MultiBind")] [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 MultiBind { [BepInPlugin("GeeEm.WrestlingEmpire.MultiBind", "MultiBind", "1.1.3")] [HarmonyPatch] public class Plugin : BaseUnityPlugin { public class ControlScheme { public ConfigEntry<string> ConfigUp { get; set; } public ConfigEntry<string> ConfigDown { get; set; } public ConfigEntry<string> ConfigRight { get; set; } public ConfigEntry<string> ConfigLeft { get; set; } public ConfigEntry<string> ConfigS { get; set; } public ConfigEntry<string> ConfigX { get; set; } public ConfigEntry<string> ConfigZ { get; set; } public ConfigEntry<string> ConfigA { get; set; } public ConfigEntry<string> ConfigSpace { get; set; } public ConfigEntry<string> ConfigShift { get; set; } public ConfigEntry<string> ConfigControl { get; set; } public ConfigEntry<string> ConfigTab { get; set; } public ConfigEntry<string> ConfigLeftTrigger { get; set; } public ConfigEntry<string> ConfigJoin { get; set; } } public static class Ulil { public static KeyCode GetKeyCode(string name) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) return (KeyCode)Enum.Parse(typeof(KeyCode), name, ignoreCase: true); } } [HarmonyPatch(typeof(BJMGCKGNCHO))] public static class BJMGCKGNCHO_Patch { [HarmonyPrefix] [HarmonyPatch("NCOEPCFFBJA")] public static bool NCOEPCFFBJA_Patch(BJMGCKGNCHO __instance) { for (int i = 0; i < 4; i++) { if (__instance.PLFGKLGCOMD == KeyboardInstance[i] && __instance.BPJFLJPKKJK == ControllerModeInt && __instance.AHBNKMMMGFI > 0) { HandleControls(__instance, Player[i]); return false; } } return true; } } public const string PluginGuid = "GeeEm.WrestlingEmpire.MultiBind"; public const string PluginName = "MultiBind"; public const string PluginVer = "1.1.3"; internal static ManualLogSource Log; internal static readonly Harmony Harmony = new Harmony("GeeEm.WrestlingEmpire.MultiBind"); internal static string PluginPath; public static int[] KeyboardInstance = new int[4] { 0, -1, -1, -1 }; public static bool ControllerMode = false; public static int ControllerModeInt = 1; public static ConfigEntry<string> ConfigAdd; public static ConfigEntry<string> ConfigRemove; public static ConfigEntry<string> ConfigControllerMode; public static ControlScheme[] Player = new ControlScheme[4] { new ControlScheme(), new ControlScheme(), new ControlScheme(), new ControlScheme() }; public AcceptableValueList<string> KeyboardButtons = new AcceptableValueList<string>(new string[122] { "None", "Backspace", "Delete", "Tab", "Clear", "Return", "Pause", "Escape", "Space", "Quote", "Comma", "Minus", "Period", "Slash", "Alpha0", "Alpha1", "Alpha2", "Alpha3", "Alpha4", "Alpha5", "Alpha6", "Alpha7", "Alpha8", "Alpha9", "Semicolon", "Equals", "LeftBracket", "Backslash", "RightBracket", "BackQuote", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "Delete", "Keypad0", "Keypad1", "Keypad2", "Keypad3", "Keypad4", "Keypad5", "Keypad6", "Keypad7", "Keypad8", "Keypad9", "KeypadPeriod", "KeypadDivide", "KeypadMultiply", "KeypadMinus", "KeypadPlus", "KeypadEnter", "KeypadEquals", "UpArrow", "DownArrow", "RightArrow", "LeftArrow", "Insert", "Home", "End", "PageUp", "PageDown", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12", "F13", "F14", "F15", "Numlock", "CapsLock", "ScrollLock", "RightShift", "LeftShift", "RightControl", "LeftControl", "RightAlt", "LeftAlt", "RightCommand", "RightApple", "LeftCommand", "LeftApple", "LeftWindows", "RightWindows", "Print", "Menu", "Mouse0", "Mouse1", "Mouse2", "Mouse3", "Mouse4", "Mouse5", "Mouse6" }); private void SetupControls(ControlScheme controlScheme, string player) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Expected O, but got Unknown //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Expected O, but got Unknown //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Expected O, but got Unknown //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Expected O, but got Unknown //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Expected O, but got Unknown //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Expected O, but got Unknown //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Expected O, but got Unknown //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Expected O, but got Unknown //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Expected O, but got Unknown //IL_0290: Unknown result type (might be due to invalid IL or missing references) //IL_029a: Expected O, but got Unknown //IL_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_02d7: Expected O, but got Unknown //IL_030a: Unknown result type (might be due to invalid IL or missing references) //IL_0314: Expected O, but got Unknown //IL_0347: Unknown result type (might be due to invalid IL or missing references) //IL_0351: Expected O, but got Unknown controlScheme.ConfigUp = ((BaseUnityPlugin)this).Config.Bind<string>(player, "Up Button (" + player + ")", "UpArrow", new ConfigDescription("Move up button", (AcceptableValueBase)(object)KeyboardButtons, Array.Empty<object>())); controlScheme.ConfigDown = ((BaseUnityPlugin)this).Config.Bind<string>(player, "Down Button (" + player + ")", "DownArrow", new ConfigDescription("Move down button", (AcceptableValueBase)(object)KeyboardButtons, Array.Empty<object>())); controlScheme.ConfigLeft = ((BaseUnityPlugin)this).Config.Bind<string>(player, "Left Button (" + player + ")", "LeftArrow", new ConfigDescription("Move left button", (AcceptableValueBase)(object)KeyboardButtons, Array.Empty<object>())); controlScheme.ConfigRight = ((BaseUnityPlugin)this).Config.Bind<string>(player, "Right Button (" + player + ")", "RightArrow", new ConfigDescription("Move right button", (AcceptableValueBase)(object)KeyboardButtons, Array.Empty<object>())); controlScheme.ConfigA = ((BaseUnityPlugin)this).Config.Bind<string>(player, "Attack Button (" + player + ")", "A", new ConfigDescription("Attack button / West Button", (AcceptableValueBase)(object)KeyboardButtons, Array.Empty<object>())); controlScheme.ConfigS = ((BaseUnityPlugin)this).Config.Bind<string>(player, "Grapple Button (" + player + ")", "S", new ConfigDescription("Grapple button / North Button", (AcceptableValueBase)(object)KeyboardButtons, Array.Empty<object>())); controlScheme.ConfigZ = ((BaseUnityPlugin)this).Config.Bind<string>(player, "Run Button (" + player + ")", "Z", new ConfigDescription("Run button / South Button", (AcceptableValueBase)(object)KeyboardButtons, Array.Empty<object>())); controlScheme.ConfigX = ((BaseUnityPlugin)this).Config.Bind<string>(player, "Pick Up Button (" + player + ")", "X", new ConfigDescription("Pick up button / East Button", (AcceptableValueBase)(object)KeyboardButtons, Array.Empty<object>())); controlScheme.ConfigSpace = ((BaseUnityPlugin)this).Config.Bind<string>(player, "Taunt Button (" + player + ")", "Space", new ConfigDescription("Taunt button", (AcceptableValueBase)(object)KeyboardButtons, Array.Empty<object>())); controlScheme.ConfigShift = ((BaseUnityPlugin)this).Config.Bind<string>(player, "Focus (Shift) Button (" + player + ")", "LeftShift", new ConfigDescription("Change focus (shift) button / Left Shoulder Button", (AcceptableValueBase)(object)KeyboardButtons, Array.Empty<object>())); controlScheme.ConfigControl = ((BaseUnityPlugin)this).Config.Bind<string>(player, "Focus (Control) Button (" + player + ")", "LeftControl", new ConfigDescription("Change focus (control) button / Right Shoulder Button", (AcceptableValueBase)(object)KeyboardButtons, Array.Empty<object>())); controlScheme.ConfigTab = ((BaseUnityPlugin)this).Config.Bind<string>(player, "Change Control (TAB) Button (" + player + ")", "Tab", new ConfigDescription("Left Trigger Button / Right Trigger", (AcceptableValueBase)(object)KeyboardButtons, Array.Empty<object>())); controlScheme.ConfigLeftTrigger = ((BaseUnityPlugin)this).Config.Bind<string>(player, "LeftTrigger (" + player + ")", "None", new ConfigDescription("Change the left trigger button / Left Trigger", (AcceptableValueBase)(object)KeyboardButtons, Array.Empty<object>())); controlScheme.ConfigJoin = ((BaseUnityPlugin)this).Config.Bind<string>(player, "Join Button (" + player + ")", "None", new ConfigDescription("\"Join\" button that let's you join a game in progress", (AcceptableValueBase)(object)KeyboardButtons, Array.Empty<object>())); } private void Awake() { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Expected O, but got Unknown //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Expected O, but got Unknown //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Expected O, but got Unknown Log = ((BaseUnityPlugin)this).Logger; PluginPath = Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location); ConfigAdd = ((BaseUnityPlugin)this).Config.Bind<string>("General", "AddPlayer Button", "KeypadPlus", new ConfigDescription("Button to add a new \"fake\" keyboard", (AcceptableValueBase)(object)KeyboardButtons, Array.Empty<object>())); ConfigRemove = ((BaseUnityPlugin)this).Config.Bind<string>("General", "RemovePlayer Button", "KeypadMinus", new ConfigDescription("Button to remove a new \"fake\" keyboard", (AcceptableValueBase)(object)KeyboardButtons, Array.Empty<object>())); ConfigControllerMode = ((BaseUnityPlugin)this).Config.Bind<string>("General", "ControllerMode", "KeypadEnter", new ConfigDescription("Will toggle a controller mode so you can use the keyboard in the main ", (AcceptableValueBase)(object)KeyboardButtons, Array.Empty<object>())); SetupControls(Player[0], "Main Keyboard Player"); SetupControls(Player[1], "Additional Player 1"); SetupControls(Player[2], "Additional Player 2"); SetupControls(Player[3], "Additional Player 3"); } private void OnEnable() { Harmony.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Loaded MultiBind!"); } private void OnDisable() { Harmony.UnpatchSelf(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Unloaded MultiBind!"); } private void Update() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Expected O, but got Unknown Scene activeScene = SceneManager.GetActiveScene(); if (((Scene)(ref activeScene)).name == "Controllers" && Input.GetKeyDown(Ulil.GetKeyCode(ConfigControllerMode.Value))) { Debug.LogWarning((object)"REFRESH"); } activeScene = SceneManager.GetActiveScene(); if (!(((Scene)(ref activeScene)).name == "Titles")) { return; } if (Input.GetKeyDown(Ulil.GetKeyCode(ConfigRemove.Value))) { for (int i = 1; i <= 3; i++) { if (KeyboardInstance[i] > HKJOAJOKOIJ.NGCNKGDDKGF) { KeyboardInstance[i] = -1; } } for (int i = 3; i > 0; i--) { if (KeyboardInstance[i] != -1) { HKJOAJOKOIJ.NGCNKGDDKGF--; KeyboardInstance[i] = -1; break; } } } if (Input.GetKeyDown(Ulil.GetKeyCode(ConfigAdd.Value))) { for (int j = 1; j <= 3; j++) { if (KeyboardInstance[j] > HKJOAJOKOIJ.NGCNKGDDKGF) { KeyboardInstance[j] = -1; } } for (int j = 1; j <= 3; j++) { if (KeyboardInstance[j] == -1) { int num = HKJOAJOKOIJ.NGCNKGDDKGF + 1; HKJOAJOKOIJ.NAADDLFFIHG[num] = new BJMGCKGNCHO(); HKJOAJOKOIJ.NAADDLFFIHG[num].PLFGKLGCOMD = j; KeyboardInstance[j] = num; HKJOAJOKOIJ.NAADDLFFIHG[num].AHBNKMMMGFI = 1; HKJOAJOKOIJ.NAADDLFFIHG[num].BPJFLJPKKJK = 0; HKJOAJOKOIJ.NAADDLFFIHG[num].CMECDGMCMLC = "Virtual"; if (NAEEIFNFBBO.GAABAPFHBPM <= 1) { HKJOAJOKOIJ.NAADDLFFIHG[num].BPJFLJPKKJK = ControllerModeInt; HKJOAJOKOIJ.NAADDLFFIHG[num].CMECDGMCMLC = "FakeKeyboard"; } HKJOAJOKOIJ.NGCNKGDDKGF++; break; } } } if (!Input.GetKeyDown(Ulil.GetKeyCode(ConfigControllerMode.Value))) { return; } ControllerMode = !ControllerMode; if (ControllerMode) { ControllerModeInt = 3; MOIHOCAMOOE.BPJFLJPKKJK = 0; } else { ControllerModeInt = 1; MOIHOCAMOOE.BPJFLJPKKJK = 1; } HKJOAJOKOIJ.NAADDLFFIHG[0].BPJFLJPKKJK = ControllerModeInt; HKJOAJOKOIJ.NAADDLFFIHG[0].CMECDGMCMLC = "Keyboard"; HKJOAJOKOIJ.NAADDLFFIHG[0].AHBNKMMMGFI = 1; for (int k = 0; k < 4; k++) { if (KeyboardInstance[k] != -1) { HKJOAJOKOIJ.NAADDLFFIHG[KeyboardInstance[k]].BPJFLJPKKJK = ControllerModeInt; } } } public static void HandleControls(BJMGCKGNCHO __instance, ControlScheme scheme) { //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_02f6: Unknown result type (might be due to invalid IL or missing references) __instance.NHFPIIKCNFO(); __instance.LMADDGDMBGB = Mathf.MoveTowards(__instance.LMADDGDMBGB, 0f, 1f * MBLIOKEDHHB.MCJHGEHEPMD); if (LIPNHOMGGHF.FAKHAFKOBPB == 50 && __instance.AHBNKMMMGFI > 0 && __instance.FOAPDJMIFGP > 0) { __instance.NAIJAHOFCLC++; } else { __instance.NAIJAHOFCLC = 0; } __instance.JLBOEDNDIPI = 0f; __instance.MGJCMCPCPDN = 0f; __instance.IOIJFFLMBCH[1] = 0; __instance.IOIJFFLMBCH[2] = 0; __instance.IOIJFFLMBCH[3] = 0; __instance.IOIJFFLMBCH[4] = 0; __instance.IOIJFFLMBCH[5] = 0; __instance.IOIJFFLMBCH[6] = 0; __instance.FHBEOIPFFDA = 0; __instance.OHEIJEDGKLJ = 0; __instance.EMJMDDNMFFA = 0f; __instance.PNGFDALFGLE = 0f; if (Input.GetKey(Ulil.GetKeyCode(scheme.ConfigJoin.Value))) { __instance.JIIMLBLGKAL(0); } if (Input.GetKey(Ulil.GetKeyCode(scheme.ConfigUp.Value))) { __instance.JLBOEDNDIPI = 1f; } if (Input.GetKey(Ulil.GetKeyCode(scheme.ConfigDown.Value))) { __instance.JLBOEDNDIPI = -1f; } if (Input.GetKey(Ulil.GetKeyCode(scheme.ConfigRight.Value))) { __instance.MGJCMCPCPDN = 1f; } if (Input.GetKey(Ulil.GetKeyCode(scheme.ConfigLeft.Value))) { __instance.MGJCMCPCPDN = -1f; } if (Input.GetKey(Ulil.GetKeyCode(scheme.ConfigS.Value))) { __instance.IOIJFFLMBCH[1] = 1; } if (Input.GetKey(Ulil.GetKeyCode(scheme.ConfigX.Value))) { __instance.IOIJFFLMBCH[2] = 1; } if (Input.GetKey(Ulil.GetKeyCode(scheme.ConfigZ.Value))) { __instance.IOIJFFLMBCH[3] = 1; } if (Input.GetKey(Ulil.GetKeyCode(scheme.ConfigA.Value))) { __instance.IOIJFFLMBCH[4] = 1; } if (Input.GetKey(Ulil.GetKeyCode(scheme.ConfigSpace.Value))) { __instance.IOIJFFLMBCH[5] = 1; } if (Input.GetKey(Ulil.GetKeyCode(scheme.ConfigShift.Value))) { __instance.IOIJFFLMBCH[6] = -1; if (ControllerMode) { __instance.FHBEOIPFFDA = 1; } } if (Input.GetKey(Ulil.GetKeyCode(scheme.ConfigControl.Value))) { __instance.IOIJFFLMBCH[6] = 1; if (ControllerMode) { __instance.OHEIJEDGKLJ = 1; } } if (Input.GetKey(Ulil.GetKeyCode(scheme.ConfigTab.Value))) { __instance.EMJMDDNMFFA = 1f; } if (Input.GetKey(Ulil.GetKeyCode(scheme.ConfigLeftTrigger.Value))) { __instance.PNGFDALFGLE = 1f; } __instance.IMBKMMOCBBF = __instance.MGJCMCPCPDN; __instance.PNLIFOBMMGG = __instance.JLBOEDNDIPI; if (__instance.PNGFDALFGLE < 0.5f) { __instance.PNGFDALFGLE = 0f; } if (__instance.EMJMDDNMFFA < 0.5f) { __instance.EMJMDDNMFFA = 0f; } if (__instance.PNGFDALFGLE >= 1f && __instance.EMJMDDNMFFA < 1f) { __instance.FCLGPMFNEPE = -1f; } if (__instance.EMJMDDNMFFA >= 1f && __instance.PNGFDALFGLE < 1f) { __instance.FCLGPMFNEPE = 1f; } if (__instance.PNGFDALFGLE >= 1f && __instance.EMJMDDNMFFA >= 1f) { if (__instance.FCLGPMFNEPE == 1f) { __instance.FCLGPMFNEPE = -2f; } if (__instance.FCLGPMFNEPE == -1f) { __instance.FCLGPMFNEPE = 2f; } } if (__instance.PNGFDALFGLE < 1f && __instance.EMJMDDNMFFA < 1f) { __instance.FCLGPMFNEPE = 0f; } if (NAEEIFNFBBO.GAABAPFHBPM == 1 && __instance.HPOKFBBGEBG() != 0f) { Cursor.visible = false; } if (__instance.PLFGKLGCOMD > 0 && __instance.AHBNKMMMGFI > 0 && HKJOAJOKOIJ.EMLDNFEIKCK != __instance.PLFGKLGCOMD) { __instance.BDCKBOLGDNB(); } if (LIPNHOMGGHF.FAKHAFKOBPB == 50 && __instance.BPJFLJPKKJK >= 2 && __instance.AHBNKMMMGFI > 0 && __instance.FOAPDJMIFGP == 0 && __instance.DHBFOHLEFOD[2] > 0) { __instance.JIIMLBLGKAL(0); } } } }