From 810facf50e5fb5fbcd8dd43702060f655d70552f Mon Sep 17 00:00:00 2001 From: David Higueros <111460331+TheDavSmasher@users.noreply.github.com> Date: Sun, 12 Jul 2026 22:12:56 -0600 Subject: [PATCH] Added canRepeat parameter --- MiraAPI/Hud/CustomMultiSelectMenu.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/MiraAPI/Hud/CustomMultiSelectMenu.cs b/MiraAPI/Hud/CustomMultiSelectMenu.cs index 646ea2a7..5fd597ca 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;