diff --git a/Stickers/Integrations/BTKUI/UIAddon.Category.StickersMod.cs b/Stickers/Integrations/BTKUI/UIAddon.Category.StickersMod.cs index 03743bc..22b67bd 100644 --- a/Stickers/Integrations/BTKUI/UIAddon.Category.StickersMod.cs +++ b/Stickers/Integrations/BTKUI/UIAddon.Category.StickersMod.cs @@ -15,6 +15,9 @@ public static partial class BTKUIAddon private static readonly MultiSelection _desktopKeybindSelection = BTKUILibExtensions.CreateMelonMultiSelection(ModSettings.Entry_PlaceBinding); + private static readonly MultiSelection _tabDoubleClickSelection = + BTKUILibExtensions.CreateMelonMultiSelection(ModSettings.Entry_TabDoubleClick); + #region Category Setup private static void Setup_StickersModCategory() @@ -35,8 +38,6 @@ public static partial class BTKUIAddon Button openMultiSelectionButton = _ourCategory.AddButton("Sticker SFX", "Stickers-headset", "Choose the SFX used when a sticker is placed.", ButtonStyle.TextWithIcon); openMultiSelectionButton.OnPress += () => QuickMenuAPI.OpenMultiSelect(_sfxSelection); - - _ourCategory.AddMelonToggle(ModSettings.Entry_HapticsOnPlace); ToggleButton toggleDesktopKeybindButton = _ourCategory.AddToggle("Use Desktop Keybind", "Should the Desktop keybind be active.", ModSettings.Entry_UsePlaceBinding.Value); Button openDesktopKeybindButton = _ourCategory.AddButton("Desktop Keybind", "Stickers-alphabet", "Choose the key binding to place stickers.", ButtonStyle.TextWithIcon); @@ -46,8 +47,9 @@ public static partial class BTKUIAddon ModSettings.Entry_UsePlaceBinding.Value = b; openDesktopKeybindButton.Disabled = !b; }; - - //AddMelonToggle(ref _ourCategory, ModSettings.Entry_UsePlaceBinding); + + Button openTabDoubleClickButton = _ourCategory.AddButton("Tab Double Click", "Stickers-mouse", "Choose the action to perform when double clicking the Stickers tab.", ButtonStyle.TextWithIcon); + openTabDoubleClickButton.OnPress += () => QuickMenuAPI.OpenMultiSelect(_tabDoubleClickSelection); } #endregion Category Setup diff --git a/Stickers/Integrations/BTKUI/UIAddon.Main.cs b/Stickers/Integrations/BTKUI/UIAddon.Main.cs index ce70e2f..76345c0 100644 --- a/Stickers/Integrations/BTKUI/UIAddon.Main.cs +++ b/Stickers/Integrations/BTKUI/UIAddon.Main.cs @@ -30,7 +30,8 @@ public static partial class BTKUIAddon QuickMenuAPI.PrepareIcon(ModSettings.ModName, "Stickers-headset", BTKUILibExtensions.GetIconStream("Gohsantosadrive_Icons.Stickers-headset.png")); QuickMenuAPI.PrepareIcon(ModSettings.ModName, "Stickers-magnifying-glass", BTKUILibExtensions.GetIconStream("Gohsantosadrive_Icons.Stickers-magnifying-glass.png")); QuickMenuAPI.PrepareIcon(ModSettings.ModName, "Stickers-magic-wand", BTKUILibExtensions.GetIconStream("Gohsantosadrive_Icons.Stickers-magic-wand.png")); - QuickMenuAPI.PrepareIcon(ModSettings.ModName, "Stickers-pencil", BTKUILibExtensions.GetIconStream("Gohsantosadrive_Icons.Stickers-pencil.png")); + QuickMenuAPI.PrepareIcon(ModSettings.ModName, "Stickers-mouse", BTKUILibExtensions.GetIconStream("Gohsantosadrive_Icons.Stickers-mouse.png")); + //QuickMenuAPI.PrepareIcon(ModSettings.ModName, "Stickers-pencil", BTKUILibExtensions.GetIconStream("Gohsantosadrive_Icons.Stickers-pencil.png")); QuickMenuAPI.PrepareIcon(ModSettings.ModName, "Stickers-puzzle", BTKUILibExtensions.GetIconStream("Gohsantosadrive_Icons.Stickers-puzzle.png")); QuickMenuAPI.PrepareIcon(ModSettings.ModName, "Stickers-rubbish-bin", BTKUILibExtensions.GetIconStream("Gohsantosadrive_Icons.Stickers-rubbish-bin.png")); } @@ -82,7 +83,21 @@ public static partial class BTKUIAddon TimeSpan timeDifference = DateTime.Now - lastTime; if (timeDifference.TotalSeconds <= 0.5) { - StickerSystem.Instance.IsInStickerMode = !StickerSystem.Instance.IsInStickerMode; + switch (ModSettings.Entry_TabDoubleClick.Value) + { + default: + case TabDoubleClick.ToggleStickerMode: + OnPlaceStickersButtonClick(); + break; + case TabDoubleClick.ClearAllStickers: + OnClearAllStickersButtonClick(); + break; + case TabDoubleClick.ClearSelfStickers: + OnClearSelfStickersButtonClick(); + break; + case TabDoubleClick.None: + break; + } return; } lastTime = DateTime.Now; diff --git a/Stickers/ModSettings.cs b/Stickers/ModSettings.cs index 8c15b5c..0278f3e 100644 --- a/Stickers/ModSettings.cs +++ b/Stickers/ModSettings.cs @@ -50,6 +50,9 @@ public static class ModSettings internal static readonly MelonPreferences_Entry Entry_PlaceBinding = Category.CreateEntry("place_binding", KeyBind.G, "Sticker Bind", "The key binding to place stickers."); + internal static readonly MelonPreferences_Entry Entry_TabDoubleClick = + Category.CreateEntry("tab_double_click", TabDoubleClick.ToggleStickerMode, "Tab Double Click", "The action to perform when double clicking the Stickers tab."); + internal static readonly MelonPreferences_Entry Hidden_SelectedStickerNames = Category.CreateEntry("selected_sticker_name", Array.Empty(), display_name: "Selected Sticker Name", diff --git a/Stickers/Resources/Gohsantosadrive_Icons/Stickers-mouse.png b/Stickers/Resources/Gohsantosadrive_Icons/Stickers-mouse.png new file mode 100644 index 0000000..1315c49 Binary files /dev/null and b/Stickers/Resources/Gohsantosadrive_Icons/Stickers-mouse.png differ diff --git a/Stickers/Resources/Gohsantosadrive_Icons/Stickers-pencil.png b/Stickers/Resources/Gohsantosadrive_Icons/Stickers-pencil.png deleted file mode 100644 index 8dc6558..0000000 Binary files a/Stickers/Resources/Gohsantosadrive_Icons/Stickers-pencil.png and /dev/null differ diff --git a/Stickers/Stickers.csproj b/Stickers/Stickers.csproj index 19f88ea..990d2db 100644 --- a/Stickers/Stickers.csproj +++ b/Stickers/Stickers.csproj @@ -22,7 +22,6 @@ - @@ -31,6 +30,8 @@ + + diff --git a/Stickers/Stickers/Enums/StickerTabDoubleClick.cs b/Stickers/Stickers/Enums/StickerTabDoubleClick.cs new file mode 100644 index 0000000..ad24b85 --- /dev/null +++ b/Stickers/Stickers/Enums/StickerTabDoubleClick.cs @@ -0,0 +1,9 @@ +namespace NAK.Stickers; + +internal enum TabDoubleClick +{ + ToggleStickerMode, + ClearAllStickers, + ClearSelfStickers, + None +} \ No newline at end of file