Stickers: replaced haptics option with double-click tab action

This commit is contained in:
NotAKidoS 2024-08-25 22:29:17 -05:00
parent 33a99dac8a
commit 30edef14e5
7 changed files with 37 additions and 7 deletions

View file

@ -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

View file

@ -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;

View file

@ -50,6 +50,9 @@ public static class ModSettings
internal static readonly MelonPreferences_Entry<KeyBind> Entry_PlaceBinding =
Category.CreateEntry("place_binding", KeyBind.G, "Sticker Bind", "The key binding to place stickers.");
internal static readonly MelonPreferences_Entry<TabDoubleClick> 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<string[]> Hidden_SelectedStickerNames =
Category.CreateEntry("selected_sticker_name", Array.Empty<string>(),
display_name: "Selected Sticker Name",

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

View file

@ -22,7 +22,6 @@
<None Remove="Resources\Gohsantosadrive_Icons\Stickers-magic-wand.png" />
<EmbeddedResource Include="Resources\Gohsantosadrive_Icons\Stickers-magic-wand.png" />
<None Remove="Resources\Gohsantosadrive_Icons\Stickers-pencil.png" />
<EmbeddedResource Include="Resources\Gohsantosadrive_Icons\Stickers-pencil.png" />
<None Remove="Resources\Gohsantosadrive_Icons\Stickers-puzzle.png" />
<EmbeddedResource Include="Resources\Gohsantosadrive_Icons\Stickers-puzzle.png" />
<None Remove="Resources\Gohsantosadrive_Icons\Stickers-rubbish-bin.png" />
@ -31,6 +30,8 @@
<EmbeddedResource Include="Resources\Gohsantosadrive_Icons\Stickers-alphabet.png" />
<None Remove="Resources\Gohsantosadrive_Icons\Stickers-magnifying-glass.png" />
<EmbeddedResource Include="Resources\Gohsantosadrive_Icons\Stickers-magnifying-glass.png" />
<None Remove="Resources\Gohsantosadrive_Icons\Stickers-mouse.png" />
<EmbeddedResource Include="Resources\Gohsantosadrive_Icons\Stickers-mouse.png" />
</ItemGroup>
<ItemGroup>
<Reference Include="BTKUILib">

View file

@ -0,0 +1,9 @@
namespace NAK.Stickers;
internal enum TabDoubleClick
{
ToggleStickerMode,
ClearAllStickers,
ClearSelfStickers,
None
}