mOptionGroups: populate RSG_TRICKS with loop (#4909)

There were some tricks missing, using loop makes one less place to update when adding tricks
This commit is contained in:
Philip Dubé 2025-01-19 19:49:59 +00:00 committed by GitHub
parent 7a7eed74db
commit ed674f1ed2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -532,190 +532,17 @@ void Settings::CreateOptions() {
&mOptions[RSK_SKULLS_SUNS_SONG],
});
// TODO: Exclude Locations Menus
mOptionGroups[RSG_TRICKS] = OptionGroup::SubGroup("Logical Tricks", {
&mTrickOptions[RT_VISIBLE_COLLISION],
&mTrickOptions[RT_GROTTOS_WITHOUT_AGONY],
&mTrickOptions[RT_FEWER_TUNIC_REQUIREMENTS],
&mTrickOptions[RT_RUSTED_SWITCHES],
&mTrickOptions[RT_FLAMING_CHESTS],
&mTrickOptions[RT_BUNNY_HOOD_JUMPS],
&mTrickOptions[RT_DAMAGE_BOOST_SIMPLE],
&mTrickOptions[RT_HOVER_BOOST_SIMPLE],
&mTrickOptions[RT_KF_ADULT_GS],
&mTrickOptions[RT_LW_BRIDGE],
&mTrickOptions[RT_LW_MIDO_BACKFLIP],
&mTrickOptions[RT_LW_GS_BEAN],
&mTrickOptions[RT_HC_STORMS_GS],
&mTrickOptions[RT_KAK_MAN_ON_ROOF],
&mTrickOptions[RT_KAK_TOWER_GS],
&mTrickOptions[RT_KAK_ADULT_WINDMILL_POH],
&mTrickOptions[RT_KAK_CHILD_WINDMILL_POH],
&mTrickOptions[RT_KAK_ROOFTOP_GS],
&mTrickOptions[RT_GY_POH],
&mTrickOptions[RT_GY_CHILD_DAMPE_RACE_POH],
&mTrickOptions[RT_GY_SHADOW_FIRE_ARROWS],
&mTrickOptions[RT_DMT_SOIL_GS],
&mTrickOptions[RT_DMT_BOMBABLE],
&mTrickOptions[RT_DMT_HOOKSHOT_LOWER_GS],
&mTrickOptions[RT_DMT_HOVERS_LOWER_GS],
&mTrickOptions[RT_DMT_BEAN_LOWER_GS],
&mTrickOptions[RT_DMT_JS_LOWER_GS],
&mTrickOptions[RT_DMT_CLIMB_HOVERS],
&mTrickOptions[RT_DMT_UPPER_GS],
&mTrickOptions[RT_DMT_BOLERO_BIGGORON],
&mTrickOptions[RT_GC_POT],
&mTrickOptions[RT_GC_POT_STRENGTH],
&mTrickOptions[RT_GC_ROLLING_STRENGTH],
&mTrickOptions[RT_GC_LEFTMOST],
&mTrickOptions[RT_GC_GROTTO],
&mTrickOptions[RT_GC_LINK_GORON_DINS],
&mTrickOptions[RT_DMC_HOVER_BEAN_POH],
&mTrickOptions[RT_DMC_BOLERO_JUMP],
&mTrickOptions[RT_DMC_BOULDER_JS],
&mTrickOptions[RT_DMC_BOULDER_SKIP],
&mTrickOptions[RT_ZR_LOWER],
&mTrickOptions[RT_ZR_UPPER],
&mTrickOptions[RT_ZR_HOVERS],
&mTrickOptions[RT_ZR_CUCCO],
&mTrickOptions[RT_ZD_KING_ZORA_SKIP],
&mTrickOptions[RT_ZD_GS],
&mTrickOptions[RT_ZF_GREAT_FAIRY_WITHOUT_EXPLOSIVES],
&mTrickOptions[RT_LH_LAB_WALL_GS],
&mTrickOptions[RT_LH_LAB_DIVING],
&mTrickOptions[RT_LH_WATER_HOOKSHOT],
&mTrickOptions[RT_GV_CRATE_HOVERS],
&mTrickOptions[RT_GF_KITCHEN],
&mTrickOptions[RT_GF_JUMP],
&mTrickOptions[RT_HW_BUNNY_CROSSING],
&mTrickOptions[RT_HW_CROSSING],
&mTrickOptions[RT_LENS_HW],
&mTrickOptions[RT_HW_REVERSE],
&mTrickOptions[RT_COLOSSUS_GS],
&mTrickOptions[RT_DEKU_BASEMENT_GS],
&mTrickOptions[RT_DEKU_B1_SKIP],
&mTrickOptions[RT_DEKU_B1_BOW_WEBS],
&mTrickOptions[RT_DEKU_B1_BACKFLIP_OVER_SPIKED_LOG],
&mTrickOptions[RT_DEKU_MQ_COMPASS_GS],
&mTrickOptions[RT_DEKU_MQ_LOG],
&mTrickOptions[RT_DC_SCARECROW_GS],
&mTrickOptions[RT_DC_VINES_GS],
&mTrickOptions[RT_DC_STAIRCASE],
&mTrickOptions[RT_DC_SLINGSHOT_SKIP],
&mTrickOptions[RT_DC_SCRUB_ROOM],
&mTrickOptions[RT_DC_JUMP],
&mTrickOptions[RT_DC_HAMMER_FLOOR],
&mTrickOptions[RT_DC_MQ_CHILD_BOMBS],
&mTrickOptions[RT_DC_MQ_CHILD_EYES],
&mTrickOptions[RT_DC_MQ_ADULT_EYES],
&mTrickOptions[RT_JABU_ALCOVE_JUMP_DIVE],
&mTrickOptions[RT_JABU_BOSS_HOVER],
&mTrickOptions[RT_JABU_NEAR_BOSS_RANGED],
&mTrickOptions[RT_JABU_NEAR_BOSS_EXPLOSIVES],
&mTrickOptions[RT_LENS_JABU_MQ],
&mTrickOptions[RT_JABU_MQ_RANG_JUMP],
&mTrickOptions[RT_JABU_MQ_SOT_GS],
&mTrickOptions[RT_LENS_BOTW],
&mTrickOptions[RT_BOTW_CHILD_DEADHAND],
&mTrickOptions[RT_BOTW_BASEMENT],
&mTrickOptions[RT_BOTW_MQ_PITS],
&mTrickOptions[RT_BOTW_MQ_DEADHAND_KEY],
&mTrickOptions[RT_FOREST_FIRST_GS],
&mTrickOptions[RT_FOREST_OUTDOORS_EAST_GS],
&mTrickOptions[RT_FOREST_VINES],
&mTrickOptions[RT_FOREST_OUTDOORS_LEDGE],
&mTrickOptions[RT_FOREST_DOORFRAME],
&mTrickOptions[RT_FOREST_OUTSIDE_BACKDOOR],
&mTrickOptions[RT_FOREST_OUTDOORS_HEARTS_BOOMERANG],
&mTrickOptions[RT_FOREST_MQ_WELL_SWIM],
&mTrickOptions[RT_FOREST_MQ_BLOCK_PUZZLE],
&mTrickOptions[RT_FOREST_MQ_JS_HALLWAY_SWITCH],
&mTrickOptions[RT_FOREST_MQ_HOOKSHOT_HALLWAY_SWITCH],
&mTrickOptions[RT_FOREST_MQ_RANG_HALLWAY_SWITCH],
&mTrickOptions[RT_FIRE_BOSS_DOOR_JUMP],
&mTrickOptions[RT_FIRE_SOT],
&mTrickOptions[RT_FIRE_STRENGTH],
&mTrickOptions[RT_FIRE_SCARECROW],
&mTrickOptions[RT_FIRE_FLAME_MAZE],
&mTrickOptions[RT_FIRE_MQ_NEAR_BOSS],
&mTrickOptions[RT_FIRE_MQ_BLOCKED_CHEST],
&mTrickOptions[RT_FIRE_MQ_BK_CHEST],
&mTrickOptions[RT_FIRE_MQ_CLIMB],
&mTrickOptions[RT_FIRE_MQ_MAZE_SIDE_ROOM],
&mTrickOptions[RT_FIRE_MQ_MAZE_HOVERS],
&mTrickOptions[RT_FIRE_MQ_MAZE_JUMP],
&mTrickOptions[RT_FIRE_MQ_ABOVE_MAZE_GS],
&mTrickOptions[RT_FIRE_MQ_FLAME_MAZE],
&mTrickOptions[RT_WATER_LONGSHOT_TORCH],
&mTrickOptions[RT_WATER_CRACKED_WALL_HOVERS],
&mTrickOptions[RT_WATER_CRACKED_WALL],
&mTrickOptions[RT_WATER_BK_REGION],
&mTrickOptions[RT_WATER_NORTH_BASEMENT_LEDGE_JUMP],
&mTrickOptions[RT_WATER_BK_JUMP_DIVE],
&mTrickOptions[RT_WATER_FW_CENTRAL_GS],
&mTrickOptions[RT_WATER_IRONS_CENTRAL_GS],
&mTrickOptions[RT_WATER_CENTRAL_BOW],
&mTrickOptions[RT_WATER_HOOKSHOT_FALLING_PLATFORM_GS],
&mTrickOptions[RT_WATER_RANG_FALLING_PLATFORM_GS],
&mTrickOptions[RT_WATER_RIVER_GS],
&mTrickOptions[RT_WATER_DRAGON_JUMP_DIVE],
&mTrickOptions[RT_WATER_ADULT_DRAGON],
&mTrickOptions[RT_WATER_CHILD_DRAGON],
&mTrickOptions[RT_WATER_MQ_CENTRAL_PILLAR],
&mTrickOptions[RT_WATER_MQ_LOCKED_GS],
&mTrickOptions[RT_LENS_SHADOW],
&mTrickOptions[RT_LENS_SHADOW_PLATFORM],
&mTrickOptions[RT_LENS_BONGO],
&mTrickOptions[RT_SHADOW_UMBRELLA],
&mTrickOptions[RT_SHADOW_UMBRELLA_GS],
&mTrickOptions[RT_SHADOW_FREESTANDING_KEY],
&mTrickOptions[RT_SHADOW_STATUE],
&mTrickOptions[RT_SHADOW_BONGO],
&mTrickOptions[RT_LENS_SHADOW_MQ],
&mTrickOptions[RT_LENS_SHADOW_MQ_INVISIBLE_BLADES],
&mTrickOptions[RT_LENS_SHADOW_MQ_PLATFORM],
&mTrickOptions[RT_LENS_SHADOW_MQ_DEADHAND],
&mTrickOptions[RT_SHADOW_MQ_GAP],
&mTrickOptions[RT_SHADOW_MQ_INVISIBLE_BLADES],
&mTrickOptions[RT_SHADOW_MQ_HUGE_PIT],
&mTrickOptions[RT_SHADOW_MQ_WINDY_WALKWAY],
&mTrickOptions[RT_LENS_SPIRIT],
&mTrickOptions[RT_SPIRIT_CHILD_CHU],
&mTrickOptions[RT_SPIRIT_LOBBY_GS],
&mTrickOptions[RT_SPIRIT_LOWER_ADULT_SWITCH],
&mTrickOptions[RT_SPIRIT_LOBBY_JUMP],
&mTrickOptions[RT_SPIRIT_PLATFORM_HOOKSHOT],
&mTrickOptions[RT_SPIRIT_MAP_CHEST],
&mTrickOptions[RT_SPIRIT_SUN_CHEST],
&mTrickOptions[RT_SPIRIT_WALL],
&mTrickOptions[RT_LENS_SPIRIT_MQ],
&mTrickOptions[RT_SPIRIT_MQ_SUN_BLOCK_SOT],
&mTrickOptions[RT_SPIRIT_MQ_SUN_BLOCK_GS],
&mTrickOptions[RT_SPIRIT_MQ_LOWER_ADULT],
&mTrickOptions[RT_SPIRIT_MQ_FROZEN_EYE],
&mTrickOptions[RT_ICE_BLOCK_GS],
&mTrickOptions[RT_ICE_MQ_RED_ICE_GS],
&mTrickOptions[RT_ICE_MQ_SCARECROW],
&mTrickOptions[RT_LENS_GTG],
&mTrickOptions[RT_GTG_WITHOUT_HOOKSHOT],
&mTrickOptions[RT_GTG_FAKE_WALL],
&mTrickOptions[RT_LENS_GTG_MQ],
&mTrickOptions[RT_GTG_MQ_WITH_HOOKSHOT],
&mTrickOptions[RT_GTG_MQ_WIHTOUT_HOOKSHOT],
&mTrickOptions[RT_LENS_GANON],
&mTrickOptions[RT_GANON_SPIRIT_TRIAL_HOOKSHOT],
&mTrickOptions[RT_LENS_GANON_MQ],
&mTrickOptions[RT_GANON_MQ_FIRE_TRIAL],
&mTrickOptions[RT_GANON_MQ_SHADOW_TRIAL],
&mTrickOptions[RT_GANON_MQ_LIGHT_TRIAL],
});
mTricksByArea.clear();
std::vector<Option*> tricksOption(mTrickOptions.size());
for (int i = 0; i < RT_MAX; i++) {
auto& trick = mTrickOptions[i];
if (!trick.GetName().empty()) {
mTrickNameToEnum[std::string(trick.GetName())] = static_cast<RandomizerTrick>(i);
auto trick = &mTrickOptions[i];
if (!trick->GetName().empty()) {
tricksOption.push_back(trick);
mTrickNameToEnum[std::string(trick->GetName())] = static_cast<RandomizerTrick>(i);
mTricksByArea[trick->GetArea()].push_back(static_cast<RandomizerTrick>(i));
}
mTricksByArea[trick.GetArea()].push_back(static_cast<RandomizerTrick>(i));
}
mOptionGroups[RSG_TRICKS] = OptionGroup::SubGroup("Logical Tricks", tricksOption);
// TODO: Glitches
mOptionGroups[RSG_AREA_ACCESS_IMGUI] = OptionGroup::SubGroup("Area Access", {
&mOptions[RSK_FOREST],