mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-19 15:51:48 +00:00
Added shouldConfirm to single selection Begins with default false
This commit is contained in:
1 parent
b3501b47c4
commit
dc909037e8
2 files changed
+6
-4
No files matched your search
@@ -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>
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user