[Enhancement] Allow Non-unique Character Selections (#638)

* Update PortMenu.cpp

* Update menus.c
This commit is contained in:
MegaMech
2026-02-04 17:19:05 -07:00
committed by GitHub
parent ddd47126ec
commit 2b9d689b2f
2 changed files with 12 additions and 3 deletions
+5 -2
View File
@@ -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;
}
+7 -1
View File
@@ -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(