Some mods may be broken due to the recent Alloyed Collective update.
Decompiled source of SeparateSwitchEquipmentKey v1.0.0
plugins/viliger-SeparateSwitchEquipmentKey/SeparateSwitchEquipmentKey.dll
Decompiled 2 weeks agousing System.Collections.Generic; 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 On.RoR2; using Rebindables; using Rewired; using RoR2; using RoR2BepInExPack.GameAssetPathsBetter; using UnityEngine; using UnityEngine.AddressableAssets; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("SeparateSwitchEquipmentKey")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("SeparateSwitchEquipmentKey")] [assembly: AssemblyTitle("SeparateSwitchEquipmentKey")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace SeparateSwitchEquipmentKey; [BepInPlugin("com.Viliger.SeparateSwitchEquipmentKey", "SeparateSwitchEquipmentKey", "1.0.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class SeparateSwitchEquipmentKeyPlugin : BaseUnityPlugin { public const string Author = "Viliger"; public const string ModName = "SeparateSwitchEquipmentKey"; public const string Version = "1.0.0"; public const string GUID = "com.Viliger.SeparateSwitchEquipmentKey"; public static ModKeybind SwitchEquipment; private void Awake() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) Language.collectLanguageRootFolders += Language_collectLanguageRootFolders; SwitchEquipment = RebindAPI.RegisterModKeybind(new ModKeybind("VILIGER_KEYBIND_SWITCH_EQUIPMENT", (KeyCode)120, 14, (string)null, (InputActionType)1, (AxisRange)0)); EquipmentSlot.Start += new hook_Start(EquipmentSlot_Start); GameObject obj = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_UI.HUDSimple_prefab).WaitForCompletion(); Transform val = obj.transform.Find("MainContainer/MainUIArea/SpringCanvas/BottomRightCluster/Scaler/AltEquipmentSlot/DisplayRoot/ExtraEquipmentKey/NextIcon"); if (Object.op_Implicit((Object)(object)val)) { ((Component)val).gameObject.SetActive(false); } Transform val2 = obj.transform.Find("MainContainer/MainUIArea/SpringCanvas/BottomRightCluster/Scaler/AltEquipmentSlot/DisplayRoot/ExtraEquipmentKey/PrevIcon"); if (Object.op_Implicit((Object)(object)val2)) { ((Component)val2).gameObject.SetActive(true); Transform val3 = val2.Find("EquipmentKeyText"); if (Object.op_Implicit((Object)(object)val3)) { ((Component)val3).gameObject.GetComponent<InputBindingDisplayController>().actionName = "VILIGERKEYBINDSWITCHEQUIPMENT"; } } } private void EquipmentSlot_Start(orig_Start orig, EquipmentSlot self) { orig.Invoke(self); ((Component)self).gameObject.AddComponent<SwitchEquipmentInputHandler>().equipmentSlot = self; } private void Language_collectLanguageRootFolders(List<string> folders) { folders.Add(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "Language")); } } public class SwitchEquipmentInputHandler : MonoBehaviour { public EquipmentSlot equipmentSlot; private void Awake() { if (!Object.op_Implicit((Object)(object)equipmentSlot)) { equipmentSlot = ((Component)this).GetComponent<EquipmentSlot>(); } } private void FixedUpdate() { //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)equipmentSlot) && Object.op_Implicit((Object)(object)equipmentSlot.inventory) && Object.op_Implicit((Object)(object)equipmentSlot.inputBank) && equipmentSlot.hasEffectiveAuthority && Object.op_Implicit((Object)(object)equipmentSlot.characterBody) && equipmentSlot.characterBody.isEquipmentActivationAllowed && equipmentSlot.inventory.GetItemCountEffective(Items.ExtraEquipment) > 0) { ButtonState buttonState = InputBankExtensions.GetButtonState(equipmentSlot.inputBank, SeparateSwitchEquipmentKeyPlugin.SwitchEquipment); if (((ButtonState)(ref buttonState)).justPressed) { equipmentSlot.inventory.DispatchSwitchToNextEquipmentInSet(); } } } }