Added shouldConfirm to single selection Begins with default false

This commit is contained in:
David Higueros committed 2026-07-12 22:35:54 -06:00
1 parent b3501b47c4
commit dc909037e8
2 files changed
+6 -4

No files matched your search

+3 -2
View File
@@ -108,10 +108,11 @@ public abstract class CustomMultiSelectMenu<TEntry>(IntPtr il2CppPtr)
/// </summary>
/// <param name="entries">All entries to give the custom menu.</param>
/// <param name="onClick">Function called when the selection is made.</param>
/// <param name="shouldConfirm">Wheter the set of both selections should be confirmed manually.</param>
[HideFromIl2Cpp]
protected void Begin(IEnumerable<TEntry> entries, Action<TEntry?> onClick)
protected void Begin(IEnumerable<TEntry> entries, Action<TEntry?> onClick, bool shouldConfirm)
{
Begin(entries, list => onClick(list?[0]), 1, false);
Begin(entries, list => onClick(list?[0]), 1, shouldConfirm);
}
/// <summary>
+3 -2
View File
@@ -36,10 +36,11 @@ public class CustomPlayerMenu(IntPtr il2CppPtr) : CustomMultiSelectMenu<PlayerCo
/// </summary>
/// <param name="playerMatch">Function to determine if player should show in the custom menu.</param>
/// <param name="onClick"><see cref="PassiveButton.OnClick"/> action for player.</param>
/// <param name="shouldConfirm">Wheter the set of both selections should be confirmed manually.</param>
[HideFromIl2Cpp]
public void Begin(Func<PlayerControl, bool> playerMatch, Action<PlayerControl?> onClick)
public void Begin(Func<PlayerControl, bool> playerMatch, Action<PlayerControl?> onClick, bool shouldConfirm = false)
{
Begin(PlayerControl.AllPlayerControls.ToArray().Where(playerMatch), onClick);
Begin(PlayerControl.AllPlayerControls.ToArray().Where(playerMatch), onClick, shouldConfirm);
potentialVictims = EntryPanels;
}