diff --git a/MiraAPI/Hud/CustomMultiSelectMenu.cs b/MiraAPI/Hud/CustomMultiSelectMenu.cs index 646ea2a..5fd597c 100644 --- a/MiraAPI/Hud/CustomMultiSelectMenu.cs +++ b/MiraAPI/Hud/CustomMultiSelectMenu.cs @@ -26,6 +26,7 @@ public abstract class CustomMultiSelectMenu(IntPtr il2CppPtr) { private int totalSelections; private bool shouldConfirm; + private bool canRepeat; private readonly List selectedEntries = []; private LoadableAsset? hoverSelectSprite; @@ -68,13 +69,15 @@ public abstract class CustomMultiSelectMenu(IntPtr il2CppPtr) /// Function called when all selections are made/confirmed. /// The number of selections required. /// Wheter the entire selection should be confirmed manually. + /// If the same entry can be selected multiple times, else unselect entry on click. [HideFromIl2Cpp] - protected void Begin(IEnumerable entries, Action?> onClick, int totalSelections, bool shouldConfirm) + protected void Begin(IEnumerable entries, Action?> onClick, int totalSelections, bool shouldConfirm, bool canRepeat = false) { MinigameStubs.Begin(this, null); this.totalSelections = totalSelections; this.shouldConfirm = shouldConfirm; + this.canRepeat = canRepeat; var back = backButton.GetComponent(); back.OnClick.AddListener((UnityAction)(() => { @@ -112,7 +115,7 @@ public abstract class CustomMultiSelectMenu(IntPtr il2CppPtr) { MenuEntry menuEntry = MenuEntries.First(e => e.Entry == entry); - if (selectedEntries.Remove(menuEntry)) // Unselect previous choice + if (!canRepeat && selectedEntries.Remove(menuEntry)) // Unselect previous choice { SetNameplateAppearance(menuEntry, false); return;