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;