diff options
| author | MegaMech <MegaMech@users.noreply.github.com> | 2026-02-04 17:19:05 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-02-04 17:19:05 -0700 |
| commit | 2b9d689b2f3de534fbd1a93bcd61d7ce3366fc35 (patch) | |
| tree | 3e283d9fd96a39b1bb85019fb7c57565dca73d1a | |
| parent | ddd47126ecc19841cd7fb7adb89767475dbcd707 (diff) | |
[Enhancement] Allow Non-unique Character Selections (#638)
* Update PortMenu.cpp
* Update menus.c
| -rw-r--r-- | src/menus.c | 7 | ||||
| -rw-r--r-- | src/port/ui/PortMenu.cpp | 8 |
2 files changed, 12 insertions, 3 deletions
diff --git a/src/menus.c b/src/menus.c index 59db38443..ab24e419b 100644 --- a/src/menus.c +++ b/src/menus.c @@ -1547,8 +1547,11 @@ GLOBAL_ASM("asm/non_matchings/menus/main_menu_act.s") * hovered character at grid position `gridId` */ bool is_character_spot_free(s32 gridId) { - s32 i; - for (i = 0; i < ARRAY_COUNT(gCharacterGridSelections); i++) { + if (CVarGetInteger("gUniqueCharacterSelections", true) == false) { + return true; + } + + for (size_t i = 0; i < ARRAY_COUNT(gCharacterGridSelections); i++) { if (gridId == gCharacterGridSelections[i]) { return false; } diff --git a/src/port/ui/PortMenu.cpp b/src/port/ui/PortMenu.cpp index 9fc613d29..494917e3a 100644 --- a/src/port/ui/PortMenu.cpp +++ b/src/port/ui/PortMenu.cpp @@ -438,7 +438,13 @@ void PortMenu::AddRulesets() { // AddWidget(path, "Number of Laps", WIDGET_CVAR_SLIDER_INT) // .CVar("gNumLaps") // .Options(UIWidgets::IntSliderOptions().Min().Max(20).Step(1).DefaultValue(3)); - + AddWidget(path, "Unique Character Selections", WIDGET_CVAR_CHECKBOX) + .CVar("gUniqueCharacterSelections") + .Options(CheckboxOptions() + .Tooltip( + "Prevents players from selecting the same character") + .DefaultValue(true) + ); AddWidget(path, "No Itemboxes", WIDGET_CVAR_CHECKBOX) .CVar("gDisableItemboxes") .Options(CheckboxOptions().Tooltip( |
