mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-03 14:59:23 +00:00
[PropUndoButton] Attempt at fixing, is broken
This commit is contained in:
parent
cfaf1e4b91
commit
add93b07ec
1 changed files with 4 additions and 3 deletions
|
@ -3,6 +3,7 @@ using ABI_RC.Core.AudioEffects;
|
||||||
using ABI_RC.Core.Networking;
|
using ABI_RC.Core.Networking;
|
||||||
using ABI_RC.Core.Savior;
|
using ABI_RC.Core.Savior;
|
||||||
using ABI_RC.Core.Util;
|
using ABI_RC.Core.Util;
|
||||||
|
using ABI_RC.Systems.InputManagement.InputModules;
|
||||||
using DarkRift;
|
using DarkRift;
|
||||||
using MelonLoader;
|
using MelonLoader;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
@ -14,7 +15,7 @@ namespace NAK.PropUndoButton;
|
||||||
|
|
||||||
public class PropUndoButton : MelonMod
|
public class PropUndoButton : MelonMod
|
||||||
{
|
{
|
||||||
public static readonly MelonPreferences_Category Category =
|
public static readonly MelonPreferences_Category Category =
|
||||||
MelonPreferences.CreateCategory(nameof(PropUndoButton));
|
MelonPreferences.CreateCategory(nameof(PropUndoButton));
|
||||||
|
|
||||||
public static readonly MelonPreferences_Entry<bool> EntryEnabled =
|
public static readonly MelonPreferences_Entry<bool> EntryEnabled =
|
||||||
|
@ -22,7 +23,7 @@ public class PropUndoButton : MelonMod
|
||||||
|
|
||||||
public static readonly MelonPreferences_Entry<bool> EntryUseSFX =
|
public static readonly MelonPreferences_Entry<bool> EntryUseSFX =
|
||||||
Category.CreateEntry("Use SFX", true, description: "Toggle audio queues for prop spawn, undo, redo, and warning.");
|
Category.CreateEntry("Use SFX", true, description: "Toggle audio queues for prop spawn, undo, redo, and warning.");
|
||||||
|
|
||||||
internal static List<DeletedProp> deletedProps = new List<DeletedProp>();
|
internal static List<DeletedProp> deletedProps = new List<DeletedProp>();
|
||||||
|
|
||||||
// audio clip names, InterfaceAudio adds "PropUndo_" prefix
|
// audio clip names, InterfaceAudio adds "PropUndo_" prefix
|
||||||
|
@ -54,7 +55,7 @@ public class PropUndoButton : MelonMod
|
||||||
postfix: new HarmonyLib.HarmonyMethod(typeof(PropUndoButton).GetMethod(nameof(OnDeletePropByInstanceId), BindingFlags.NonPublic | BindingFlags.Static))
|
postfix: new HarmonyLib.HarmonyMethod(typeof(PropUndoButton).GetMethod(nameof(OnDeletePropByInstanceId), BindingFlags.NonPublic | BindingFlags.Static))
|
||||||
);
|
);
|
||||||
HarmonyInstance.Patch( // desktop input patch so we don't run in menus/gui
|
HarmonyInstance.Patch( // desktop input patch so we don't run in menus/gui
|
||||||
typeof(InputModuleMouseKeyboard).GetMethod(nameof(InputModuleMouseKeyboard.UpdateInput)),
|
typeof(CVRInputModule_Keyboard).GetMethod(nameof(CVRInputModule_Keyboard.UpdateInput)),
|
||||||
postfix: new HarmonyLib.HarmonyMethod(typeof(PropUndoButton).GetMethod(nameof(OnUpdateInput), BindingFlags.NonPublic | BindingFlags.Static))
|
postfix: new HarmonyLib.HarmonyMethod(typeof(PropUndoButton).GetMethod(nameof(OnUpdateInput), BindingFlags.NonPublic | BindingFlags.Static))
|
||||||
);
|
);
|
||||||
HarmonyInstance.Patch( // clear redo list on world change
|
HarmonyInstance.Patch( // clear redo list on world change
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue