From e25058c25697c40b356f0a12bedc64fa10c3ffce Mon Sep 17 00:00:00 2001 From: Malkierian Date: Sun, 23 Mar 2025 21:34:06 -0700 Subject: [PATCH 01/12] Fix sleeping waterfall enhancement and rando option combinations. (#5199) --- .../Enhancements/timesaver_hook_handlers.cpp | 23 +++++-------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/soh/soh/Enhancements/timesaver_hook_handlers.cpp b/soh/soh/Enhancements/timesaver_hook_handlers.cpp index 1db34b4f64e..78b43ae2a0a 100644 --- a/soh/soh/Enhancements/timesaver_hook_handlers.cpp +++ b/soh/soh/Enhancements/timesaver_hook_handlers.cpp @@ -880,23 +880,12 @@ void TimeSaverOnActorInitHandler(void* actorRef) { return; } - bool shouldKeepOpen; - switch (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SleepingWaterfall"), 0)) { - case 1: - shouldKeepOpen = Flags_GetEventChkInf(EVENTCHKINF_OPENED_ZORAS_DOMAIN); - break; - case 2: - if (IS_RANDO && RAND_GET_OPTION(RSK_SLEEPING_WATERFALL) == RO_WATERFALL_OPEN) { - shouldKeepOpen = true; - } else { - shouldKeepOpen = CHECK_QUEST_ITEM(QUEST_SONG_LULLABY) && - (INV_CONTENT(ITEM_OCARINA_TIME) == ITEM_OCARINA_TIME || - INV_CONTENT(ITEM_OCARINA_FAIRY) == ITEM_OCARINA_FAIRY); - } - break; - default: - shouldKeepOpen = false; - break; + bool shouldKeepOpen = RAND_GET_OPTION(RSK_SLEEPING_WATERFALL) && IS_RANDO; + if (!shouldKeepOpen) { + bool enhancement = CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SleepingWaterfall"), 0); + shouldKeepOpen = (enhancement == 2 && ((CHECK_QUEST_ITEM(QUEST_SONG_LULLABY) && + (INV_CONTENT(ITEM_OCARINA_TIME) != ITEM_NONE)))) + || (enhancement == 1 && Flags_GetEventChkInf(EVENTCHKINF_OPENED_ZORAS_DOMAIN)); } if (!shouldKeepOpen) { From c7e3ef9e4dd86ea38a655eaecce850db8d7f8a03 Mon Sep 17 00:00:00 2001 From: Malkierian Date: Sun, 23 Mar 2025 21:52:07 -0700 Subject: [PATCH 02/12] Wrong type for CVarGetInt on waterfall open enhancement. (#5200) --- soh/soh/Enhancements/timesaver_hook_handlers.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soh/soh/Enhancements/timesaver_hook_handlers.cpp b/soh/soh/Enhancements/timesaver_hook_handlers.cpp index 78b43ae2a0a..8e4e74fb40e 100644 --- a/soh/soh/Enhancements/timesaver_hook_handlers.cpp +++ b/soh/soh/Enhancements/timesaver_hook_handlers.cpp @@ -882,7 +882,7 @@ void TimeSaverOnActorInitHandler(void* actorRef) { bool shouldKeepOpen = RAND_GET_OPTION(RSK_SLEEPING_WATERFALL) && IS_RANDO; if (!shouldKeepOpen) { - bool enhancement = CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SleepingWaterfall"), 0); + int enhancement = CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SleepingWaterfall"), 0); shouldKeepOpen = (enhancement == 2 && ((CHECK_QUEST_ITEM(QUEST_SONG_LULLABY) && (INV_CONTENT(ITEM_OCARINA_TIME) != ITEM_NONE)))) || (enhancement == 1 && Flags_GetEventChkInf(EVENTCHKINF_OPENED_ZORAS_DOMAIN)); From edd8561ddc3ffe155e6c63e37599274e977e70da Mon Sep 17 00:00:00 2001 From: briaguya <70942617+briaguya-ai@users.noreply.github.com> Date: Mon, 24 Mar 2025 03:46:22 -0400 Subject: [PATCH 03/12] assignable tunics/boots - dont throw items (#5045) * don't throw items when using assigned tunics/boots * didn't actually need that * simplify logic so we don't need to check for holding items * just use a vb should * fix comment --- .../Enhancements/AssignableTunicsAndBoots.cpp | 22 +++++++++++++++++++ .../vanilla-behavior/GIVanillaBehavior.h | 9 ++++++++ .../actors/ovl_player_actor/z_player.c | 6 +++-- 3 files changed, 35 insertions(+), 2 deletions(-) diff --git a/soh/soh/Enhancements/AssignableTunicsAndBoots.cpp b/soh/soh/Enhancements/AssignableTunicsAndBoots.cpp index 3a52312c9a3..3b4b1168614 100644 --- a/soh/soh/Enhancements/AssignableTunicsAndBoots.cpp +++ b/soh/soh/Enhancements/AssignableTunicsAndBoots.cpp @@ -87,6 +87,28 @@ void RegisterAssignableTunicsBoots() { } }); + // don't throw items when the pressed button is a tunic or boots + COND_VB_SHOULD(VB_THROW_OR_PUT_DOWN_HELD_ITEM, CVAR_TUNICBOOTS_VALUE != CVAR_TUNICBOOTS_DEFAULT, { + // if the vanilla condition doesn't want us to throw/put down the item, early return + if (!*should) { + return; + } + + Input* input = va_arg(args, Input*); + + s32 item = ITEM_NONE; + for (s32 i = 0; i < ARRAY_COUNT(sItemButtons); i++) { + if (CHECK_BTN_ALL(input->press.button, sItemButtons[i])) { + item = Player_GetItemOnButton(gPlayState, i); + break; + } + } + + if (item >= ITEM_TUNIC_KOKIRI && item <= ITEM_BOOTS_HOVER) { + *should = false; + } + }); + // do something when the player presses a button to use the tunics/boots COND_VB_SHOULD(VB_EXECUTE_PLAYER_ACTION_FUNC, CVAR_TUNICBOOTS_VALUE != CVAR_TUNICBOOTS_DEFAULT, { // if the vanilla condition doesn't want us to run the actionFunc, don't do any of this diff --git a/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h b/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h index d6154347c0b..5d25bd12da2 100644 --- a/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h +++ b/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h @@ -1794,6 +1794,15 @@ typedef enum { // - `*ShotSun` VB_SPAWN_SONG_FAIRY, + // #### `result` + // ```c + // (this->stateFlags1 & PLAYER_STATE1_CARRYING_ACTOR) && (this->heldActor != NULL) && + // CHECK_BTN_ANY(sControlInput->press.button, buttonsToCheck) + // ``` + // #### `args` + // - `*Input` + VB_THROW_OR_PUT_DOWN_HELD_ITEM, + // #### `result` // ```c // true diff --git a/soh/src/overlays/actors/ovl_player_actor/z_player.c b/soh/src/overlays/actors/ovl_player_actor/z_player.c index 1d9c892120d..8acdee4a4c2 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -7436,8 +7436,10 @@ s32 Player_ActionHandler_9(Player* this, PlayState* play) { if (CVarGetInteger(CVAR_ENHANCEMENT("DpadEquips"), 0) != 0) { buttonsToCheck |= BTN_DUP | BTN_DDOWN | BTN_DLEFT | BTN_DRIGHT; } - if ((this->stateFlags1 & PLAYER_STATE1_CARRYING_ACTOR) && (this->heldActor != NULL) && - CHECK_BTN_ANY(sControlInput->press.button, buttonsToCheck)) { + if (GameInteractor_Should(VB_THROW_OR_PUT_DOWN_HELD_ITEM, ( + (this->stateFlags1 & PLAYER_STATE1_CARRYING_ACTOR) && (this->heldActor != NULL) && + CHECK_BTN_ANY(sControlInput->press.button, buttonsToCheck) + ), sControlInput)) { if (!func_80835644(play, this, this->heldActor)) { if (!func_8083EAF0(this, this->heldActor)) { Player_SetupAction(play, this, Player_Action_808464B0, 1); From 1053b0e0cf7f86b5d9d0fdc7e424a3ea9cb0cc59 Mon Sep 17 00:00:00 2001 From: Sirius902 <10891979+Sirius902@users.noreply.github.com> Date: Mon, 24 Mar 2025 00:56:08 -0700 Subject: [PATCH 04/12] Prefix icon paths with CMAKE_SOURCE_DIR (#5197) --- CMakeLists.txt | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7aa873c626d..19703c989e1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -231,7 +231,7 @@ if(CMAKE_SYSTEM_NAME MATCHES "Linux") find_package(ImageMagick COMPONENTS convert) if (ImageMagick_FOUND) execute_process ( - COMMAND ${ImageMagick_convert_EXECUTABLE} soh/macosx/sohIcon.png -resize 512x512 ${CMAKE_BINARY_DIR}/sohIcon.png + COMMAND ${ImageMagick_convert_EXECUTABLE} ${CMAKE_SOURCE_DIR}/soh/macosx/sohIcon.png -resize 512x512 ${CMAKE_BINARY_DIR}/sohIcon.png OUTPUT_VARIABLE outVar ) endif() @@ -240,16 +240,16 @@ endif() if(CMAKE_SYSTEM_NAME MATCHES "Darwin") add_custom_target(CreateOSXIcons COMMAND mkdir -p ${CMAKE_BINARY_DIR}/macosx/soh.iconset - COMMAND sips -z 16 16 soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_16x16.png - COMMAND sips -z 32 32 soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_16x16@2x.png - COMMAND sips -z 32 32 soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_32x32.png - COMMAND sips -z 64 64 soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_32x32@2x.png - COMMAND sips -z 128 128 soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_128x128.png - COMMAND sips -z 256 256 soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_128x128@2x.png - COMMAND sips -z 256 256 soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_256x256.png - COMMAND sips -z 512 512 soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_256x256@2x.png - COMMAND sips -z 512 512 soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_512x512.png - COMMAND cp soh/macosx/sohIcon.png ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_512x512@2x.png + COMMAND sips -z 16 16 ${CMAKE_SOURCE_DIR}/soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_16x16.png + COMMAND sips -z 32 32 ${CMAKE_SOURCE_DIR}/soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_16x16@2x.png + COMMAND sips -z 32 32 ${CMAKE_SOURCE_DIR}/soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_32x32.png + COMMAND sips -z 64 64 ${CMAKE_SOURCE_DIR}/soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_32x32@2x.png + COMMAND sips -z 128 128 ${CMAKE_SOURCE_DIR}/soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_128x128.png + COMMAND sips -z 256 256 ${CMAKE_SOURCE_DIR}/soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_128x128@2x.png + COMMAND sips -z 256 256 ${CMAKE_SOURCE_DIR}/soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_256x256.png + COMMAND sips -z 512 512 ${CMAKE_SOURCE_DIR}/soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_256x256@2x.png + COMMAND sips -z 512 512 ${CMAKE_SOURCE_DIR}/soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_512x512.png + COMMAND cp ${CMAKE_SOURCE_DIR}/soh/macosx/sohIcon.png ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_512x512@2x.png COMMAND iconutil -c icns -o ${CMAKE_BINARY_DIR}/macosx/soh.icns ${CMAKE_BINARY_DIR}/macosx/soh.iconset WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMENT "Creating OSX icons ..." From 9ae9dc49770d34acabd139bbf9e7a39249f9424b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20Dub=C3=A9?= Date: Mon, 24 Mar 2025 08:11:45 +0000 Subject: [PATCH 05/12] Fix SFM wolfos logic (#5192) * Fix SFM logic SFM mixed child wolfos / adult moblin logic, making both incorrect In particular, Din's Fire is ineffective on Moblins, & slashing your way through them should not be in logic Adds trick for getting through SFM as adult without killing moblins Includes small cleanup elsewhere in logic * moblins not required --- .../randomizer/location_access/dungeons/deku_tree.cpp | 2 +- .../randomizer/location_access/overworld/castle_grounds.cpp | 2 +- .../location_access/overworld/sacred_forest_meadow.cpp | 2 +- .../overworld/{zora_river.cpp => zoras_river.cpp} | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) rename soh/soh/Enhancements/randomizer/location_access/overworld/{zora_river.cpp => zoras_river.cpp} (98%) diff --git a/soh/soh/Enhancements/randomizer/location_access/dungeons/deku_tree.cpp b/soh/soh/Enhancements/randomizer/location_access/dungeons/deku_tree.cpp index 4740a754160..df47f0f42fc 100644 --- a/soh/soh/Enhancements/randomizer/location_access/dungeons/deku_tree.cpp +++ b/soh/soh/Enhancements/randomizer/location_access/dungeons/deku_tree.cpp @@ -216,7 +216,7 @@ void RegionTable_Init_DekuTree() { LOCATION(RC_DEKU_TREE_MQ_COMPASS_CHEST, true), }, { //Exits - Entrance(RR_DEKU_TREE_MQ_EYE_TARGET_ROOM, []{return true;}), + Entrance(RR_DEKU_TREE_MQ_EYE_TARGET_ROOM, []{return logic->CanUse(RG_FAIRY_SLINGSHOT) || logic->CanUse(RG_HOVER_BOOTS);}), Entrance(RR_DEKU_TREE_MQ_PAST_BOULDER_VINES, []{return Here(RR_DEKU_TREE_MQ_COMPASS_ROOM, []{return logic->CanUse(RG_BOMBCHU_5) || (logic->CanUse(RG_BOMB_BAG) && (logic->CanUse(RG_SONG_OF_TIME) || logic->IsAdult || logic->CanUse(RG_HOVER_BOOTS))) || (logic->CanUse(RG_MEGATON_HAMMER) && (logic->CanUse(RG_SONG_OF_TIME) || ctx->GetTrickOption(RT_DEKU_MQ_COMPASS_GS)));});}), }); diff --git a/soh/soh/Enhancements/randomizer/location_access/overworld/castle_grounds.cpp b/soh/soh/Enhancements/randomizer/location_access/overworld/castle_grounds.cpp index b4b77056b4e..60aa8432fed 100644 --- a/soh/soh/Enhancements/randomizer/location_access/overworld/castle_grounds.cpp +++ b/soh/soh/Enhancements/randomizer/location_access/overworld/castle_grounds.cpp @@ -21,7 +21,7 @@ void RegionTable_Init_CastleGrounds() { }, { //Locations LOCATION(RC_HC_MALON_EGG, true), - LOCATION(RC_HC_GS_TREE, logic->IsChild && logic->CanAttack()), + LOCATION(RC_HC_GS_TREE, logic->IsChild && logic->CanKillEnemy(RE_GOLD_SKULLTULA, ED_CLOSE)), LOCATION(RC_HC_MALON_GOSSIP_STONE_FAIRY, logic->CallGossipFairy()), LOCATION(RC_HC_MALON_GOSSIP_STONE_FAIRY_BIG, logic->CanUse(RG_SONG_OF_STORMS)), LOCATION(RC_HC_ROCK_WALL_GOSSIP_STONE_FAIRY, logic->CallGossipFairy()), diff --git a/soh/soh/Enhancements/randomizer/location_access/overworld/sacred_forest_meadow.cpp b/soh/soh/Enhancements/randomizer/location_access/overworld/sacred_forest_meadow.cpp index ecc0577e29f..e09e9559b27 100644 --- a/soh/soh/Enhancements/randomizer/location_access/overworld/sacred_forest_meadow.cpp +++ b/soh/soh/Enhancements/randomizer/location_access/overworld/sacred_forest_meadow.cpp @@ -7,7 +7,7 @@ void RegionTable_Init_SacredForestMeadow() { areaTable[RR_SFM_ENTRYWAY] = Region("SFM Entryway", "Sacred Forest Meadow", {RA_SACRED_FOREST_MEADOW}, NO_DAY_NIGHT_CYCLE, {}, {}, { //Exits Entrance(RR_LW_BEYOND_MIDO, []{return true;}), - Entrance(RR_SACRED_FOREST_MEADOW, []{return logic->CanJumpslash() || logic->CanUse(RG_FAIRY_SLINGSHOT) || logic->CanUse(RG_FAIRY_BOW) || logic->CanUse(RG_DINS_FIRE);}), + Entrance(RR_SACRED_FOREST_MEADOW, []{return logic->IsAdult || logic->CanKillEnemy(RE_WOLFOS);}), Entrance(RR_SFM_WOLFOS_GROTTO, []{return logic->CanOpenBombGrotto();}), }); diff --git a/soh/soh/Enhancements/randomizer/location_access/overworld/zora_river.cpp b/soh/soh/Enhancements/randomizer/location_access/overworld/zoras_river.cpp similarity index 98% rename from soh/soh/Enhancements/randomizer/location_access/overworld/zora_river.cpp rename to soh/soh/Enhancements/randomizer/location_access/overworld/zoras_river.cpp index 16ac1b2710f..f12de9128ce 100644 --- a/soh/soh/Enhancements/randomizer/location_access/overworld/zora_river.cpp +++ b/soh/soh/Enhancements/randomizer/location_access/overworld/zoras_river.cpp @@ -6,7 +6,7 @@ using namespace Rando; void RegionTable_Init_ZoraRiver() { areaTable[RR_ZR_FRONT] = Region("ZR Front", "Zora River", {RA_ZORAS_RIVER}, DAY_NIGHT_CYCLE, {}, { //Locations - LOCATION(RC_ZR_GS_TREE, logic->IsChild && logic->CanAttack()), + LOCATION(RC_ZR_GS_TREE, logic->IsChild && logic->CanKillEnemy(RE_GOLD_SKULLTULA, ED_CLOSE)), }, { //Exits Entrance(RR_ZORAS_RIVER, []{return logic->IsAdult || logic->BlastOrSmash();}), From 26aa36fe7bf24b57affb8b4fbb26e3ea4f899a70 Mon Sep 17 00:00:00 2001 From: briaguya <70942617+briaguya-ai@users.noreply.github.com> Date: Mon, 24 Mar 2025 04:34:07 -0400 Subject: [PATCH 06/12] bump lus (#5187) * pushing what i have so i can try to figure out HW_REG errors * HW_REG (fix? workaround? either way it builds now) * factory fixes and shaders * bump again * bump again * copy shaders for `ExtractAssets` too (instead of just in `GenerateSohOtr`) --- CMakeLists.txt | 10 ++++++++++ libultraship | 2 +- soh/assets/.gitignore | 1 + soh/include/macros.h | 4 ++++ soh/soh/OTRGlobals.cpp | 2 +- soh/soh/resource/importer/AnimationFactory.cpp | 6 +++--- soh/soh/resource/importer/AnimationFactory.h | 2 +- soh/soh/resource/importer/ArrayFactory.cpp | 6 +++--- soh/soh/resource/importer/ArrayFactory.h | 2 +- soh/soh/resource/importer/AudioSampleFactory.cpp | 6 +++--- soh/soh/resource/importer/AudioSampleFactory.h | 2 +- soh/soh/resource/importer/AudioSequenceFactory.cpp | 6 +++--- soh/soh/resource/importer/AudioSequenceFactory.h | 2 +- soh/soh/resource/importer/AudioSoundFontFactory.cpp | 6 +++--- soh/soh/resource/importer/AudioSoundFontFactory.h | 2 +- soh/soh/resource/importer/BackgroundFactory.cpp | 6 +++--- soh/soh/resource/importer/BackgroundFactory.h | 2 +- soh/soh/resource/importer/CollisionHeaderFactory.cpp | 12 ++++++------ soh/soh/resource/importer/CollisionHeaderFactory.h | 4 ++-- soh/soh/resource/importer/CutsceneFactory.cpp | 6 +++--- soh/soh/resource/importer/CutsceneFactory.h | 2 +- soh/soh/resource/importer/PathFactory.cpp | 12 ++++++------ soh/soh/resource/importer/PathFactory.h | 4 ++-- soh/soh/resource/importer/PlayerAnimationFactory.cpp | 6 +++--- soh/soh/resource/importer/PlayerAnimationFactory.h | 2 +- soh/soh/resource/importer/SceneFactory.cpp | 12 ++++++------ soh/soh/resource/importer/SceneFactory.h | 4 ++-- soh/soh/resource/importer/SkeletonFactory.cpp | 12 ++++++------ soh/soh/resource/importer/SkeletonFactory.h | 4 ++-- soh/soh/resource/importer/SkeletonLimbFactory.cpp | 12 ++++++------ soh/soh/resource/importer/SkeletonLimbFactory.h | 4 ++-- soh/soh/resource/importer/TextFactory.cpp | 12 ++++++------ soh/soh/resource/importer/TextFactory.h | 4 ++-- 33 files changed, 97 insertions(+), 82 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 19703c989e1..2771ee8c97a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -199,6 +199,11 @@ find_package(Python3 COMPONENTS Interpreter) add_custom_target( ExtractAssets COMMAND ${CMAKE_COMMAND} -E rm -f oot.otr oot-mq.otr soh.otr + + # copy LUS default shaders into assets/custom + COMMAND ${CMAKE_COMMAND} -E rm -r -f ${CMAKE_CURRENT_SOURCE_DIR}/soh/assets/custom/shaders/ + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/libultraship/src/graphic/Fast3D/shaders/ ${CMAKE_CURRENT_SOURCE_DIR}/soh/assets/custom/shaders/ + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/OTRExporter/extract_assets.py -z "$" --non-interactive --xml-root ../soh/assets/xml --custom-otr-file soh.otr "--custom-assets-path" ${CMAKE_CURRENT_SOURCE_DIR}/soh/assets/custom --port-ver "${CMAKE_PROJECT_VERSION}" COMMAND ${CMAKE_COMMAND} -DSYSTEM_NAME=${CMAKE_SYSTEM_NAME} -DTARGET_DIR="$" -DSOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR} -DBINARY_DIR=${CMAKE_BINARY_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/copy-existing-otrs.cmake WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/OTRExporter @@ -220,6 +225,11 @@ add_custom_target( add_custom_target( GenerateSohOtr COMMAND ${CMAKE_COMMAND} -E rm -f soh.otr + + # copy LUS default shaders into assets/custom + COMMAND ${CMAKE_COMMAND} -E rm -r -f ${CMAKE_CURRENT_SOURCE_DIR}/soh/assets/custom/shaders/ + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/libultraship/src/graphic/Fast3D/shaders/ ${CMAKE_CURRENT_SOURCE_DIR}/soh/assets/custom/shaders/ + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/OTRExporter/extract_assets.py -z "$" --norom --custom-otr-file soh.otr "--custom-assets-path" ${CMAKE_CURRENT_SOURCE_DIR}/soh/assets/custom --port-ver "${CMAKE_PROJECT_VERSION}" COMMAND ${CMAKE_COMMAND} -DSYSTEM_NAME=${CMAKE_SYSTEM_NAME} -DTARGET_DIR="$" -DSOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR} -DBINARY_DIR=${CMAKE_BINARY_DIR} -DONLYSOHOTR=On -P ${CMAKE_CURRENT_SOURCE_DIR}/copy-existing-otrs.cmake WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/OTRExporter diff --git a/libultraship b/libultraship index 02bb77ef253..455b6dadef9 160000 --- a/libultraship +++ b/libultraship @@ -1 +1 @@ -Subproject commit 02bb77ef253e2de0969fd2cb36ad2e870677d18d +Subproject commit 455b6dadef901d586332d6015fd2fd01ff07b54c diff --git a/soh/assets/.gitignore b/soh/assets/.gitignore index d75078bf1c3..7a844a72731 100644 --- a/soh/assets/.gitignore +++ b/soh/assets/.gitignore @@ -5,3 +5,4 @@ *.vtx.inc *.dlist.inc !*.png +custom/shaders diff --git a/soh/include/macros.h b/soh/include/macros.h index 302e3755de5..325fb91b6ac 100644 --- a/soh/include/macros.h +++ b/soh/include/macros.h @@ -8,6 +8,10 @@ // #define __attribute__(x) // #endif +// this was removed from the LUS rcp.h in https://github.com/Kenix3/libultraship/pull/833/ +// it is still used in graph.c and fault.c +#define HW_REG(reg, type) *(volatile type*)((reg) | 0xA0000000) + // SoH [Port] Always use the AVOID_UB version (we don't set AVOID_UB while building yet) /* #ifndef AVOID_UB diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp index 3809a2ac60c..5cdf06d9eac 100644 --- a/soh/soh/OTRGlobals.cpp +++ b/soh/soh/OTRGlobals.cpp @@ -909,7 +909,7 @@ OTRVersion ReadPortVersionFromOTR(std::string otrPath) { // Use a temporary archive instance to load the otr and read the version file auto archive = std::make_shared(otrPath); if (archive->Open()) { - auto t = archive->LoadFile("portVersion", std::make_shared()); + auto t = archive->LoadFile("portVersion"); if (t != nullptr && t->IsLoaded) { auto stream = std::make_shared(t->Buffer->data(), t->Buffer->size()); auto reader = std::make_shared(stream); diff --git a/soh/soh/resource/importer/AnimationFactory.cpp b/soh/soh/resource/importer/AnimationFactory.cpp index 13aa71c86aa..45b582035d5 100644 --- a/soh/soh/resource/importer/AnimationFactory.cpp +++ b/soh/soh/resource/importer/AnimationFactory.cpp @@ -3,12 +3,12 @@ #include "spdlog/spdlog.h" namespace SOH { -std::shared_ptr ResourceFactoryBinaryAnimationV0::ReadResource(std::shared_ptr file) { - if (!FileHasValidFormatAndReader(file)) { +std::shared_ptr ResourceFactoryBinaryAnimationV0::ReadResource(std::shared_ptr file, std::shared_ptr initData) { + if (!FileHasValidFormatAndReader(file, initData)) { return nullptr; } - auto animation = std::make_shared(file->InitData); + auto animation = std::make_shared(initData); auto reader = std::get>(file->Reader); AnimationType animType = (AnimationType)reader->ReadUInt32(); diff --git a/soh/soh/resource/importer/AnimationFactory.h b/soh/soh/resource/importer/AnimationFactory.h index ae27832b6a2..b7737460265 100644 --- a/soh/soh/resource/importer/AnimationFactory.h +++ b/soh/soh/resource/importer/AnimationFactory.h @@ -6,6 +6,6 @@ namespace SOH { class ResourceFactoryBinaryAnimationV0 : public Ship::ResourceFactoryBinary { public: - std::shared_ptr ReadResource(std::shared_ptr file) override; + std::shared_ptr ReadResource(std::shared_ptr file, std::shared_ptr initData) override; }; } // namespace SOH diff --git a/soh/soh/resource/importer/ArrayFactory.cpp b/soh/soh/resource/importer/ArrayFactory.cpp index 39be7c09377..50e208a48b6 100644 --- a/soh/soh/resource/importer/ArrayFactory.cpp +++ b/soh/soh/resource/importer/ArrayFactory.cpp @@ -4,12 +4,12 @@ #include "graphic/Fast3D/lus_gbi.h" namespace SOH { -std::shared_ptr ResourceFactoryBinaryArrayV0::ReadResource(std::shared_ptr file) { - if (!FileHasValidFormatAndReader(file)) { +std::shared_ptr ResourceFactoryBinaryArrayV0::ReadResource(std::shared_ptr file, std::shared_ptr initData) { + if (!FileHasValidFormatAndReader(file, initData)) { return nullptr; } - auto array = std::make_shared(file->InitData); + auto array = std::make_shared(initData); auto reader = std::get>(file->Reader); array->ArrayType = (ArrayResourceType)reader->ReadUInt32(); diff --git a/soh/soh/resource/importer/ArrayFactory.h b/soh/soh/resource/importer/ArrayFactory.h index b9f5ca75b67..4497591c4c6 100644 --- a/soh/soh/resource/importer/ArrayFactory.h +++ b/soh/soh/resource/importer/ArrayFactory.h @@ -6,6 +6,6 @@ namespace SOH { class ResourceFactoryBinaryArrayV0 : public Ship::ResourceFactoryBinary { public: - std::shared_ptr ReadResource(std::shared_ptr file) override; + std::shared_ptr ReadResource(std::shared_ptr file, std::shared_ptr initData) override; }; } // namespace LUS diff --git a/soh/soh/resource/importer/AudioSampleFactory.cpp b/soh/soh/resource/importer/AudioSampleFactory.cpp index 0ec3f526018..8ef0b9657e0 100644 --- a/soh/soh/resource/importer/AudioSampleFactory.cpp +++ b/soh/soh/resource/importer/AudioSampleFactory.cpp @@ -3,12 +3,12 @@ #include "spdlog/spdlog.h" namespace SOH { -std::shared_ptr ResourceFactoryBinaryAudioSampleV2::ReadResource(std::shared_ptr file) { - if (!FileHasValidFormatAndReader(file)) { +std::shared_ptr ResourceFactoryBinaryAudioSampleV2::ReadResource(std::shared_ptr file, std::shared_ptr initData) { + if (!FileHasValidFormatAndReader(file, initData)) { return nullptr; } - auto audioSample = std::make_shared(file->InitData); + auto audioSample = std::make_shared(initData); auto reader = std::get>(file->Reader); audioSample->sample.codec = reader->ReadUByte(); diff --git a/soh/soh/resource/importer/AudioSampleFactory.h b/soh/soh/resource/importer/AudioSampleFactory.h index 372e8a31041..5a1a9da3ae7 100644 --- a/soh/soh/resource/importer/AudioSampleFactory.h +++ b/soh/soh/resource/importer/AudioSampleFactory.h @@ -6,6 +6,6 @@ namespace SOH { class ResourceFactoryBinaryAudioSampleV2 : public Ship::ResourceFactoryBinary { public: - std::shared_ptr ReadResource(std::shared_ptr file) override; + std::shared_ptr ReadResource(std::shared_ptr file, std::shared_ptr initData) override; }; } // namespace SOH diff --git a/soh/soh/resource/importer/AudioSequenceFactory.cpp b/soh/soh/resource/importer/AudioSequenceFactory.cpp index 35da7f798db..a10ae7eeec3 100644 --- a/soh/soh/resource/importer/AudioSequenceFactory.cpp +++ b/soh/soh/resource/importer/AudioSequenceFactory.cpp @@ -3,12 +3,12 @@ #include "spdlog/spdlog.h" namespace SOH { -std::shared_ptr ResourceFactoryBinaryAudioSequenceV2::ReadResource(std::shared_ptr file) { - if (!FileHasValidFormatAndReader(file)) { +std::shared_ptr ResourceFactoryBinaryAudioSequenceV2::ReadResource(std::shared_ptr file, std::shared_ptr initData) { + if (!FileHasValidFormatAndReader(file, initData)) { return nullptr; } - auto audioSequence = std::make_shared(file->InitData); + auto audioSequence = std::make_shared(initData); auto reader = std::get>(file->Reader); audioSequence->sequence.seqDataSize = reader->ReadInt32(); diff --git a/soh/soh/resource/importer/AudioSequenceFactory.h b/soh/soh/resource/importer/AudioSequenceFactory.h index 35fd1ebef54..71b1f713d44 100644 --- a/soh/soh/resource/importer/AudioSequenceFactory.h +++ b/soh/soh/resource/importer/AudioSequenceFactory.h @@ -6,6 +6,6 @@ namespace SOH { class ResourceFactoryBinaryAudioSequenceV2 : public Ship::ResourceFactoryBinary { public: - std::shared_ptr ReadResource(std::shared_ptr file) override; + std::shared_ptr ReadResource(std::shared_ptr file, std::shared_ptr initData) override; }; } // namespace SOH diff --git a/soh/soh/resource/importer/AudioSoundFontFactory.cpp b/soh/soh/resource/importer/AudioSoundFontFactory.cpp index 534a7914c85..e5c63757460 100644 --- a/soh/soh/resource/importer/AudioSoundFontFactory.cpp +++ b/soh/soh/resource/importer/AudioSoundFontFactory.cpp @@ -4,12 +4,12 @@ #include "libultraship/libultraship.h" namespace SOH { -std::shared_ptr ResourceFactoryBinaryAudioSoundFontV2::ReadResource(std::shared_ptr file) { - if (!FileHasValidFormatAndReader(file)) { +std::shared_ptr ResourceFactoryBinaryAudioSoundFontV2::ReadResource(std::shared_ptr file, std::shared_ptr initData) { + if (!FileHasValidFormatAndReader(file, initData)) { return nullptr; } - auto audioSoundFont = std::make_shared(file->InitData); + auto audioSoundFont = std::make_shared(initData); auto reader = std::get>(file->Reader); audioSoundFont->soundFont.fntIndex = reader->ReadInt32(); diff --git a/soh/soh/resource/importer/AudioSoundFontFactory.h b/soh/soh/resource/importer/AudioSoundFontFactory.h index a80b8fe9726..5db75aa660e 100644 --- a/soh/soh/resource/importer/AudioSoundFontFactory.h +++ b/soh/soh/resource/importer/AudioSoundFontFactory.h @@ -6,6 +6,6 @@ namespace SOH { class ResourceFactoryBinaryAudioSoundFontV2 : public Ship::ResourceFactoryBinary { public: - std::shared_ptr ReadResource(std::shared_ptr file) override; + std::shared_ptr ReadResource(std::shared_ptr file, std::shared_ptr initData) override; }; } // namespace SOH diff --git a/soh/soh/resource/importer/BackgroundFactory.cpp b/soh/soh/resource/importer/BackgroundFactory.cpp index 6be48469827..e8902827f3d 100644 --- a/soh/soh/resource/importer/BackgroundFactory.cpp +++ b/soh/soh/resource/importer/BackgroundFactory.cpp @@ -3,12 +3,12 @@ #include "spdlog/spdlog.h" namespace SOH { -std::shared_ptr ResourceFactoryBinaryBackgroundV0::ReadResource(std::shared_ptr file) { - if (!FileHasValidFormatAndReader(file)) { +std::shared_ptr ResourceFactoryBinaryBackgroundV0::ReadResource(std::shared_ptr file, std::shared_ptr initData) { + if (!FileHasValidFormatAndReader(file, initData)) { return nullptr; } - auto background = std::make_shared(file->InitData); + auto background = std::make_shared(initData); auto reader = std::get>(file->Reader); uint32_t dataSize = reader->ReadUInt32(); diff --git a/soh/soh/resource/importer/BackgroundFactory.h b/soh/soh/resource/importer/BackgroundFactory.h index e74e897e9de..587f750a158 100644 --- a/soh/soh/resource/importer/BackgroundFactory.h +++ b/soh/soh/resource/importer/BackgroundFactory.h @@ -6,6 +6,6 @@ namespace SOH { class ResourceFactoryBinaryBackgroundV0 : public Ship::ResourceFactoryBinary { public: - std::shared_ptr ReadResource(std::shared_ptr file) override; + std::shared_ptr ReadResource(std::shared_ptr file, std::shared_ptr initData) override; }; } // namespace SOH diff --git a/soh/soh/resource/importer/CollisionHeaderFactory.cpp b/soh/soh/resource/importer/CollisionHeaderFactory.cpp index 4636d80c768..0c615fa875f 100644 --- a/soh/soh/resource/importer/CollisionHeaderFactory.cpp +++ b/soh/soh/resource/importer/CollisionHeaderFactory.cpp @@ -3,12 +3,12 @@ #include "spdlog/spdlog.h" namespace SOH { -std::shared_ptr ResourceFactoryBinaryCollisionHeaderV0::ReadResource(std::shared_ptr file) { - if (!FileHasValidFormatAndReader(file)) { +std::shared_ptr ResourceFactoryBinaryCollisionHeaderV0::ReadResource(std::shared_ptr file, std::shared_ptr initData) { + if (!FileHasValidFormatAndReader(file, initData)) { return nullptr; } - auto collisionHeader = std::make_shared(file->InitData); + auto collisionHeader = std::make_shared(initData); auto reader = std::get>(file->Reader); collisionHeader->collisionHeaderData.minBounds.x = reader->ReadInt16(); @@ -123,12 +123,12 @@ std::shared_ptr ResourceFactoryBinaryCollisionHeaderV0::ReadRes return collisionHeader; } -std::shared_ptr ResourceFactoryXMLCollisionHeaderV0::ReadResource(std::shared_ptr file) { - if (!FileHasValidFormatAndReader(file)) { +std::shared_ptr ResourceFactoryXMLCollisionHeaderV0::ReadResource(std::shared_ptr file, std::shared_ptr initData) { + if (!FileHasValidFormatAndReader(file, initData)) { return nullptr; } - auto collisionHeader = std::make_shared(file->InitData); + auto collisionHeader = std::make_shared(initData); auto reader = std::get>(file->Reader)->FirstChildElement(); auto child = reader->FirstChildElement(); diff --git a/soh/soh/resource/importer/CollisionHeaderFactory.h b/soh/soh/resource/importer/CollisionHeaderFactory.h index dd438f9c35a..66702f33dcb 100644 --- a/soh/soh/resource/importer/CollisionHeaderFactory.h +++ b/soh/soh/resource/importer/CollisionHeaderFactory.h @@ -7,11 +7,11 @@ namespace SOH { class ResourceFactoryBinaryCollisionHeaderV0 : public Ship::ResourceFactoryBinary { public: - std::shared_ptr ReadResource(std::shared_ptr file) override; + std::shared_ptr ReadResource(std::shared_ptr file, std::shared_ptr initData) override; }; class ResourceFactoryXMLCollisionHeaderV0 : public Ship::ResourceFactoryXML { public: - std::shared_ptr ReadResource(std::shared_ptr file) override; + std::shared_ptr ReadResource(std::shared_ptr file, std::shared_ptr initData) override; }; } // namespace SOH diff --git a/soh/soh/resource/importer/CutsceneFactory.cpp b/soh/soh/resource/importer/CutsceneFactory.cpp index 49e44680ce4..63a5695e91f 100644 --- a/soh/soh/resource/importer/CutsceneFactory.cpp +++ b/soh/soh/resource/importer/CutsceneFactory.cpp @@ -58,12 +58,12 @@ static inline uint32_t read_CMD_HH(std::shared_ptr reader) { } namespace SOH { -std::shared_ptr ResourceFactoryBinaryCutsceneV0::ReadResource(std::shared_ptr file) { - if (!FileHasValidFormatAndReader(file)) { +std::shared_ptr ResourceFactoryBinaryCutsceneV0::ReadResource(std::shared_ptr file, std::shared_ptr initData) { + if (!FileHasValidFormatAndReader(file, initData)) { return nullptr; } - auto cutscene = std::make_shared(file->InitData); + auto cutscene = std::make_shared(initData); auto reader = std::get>(file->Reader); uint32_t numEntries = reader->ReadUInt32(); diff --git a/soh/soh/resource/importer/CutsceneFactory.h b/soh/soh/resource/importer/CutsceneFactory.h index 8afe98bb8a9..9eb5e1415b3 100644 --- a/soh/soh/resource/importer/CutsceneFactory.h +++ b/soh/soh/resource/importer/CutsceneFactory.h @@ -6,6 +6,6 @@ namespace SOH { class ResourceFactoryBinaryCutsceneV0 : public Ship::ResourceFactoryBinary { public: - std::shared_ptr ReadResource(std::shared_ptr file) override; + std::shared_ptr ReadResource(std::shared_ptr file, std::shared_ptr initData) override; }; } // namespace SOH diff --git a/soh/soh/resource/importer/PathFactory.cpp b/soh/soh/resource/importer/PathFactory.cpp index f0f92be0221..19c374c6422 100644 --- a/soh/soh/resource/importer/PathFactory.cpp +++ b/soh/soh/resource/importer/PathFactory.cpp @@ -4,12 +4,12 @@ #include "spdlog/spdlog.h" namespace SOH { -std::shared_ptr ResourceFactoryBinaryPathV0::ReadResource(std::shared_ptr file) { - if (!FileHasValidFormatAndReader(file)) { +std::shared_ptr ResourceFactoryBinaryPathV0::ReadResource(std::shared_ptr file, std::shared_ptr initData) { + if (!FileHasValidFormatAndReader(file, initData)) { return nullptr; } - auto path = std::make_shared(file->InitData); + auto path = std::make_shared(initData); auto reader = std::get>(file->Reader); path->numPaths = reader->ReadUInt32(); @@ -43,12 +43,12 @@ std::shared_ptr ResourceFactoryBinaryPathV0::ReadResource(std:: return path; } -std::shared_ptr ResourceFactoryXMLPathV0::ReadResource(std::shared_ptr file) { - if (!FileHasValidFormatAndReader(file)) { +std::shared_ptr ResourceFactoryXMLPathV0::ReadResource(std::shared_ptr file, std::shared_ptr initData) { + if (!FileHasValidFormatAndReader(file, initData)) { return nullptr; } - auto path = std::make_shared(file->InitData); + auto path = std::make_shared(initData); auto reader = std::get>(file->Reader); auto pathElement = reader->RootElement(); diff --git a/soh/soh/resource/importer/PathFactory.h b/soh/soh/resource/importer/PathFactory.h index 9dd73b11025..2cba7d219e3 100644 --- a/soh/soh/resource/importer/PathFactory.h +++ b/soh/soh/resource/importer/PathFactory.h @@ -7,11 +7,11 @@ namespace SOH { class ResourceFactoryBinaryPathV0 : public Ship::ResourceFactoryBinary { public: - std::shared_ptr ReadResource(std::shared_ptr file) override; + std::shared_ptr ReadResource(std::shared_ptr file, std::shared_ptr initData) override; }; class ResourceFactoryXMLPathV0 : public Ship::ResourceFactoryXML { public: - std::shared_ptr ReadResource(std::shared_ptr file) override; + std::shared_ptr ReadResource(std::shared_ptr file, std::shared_ptr initData) override; }; } // namespace SOH diff --git a/soh/soh/resource/importer/PlayerAnimationFactory.cpp b/soh/soh/resource/importer/PlayerAnimationFactory.cpp index 59610da46fa..76857b3513d 100644 --- a/soh/soh/resource/importer/PlayerAnimationFactory.cpp +++ b/soh/soh/resource/importer/PlayerAnimationFactory.cpp @@ -3,12 +3,12 @@ #include "spdlog/spdlog.h" namespace SOH { -std::shared_ptr ResourceFactoryBinaryPlayerAnimationV0::ReadResource(std::shared_ptr file) { - if (!FileHasValidFormatAndReader(file)) { +std::shared_ptr ResourceFactoryBinaryPlayerAnimationV0::ReadResource(std::shared_ptr file, std::shared_ptr initData) { + if (!FileHasValidFormatAndReader(file, initData)) { return nullptr; } - auto playerAnimation = std::make_shared(file->InitData); + auto playerAnimation = std::make_shared(initData); auto reader = std::get>(file->Reader); uint32_t numEntries = reader->ReadUInt32(); diff --git a/soh/soh/resource/importer/PlayerAnimationFactory.h b/soh/soh/resource/importer/PlayerAnimationFactory.h index 3ee8b1d3a28..d7efb503526 100644 --- a/soh/soh/resource/importer/PlayerAnimationFactory.h +++ b/soh/soh/resource/importer/PlayerAnimationFactory.h @@ -6,6 +6,6 @@ namespace SOH { class ResourceFactoryBinaryPlayerAnimationV0 : public Ship::ResourceFactoryBinary { public: - std::shared_ptr ReadResource(std::shared_ptr file) override; + std::shared_ptr ReadResource(std::shared_ptr file, std::shared_ptr initData) override; }; } // namespace SOH diff --git a/soh/soh/resource/importer/SceneFactory.cpp b/soh/soh/resource/importer/SceneFactory.cpp index 1bcf92e1c97..b8cecf5b565 100644 --- a/soh/soh/resource/importer/SceneFactory.cpp +++ b/soh/soh/resource/importer/SceneFactory.cpp @@ -93,12 +93,12 @@ std::shared_ptr ResourceFactoryBinarySceneV0::ParseSceneCommand(s return result; } -std::shared_ptr ResourceFactoryBinarySceneV0::ReadResource(std::shared_ptr file) { - if (!FileHasValidFormatAndReader(file)) { +std::shared_ptr ResourceFactoryBinarySceneV0::ReadResource(std::shared_ptr file, std::shared_ptr initData) { + if (!FileHasValidFormatAndReader(file, initData)) { return nullptr; } - auto scene = std::make_shared(file->InitData); + auto scene = std::make_shared(initData); auto reader = std::get>(file->Reader); ParseSceneCommands(scene, reader); @@ -216,12 +216,12 @@ std::shared_ptr ResourceFactoryXMLSceneV0::ParseSceneCommand(std: return result; } -std::shared_ptr ResourceFactoryXMLSceneV0::ReadResource(std::shared_ptr file) { - if (!FileHasValidFormatAndReader(file)) { +std::shared_ptr ResourceFactoryXMLSceneV0::ReadResource(std::shared_ptr file, std::shared_ptr initData) { + if (!FileHasValidFormatAndReader(file, initData)) { return nullptr; } - auto scene = std::make_shared(file->InitData); + auto scene = std::make_shared(initData); auto reader = std::get>(file->Reader); ParseSceneCommands(scene, reader); diff --git a/soh/soh/resource/importer/SceneFactory.h b/soh/soh/resource/importer/SceneFactory.h index 115c3f3f5a4..52a4c42c9f3 100644 --- a/soh/soh/resource/importer/SceneFactory.h +++ b/soh/soh/resource/importer/SceneFactory.h @@ -12,7 +12,7 @@ class ResourceFactoryBinarySceneV0 : public Ship::ResourceFactoryBinary { public: ResourceFactoryBinarySceneV0(); - std::shared_ptr ReadResource(std::shared_ptr file) override; + std::shared_ptr ReadResource(std::shared_ptr file, std::shared_ptr initData) override; void ParseSceneCommands(std::shared_ptr scene, std::shared_ptr reader); // Doing something very similar to what we do on the ResourceLoader. @@ -28,7 +28,7 @@ class ResourceFactoryXMLSceneV0 : public Ship::ResourceFactoryXML { public: ResourceFactoryXMLSceneV0(); - std::shared_ptr ReadResource(std::shared_ptr file) override; + std::shared_ptr ReadResource(std::shared_ptr file, std::shared_ptr initData) override; void ParseSceneCommands(std::shared_ptr scene, std::shared_ptr reader); // Doing something very similar to what we do on the ResourceLoader. diff --git a/soh/soh/resource/importer/SkeletonFactory.cpp b/soh/soh/resource/importer/SkeletonFactory.cpp index d4cb965bf3b..e9545b978f7 100644 --- a/soh/soh/resource/importer/SkeletonFactory.cpp +++ b/soh/soh/resource/importer/SkeletonFactory.cpp @@ -4,12 +4,12 @@ #include namespace SOH { -std::shared_ptr ResourceFactoryBinarySkeletonV0::ReadResource(std::shared_ptr file) { - if (!FileHasValidFormatAndReader(file)) { +std::shared_ptr ResourceFactoryBinarySkeletonV0::ReadResource(std::shared_ptr file, std::shared_ptr initData) { + if (!FileHasValidFormatAndReader(file, initData)) { return nullptr; } - auto skeleton = std::make_shared(file->InitData); + auto skeleton = std::make_shared(initData); auto reader = std::get>(file->Reader); skeleton->type = (SkeletonType)reader->ReadInt8(); @@ -62,12 +62,12 @@ std::shared_ptr ResourceFactoryBinarySkeletonV0::ReadResource(s return skeleton; } -std::shared_ptr ResourceFactoryXMLSkeletonV0::ReadResource(std::shared_ptr file) { - if (!FileHasValidFormatAndReader(file)) { +std::shared_ptr ResourceFactoryXMLSkeletonV0::ReadResource(std::shared_ptr file, std::shared_ptr initData) { + if (!FileHasValidFormatAndReader(file, initData)) { return nullptr; } - auto skel = std::make_shared(file->InitData); + auto skel = std::make_shared(initData); auto reader = std::get>(file->Reader)->FirstChildElement(); auto child = reader->FirstChildElement(); diff --git a/soh/soh/resource/importer/SkeletonFactory.h b/soh/soh/resource/importer/SkeletonFactory.h index 24f92720af3..33c1ea12b7d 100644 --- a/soh/soh/resource/importer/SkeletonFactory.h +++ b/soh/soh/resource/importer/SkeletonFactory.h @@ -7,11 +7,11 @@ namespace SOH { class ResourceFactoryBinarySkeletonV0 : public Ship::ResourceFactoryBinary { public: - std::shared_ptr ReadResource(std::shared_ptr file) override; + std::shared_ptr ReadResource(std::shared_ptr file, std::shared_ptr initData) override; }; class ResourceFactoryXMLSkeletonV0 : public Ship::ResourceFactoryXML { public: - std::shared_ptr ReadResource(std::shared_ptr file) override; + std::shared_ptr ReadResource(std::shared_ptr file, std::shared_ptr initData) override; }; } // namespace SOH diff --git a/soh/soh/resource/importer/SkeletonLimbFactory.cpp b/soh/soh/resource/importer/SkeletonLimbFactory.cpp index 3f780e6d4b1..4efdd66dc56 100644 --- a/soh/soh/resource/importer/SkeletonLimbFactory.cpp +++ b/soh/soh/resource/importer/SkeletonLimbFactory.cpp @@ -4,12 +4,12 @@ #include "libultraship/libultraship.h" namespace SOH { -std::shared_ptr ResourceFactoryBinarySkeletonLimbV0::ReadResource(std::shared_ptr file) { - if (!FileHasValidFormatAndReader(file)) { +std::shared_ptr ResourceFactoryBinarySkeletonLimbV0::ReadResource(std::shared_ptr file, std::shared_ptr initData) { + if (!FileHasValidFormatAndReader(file, initData)) { return nullptr; } - auto skeletonLimb = std::make_shared(file->InitData); + auto skeletonLimb = std::make_shared(initData); auto reader = std::get>(file->Reader); skeletonLimb->limbType = (LimbType)reader->ReadInt8(); @@ -184,12 +184,12 @@ std::shared_ptr ResourceFactoryBinarySkeletonLimbV0::ReadResour return skeletonLimb; } -std::shared_ptr ResourceFactoryXMLSkeletonLimbV0::ReadResource(std::shared_ptr file) { - if (!FileHasValidFormatAndReader(file)) { +std::shared_ptr ResourceFactoryXMLSkeletonLimbV0::ReadResource(std::shared_ptr file, std::shared_ptr initData) { + if (!FileHasValidFormatAndReader(file, initData)) { return nullptr; } - auto skelLimb = std::make_shared(file->InitData); + auto skelLimb = std::make_shared(initData); auto reader = std::get>(file->Reader)->FirstChildElement(); std::string limbType = reader->Attribute("Type"); diff --git a/soh/soh/resource/importer/SkeletonLimbFactory.h b/soh/soh/resource/importer/SkeletonLimbFactory.h index 222cefa2cea..cb5b9da2234 100644 --- a/soh/soh/resource/importer/SkeletonLimbFactory.h +++ b/soh/soh/resource/importer/SkeletonLimbFactory.h @@ -7,11 +7,11 @@ namespace SOH { class ResourceFactoryBinarySkeletonLimbV0 : public Ship::ResourceFactoryBinary { public: - std::shared_ptr ReadResource(std::shared_ptr file) override; + std::shared_ptr ReadResource(std::shared_ptr file, std::shared_ptr initData) override; }; class ResourceFactoryXMLSkeletonLimbV0 : public Ship::ResourceFactoryXML { public: - std::shared_ptr ReadResource(std::shared_ptr file) override; + std::shared_ptr ReadResource(std::shared_ptr file, std::shared_ptr initData) override; }; } // namespace SOH diff --git a/soh/soh/resource/importer/TextFactory.cpp b/soh/soh/resource/importer/TextFactory.cpp index 1da1d50db1f..9796285c688 100644 --- a/soh/soh/resource/importer/TextFactory.cpp +++ b/soh/soh/resource/importer/TextFactory.cpp @@ -3,12 +3,12 @@ #include "spdlog/spdlog.h" namespace SOH { -std::shared_ptr ResourceFactoryBinaryTextV0::ReadResource(std::shared_ptr file) { - if (!FileHasValidFormatAndReader(file)) { +std::shared_ptr ResourceFactoryBinaryTextV0::ReadResource(std::shared_ptr file, std::shared_ptr initData) { + if (!FileHasValidFormatAndReader(file, initData)) { return nullptr; } - auto text = std::make_shared(file->InitData); + auto text = std::make_shared(initData); auto reader = std::get>(file->Reader); uint32_t msgCount = reader->ReadUInt32(); @@ -27,12 +27,12 @@ std::shared_ptr ResourceFactoryBinaryTextV0::ReadResource(std:: return text; } -std::shared_ptr ResourceFactoryXMLTextV0::ReadResource(std::shared_ptr file) { - if (!FileHasValidFormatAndReader(file)) { +std::shared_ptr ResourceFactoryXMLTextV0::ReadResource(std::shared_ptr file, std::shared_ptr initData) { + if (!FileHasValidFormatAndReader(file, initData)) { return nullptr; } - auto txt = std::make_shared(file->InitData); + auto txt = std::make_shared(initData); auto child = std::get>(file->Reader)->FirstChildElement()->FirstChildElement(); while (child != nullptr) { diff --git a/soh/soh/resource/importer/TextFactory.h b/soh/soh/resource/importer/TextFactory.h index 55a5693662e..2f55743b98b 100644 --- a/soh/soh/resource/importer/TextFactory.h +++ b/soh/soh/resource/importer/TextFactory.h @@ -7,11 +7,11 @@ namespace SOH { class ResourceFactoryBinaryTextV0 : public Ship::ResourceFactoryBinary { public: - std::shared_ptr ReadResource(std::shared_ptr file) override; + std::shared_ptr ReadResource(std::shared_ptr file, std::shared_ptr initData) override; }; class ResourceFactoryXMLTextV0 : public Ship::ResourceFactoryXML { public: - std::shared_ptr ReadResource(std::shared_ptr file) override; + std::shared_ptr ReadResource(std::shared_ptr file, std::shared_ptr initData) override; }; } // namespace SOH From dc5bc1aa6c885df7f384eb237180549aa503c324 Mon Sep 17 00:00:00 2001 From: lilacLunatic <8488221+lilacLunatic@users.noreply.github.com> Date: Mon, 24 Mar 2025 15:33:55 -0300 Subject: [PATCH 07/12] Mouse Support (#4673) * mouse * (mouse) small fix * "fix" implicit declaration * LUS 1.2 * empty commit to force CI re-run * include new mouse LUS * deleted: soh/soh/Enhancements/controls/GameControlEditor.cpp * [mouse]LUS * fix input viewer header * Bump LUS for mouse support * Mouse Support * Comment cleanup * Adding the actual mouse enhancement files * Fix (?) Windows and Mac builds * Maybe fix MacOS now * Why was it compiling with this?? * Mouse input viewer handling * [Mouse] LUS bump * [mouse] LUS * (Mouse) bump LUS for dxgi fix * F2 mouse notif * Update soh/soh/Enhancements/controls/Mouse.h Co-authored-by: Pepe20129 <72659707+Pepe20129@users.noreply.github.com> * Update soh/soh/Enhancements/controls/Mouse.cpp Co-authored-by: Pepe20129 <72659707+Pepe20129@users.noreply.github.com> * Fix mouse shield ranges to match control stick behavior * Use early returns in Mouse_HandleQuickspin * newline cleanup * cleanup * rename BUTTON_COLOR_MOUSE_BEIGE to BUTTON_COLOR_MOUSE_GRAY * 'Enable Mouse' tooltip * Fix includes * Comments re mouse quickspin * bullshit * Hook handler for cursor recentering on shield * Hook handler for first person mouse aiming * Hook handlers for mouse quickspin * Hook handlers for mouse shield control * Hook registration conditions * Enable Mouse -> Enable Mouse Controls --------- Co-authored-by: Pepe20129 <72659707+Pepe20129@users.noreply.github.com> --- soh/soh/Enhancements/controls/Mouse.cpp | 153 ++++++++++++++++++ soh/soh/Enhancements/controls/Mouse.h | 25 +++ .../controls/SohInputEditorWindow.cpp | 12 +- .../GameInteractor_HookTable.h | 4 + .../game-interactor/GameInteractor_Hooks.cpp | 16 ++ .../game-interactor/GameInteractor_Hooks.h | 4 + .../vanilla-behavior/GIVanillaBehavior.h | 9 ++ soh/soh/SohGui/SohGui.cpp | 1 + soh/src/code/padmgr.c | 3 + soh/src/code/z_camera.c | 16 +- .../actors/ovl_player_actor/z_player.c | 11 ++ 11 files changed, 248 insertions(+), 6 deletions(-) create mode 100644 soh/soh/Enhancements/controls/Mouse.cpp create mode 100644 soh/soh/Enhancements/controls/Mouse.h diff --git a/soh/soh/Enhancements/controls/Mouse.cpp b/soh/soh/Enhancements/controls/Mouse.cpp new file mode 100644 index 00000000000..ae3842a1a73 --- /dev/null +++ b/soh/soh/Enhancements/controls/Mouse.cpp @@ -0,0 +1,153 @@ +#include "Mouse.h" +#include "soh/OTRGlobals.h" +#include "z64player.h" +#include "global.h" +#include +#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ShipInit.hpp" + +static Ship::Coords mouseCoord = {}; +static Ship::Coords mouseCoordRel = {}; + +#define CVAR_ENABLE_MOUSE_NAME CVAR_SETTING("EnableMouse") +#define CVAR_ENABLE_MOUSE_DEFAULT 0 +#define CVAR_ENABLE_MOUSE_VALUE CVarGetInteger(CVAR_ENABLE_MOUSE_NAME, CVAR_ENABLE_MOUSE_DEFAULT) +#define MOUSE_ENABLED (CVAR_ENABLE_MOUSE_VALUE && GetWindow()->IsMouseCaptured()) + +std::shared_ptr GetWindow() { + return OTRGlobals::Instance->context->GetWindow(); +} + +extern "C" { +void Mouse_UpdatePos() { + mouseCoord = GetWindow()->GetMousePos(); +} + +void Mouse_UpdatePosRel() { + mouseCoordRel = GetWindow()->GetMouseDelta(); +} + +void Mouse_UpdateAll() { + Mouse_UpdatePos(); + Mouse_UpdatePosRel(); +} + +void Mouse_HandleThirdPerson(f32* newCamX, f32* newCamY) { + if (MOUSE_ENABLED) { + *newCamX -= mouseCoordRel.x * 40.0f; + *newCamY += mouseCoordRel.y * 40.0f; + } +} + +void Mouse_HandleFirstPerson(Player* player) { + f32 xAxisMulti = CVarGetFloat(CVAR_SETTING("FirstPersonCameraSensitivity.X"), 1.0f); + f32 yAxisMulti = CVarGetFloat(CVAR_SETTING("FirstPersonCameraSensitivity.Y"), 1.0f); + s8 invertXAxisMulti = ((CVarGetInteger(CVAR_SETTING("Controls.InvertAimingXAxis"), 0) + && !CVarGetInteger(CVAR_ENHANCEMENT("MirroredWorld"), 0)) + || (!CVarGetInteger(CVAR_SETTING("Controls.InvertAimingXAxis"), 0) + && CVarGetInteger(CVAR_ENHANCEMENT("MirroredWorld"), 0))) ? -1 : 1; + s8 invertYAxisMulti = CVarGetInteger(CVAR_SETTING("Controls.InvertAimingYAxis"), 1) ? 1 : -1; + if (MOUSE_ENABLED) { + player->actor.focus.rot.y -= mouseCoordRel.x * 6.0f * xAxisMulti * invertXAxisMulti; + player->actor.focus.rot.x += mouseCoordRel.y * 6.0f * yAxisMulti * invertYAxisMulti; + } +} + +void Mouse_RecenterCursor() { + u32 width = GetWindow()->GetWidth(); + u32 height = GetWindow()->GetHeight(); + if (MOUSE_ENABLED) { + GetWindow()->SetMousePos({(s32) (width/2), (s32) (height/2)}); + } +} + +void Mouse_HandleShield(f32* sp50, f32* sp54) { + if (MOUSE_ENABLED) { + s32 width = GetWindow()->GetWidth(); + s32 height = GetWindow()->GetHeight(); + f32 xBound = 7200 / ((f32)width / 2); + f32 yBound = 6000 / ((f32)height / 2); + *sp50 += (mouseCoord.x - (width / 2)) * xBound * (CVarGetInteger(CVAR_ENHANCEMENT("MirroredWorld"), 0) ? 1 : -1); + *sp54 += (mouseCoord.y - (height / 2)) * yBound; + *sp50 = CLAMP(*sp50, -7200, 7200); + *sp54 = CLAMP(*sp54, -6000, 6000); + } +} + +static s8 iterMouse = 0; +static f32 mouseQuickspinX[5] = {}; +static f32 mouseQuickspinY[5] = {}; +static u8 quickspinCount = 0; + +void Mouse_UpdateQuickspinCount() { + if (MOUSE_ENABLED) { + quickspinCount = (quickspinCount + 1) % 5; + mouseQuickspinX[quickspinCount] = mouseCoord.x; + mouseQuickspinY[quickspinCount] = mouseCoord.y; + } else { + quickspinCount = 0; + } +} + +bool Mouse_HandleQuickspin(bool* should, s8* iter2, s8* sp3C) { + s8 temp1; + s8 temp2; + s32 i; + if (!MOUSE_ENABLED) { + return *should = false; + } + + for (i = 0; i < 4; i++, iter2++) { + // Calculating angles as per z_lib.c:func_80077D10() + f32 relY = mouseQuickspinY[i + 1] - mouseQuickspinY[i]; + f32 relX = mouseQuickspinX[i + 1] - mouseQuickspinX[i]; + s16 aTan = Math_Atan2S(relY, -relX); + iterMouse = (u16)(aTan + 0x2000) >> 9; // See z_player.c:Player_ProcessControlStick() + if ((*iter2 = iterMouse) < 0) { + return *should = false; + } + *iter2 *= 2; + } + temp1 = sp3C[0] - sp3C[1]; + if (ABS(temp1) < 10) { + return *should = false; + } + iter2 = &sp3C[1]; + for (i = 1; i < 3; i++, iter2++) { + temp2 = *iter2 - *(iter2 + 1); + if ((ABS(temp2) < 10) || (temp2 * temp1 < 0)) { + return *should = false; + } + } + + return *should = true; +} + +// Hook handlers + +void Mouse_RegisterRecenterCursorOnShield() { + COND_HOOK(OnPlayerHoldUpShield, true, Mouse_RecenterCursor); +} + +void Mouse_RegisterHandleFirstPerson() { + COND_HOOK(OnPlayerFirstPersonControl, true, Mouse_HandleFirstPerson); +} + +void Mouse_RegisterHandleShield() { + COND_HOOK(OnPlayerShieldControl, true, Mouse_HandleShield); +} + +void Mouse_RegisterUpdateQuickspinCount() { + COND_HOOK(OnPlayerProcessStick, true, Mouse_UpdateQuickspinCount); +} + +void Mouse_RegisterHandleQuickspin() { + REGISTER_VB_SHOULD(VB_SHOULD_QUICKSPIN, { Mouse_HandleQuickspin(should, va_arg(args, s8*), va_arg(args, s8*)); } ); +} + +static RegisterShipInitFunc initFunc_shieldRecenter(Mouse_RegisterRecenterCursorOnShield, { CVAR_ENABLE_MOUSE_NAME }); +static RegisterShipInitFunc initFunc_firstPerson(Mouse_RegisterHandleFirstPerson, { CVAR_ENABLE_MOUSE_NAME }); +static RegisterShipInitFunc initFunc_quickspinCount(Mouse_RegisterUpdateQuickspinCount, { CVAR_ENABLE_MOUSE_NAME }); +static RegisterShipInitFunc initFunc_quickspin(Mouse_RegisterHandleQuickspin, { CVAR_ENABLE_MOUSE_NAME }); +static RegisterShipInitFunc initFunc_shieldMove(Mouse_RegisterHandleShield, { CVAR_ENABLE_MOUSE_NAME }); +} //extern "C" diff --git a/soh/soh/Enhancements/controls/Mouse.h b/soh/soh/Enhancements/controls/Mouse.h new file mode 100644 index 00000000000..38d84e078bc --- /dev/null +++ b/soh/soh/Enhancements/controls/Mouse.h @@ -0,0 +1,25 @@ +#ifndef MOUSE_H +#define MOUSE_H + +#pragma once + +#include + +struct Player; + +#ifdef __cplusplus +extern "C" { +#endif +void Mouse_UpdateAll(); +void Mouse_RecenterCursor(); +void Mouse_HandleThirdPerson(f32* newCamX, f32* newCamY); +void Mouse_HandleFirstPerson(struct Player* player); +void Mouse_HandleShield(f32* sp50, f32* sp54); +bool Mouse_HandleQuickspin(bool* should, s8* iter2, s8* sp3C); +void Mouse_UpdateQuickspinCount(); +#ifdef __cplusplus +}; //extern "C" +#endif + +//MOUSE_H +#endif diff --git a/soh/soh/Enhancements/controls/SohInputEditorWindow.cpp b/soh/soh/Enhancements/controls/SohInputEditorWindow.cpp index 7dbc74a75a2..dcef762cf15 100644 --- a/soh/soh/Enhancements/controls/SohInputEditorWindow.cpp +++ b/soh/soh/Enhancements/controls/SohInputEditorWindow.cpp @@ -172,8 +172,8 @@ void SohInputEditorWindow::DrawAnalogPreview(const char* label, ImVec2 stick, fl #define BUTTON_COLOR_KEYBOARD_BEIGE ImVec4(0.651f, 0.482f, 0.357f, 0.5f) #define BUTTON_COLOR_KEYBOARD_BEIGE_HOVERED ImVec4(0.651f, 0.482f, 0.357f, 1.0f) -#define BUTTON_COLOR_MOUSE_BEIGE ImVec4(0.5f, 0.5f, 0.5f, 0.5f) -#define BUTTON_COLOR_MOUSE_BEIGE_HOVERED ImVec4(0.5f, 0.5f, 0.5f, 1.0f) +#define BUTTON_COLOR_MOUSE_GRAY ImVec4(0.5f, 0.5f, 0.5f, 0.5f) +#define BUTTON_COLOR_MOUSE_GRAY_HOVERED ImVec4(0.5f, 0.5f, 0.5f, 1.0f) #define BUTTON_COLOR_GAMEPAD_BLUE ImVec4(0.0f, 0.255f, 0.976f, 0.5f) #define BUTTON_COLOR_GAMEPAD_BLUE_HOVERED ImVec4(0.0f, 0.255f, 0.976f, 1.0f) @@ -198,8 +198,8 @@ void SohInputEditorWindow::GetButtonColorsForDeviceType(Ship::PhysicalDeviceType buttonHoveredColor = BUTTON_COLOR_KEYBOARD_BEIGE_HOVERED; break; case Ship::PhysicalDeviceType::Mouse: - buttonColor = BUTTON_COLOR_MOUSE_BEIGE; - buttonHoveredColor = BUTTON_COLOR_MOUSE_BEIGE_HOVERED; + buttonColor = BUTTON_COLOR_MOUSE_GRAY; + buttonHoveredColor = BUTTON_COLOR_MOUSE_GRAY_HOVERED; break; case Ship::PhysicalDeviceType::SDLGamepad: buttonColor = BUTTON_COLOR_GAMEPAD_BLUE; @@ -265,6 +265,7 @@ void SohInputEditorWindow::DrawButtonLineEditMappingButton(uint8_t port, N64Butt icon = ICON_FA_GAMEPAD; break; case MAPPING_TYPE_KEYBOARD: + case MAPPING_TYPE_MOUSE: icon = ICON_FA_KEYBOARD_O; break; case MAPPING_TYPE_UNKNOWN: @@ -1343,6 +1344,9 @@ void SohInputEditorWindow::DrawOcarinaControlPanel() { void SohInputEditorWindow::DrawCameraControlPanel() { ImVec2 cursor = ImGui::GetCursorPos(); ImGui::SetCursorPos(ImVec2(cursor.x + 5, cursor.y + 5)); + CVarCheckbox("Enable Mouse Controls", CVAR_SETTING("EnableMouse"), CheckboxOptions().Color(THEME_COLOR) + .Tooltip("Allows for using the mouse to control the camera (must enable Free Look), " + "aim with the shield, and perform quickspin attacks (quickly rotate the mouse then press B)")); Ship::GuiWindow::BeginGroupPanel("Aiming/First-Person Camera", ImGui::GetContentRegionAvail()); CVarCheckbox("Right Stick Aiming", CVAR_SETTING("Controls.RightStickAim"), CheckboxOptions().Color(THEME_COLOR) .Tooltip("Allows for aiming with the right stick in:\n-First-Person/C-Up view\n-Weapon Aiming")); diff --git a/soh/soh/Enhancements/game-interactor/GameInteractor_HookTable.h b/soh/soh/Enhancements/game-interactor/GameInteractor_HookTable.h index 3bd2ef36eb3..59d511941c4 100644 --- a/soh/soh/Enhancements/game-interactor/GameInteractor_HookTable.h +++ b/soh/soh/Enhancements/game-interactor/GameInteractor_HookTable.h @@ -33,6 +33,10 @@ DEFINE_HOOK(OnTimestamp, (u8 item)); DEFINE_HOOK(OnPlayerBonk, ()); DEFINE_HOOK(OnPlayerHealthChange, (int16_t amount)); DEFINE_HOOK(OnPlayerBottleUpdate, (int16_t contents)); +DEFINE_HOOK(OnPlayerHoldUpShield, ()); +DEFINE_HOOK(OnPlayerFirstPersonControl, (Player* player)); +DEFINE_HOOK(OnPlayerProcessStick, ()); +DEFINE_HOOK(OnPlayerShieldControl, (float_t* sp50, float_t* sp54)); DEFINE_HOOK(OnPlayDestroy, ()); DEFINE_HOOK(OnPlayDrawEnd, ()); DEFINE_HOOK(OnVanillaBehavior, (GIVanillaBehavior flag, bool* result, va_list originalArgs)); diff --git a/soh/soh/Enhancements/game-interactor/GameInteractor_Hooks.cpp b/soh/soh/Enhancements/game-interactor/GameInteractor_Hooks.cpp index 9c861062b4d..40c47e9a9c2 100644 --- a/soh/soh/Enhancements/game-interactor/GameInteractor_Hooks.cpp +++ b/soh/soh/Enhancements/game-interactor/GameInteractor_Hooks.cpp @@ -142,6 +142,22 @@ void GameInteractor_ExecuteOnPlayerBottleUpdate(int16_t contents) { GameInteractor::Instance->ExecuteHooks(contents); } +void GameInteractor_ExecuteOnPlayerHoldUpShield() { + GameInteractor::Instance->ExecuteHooks(); +} + +void GameInteractor_ExecuteOnPlayerFirstPersonControl(Player* player) { + GameInteractor::Instance->ExecuteHooks(player); +} + +void GameInteractor_ExecuteOnPlayerShieldControl(float_t* sp50, float_t* sp54) { + GameInteractor::Instance->ExecuteHooks(sp50, sp54); +} + +void GameInteractor_ExecuteOnPlayerProcessStick() { + GameInteractor::Instance->ExecuteHooks(); +} + void GameInteractor_ExecuteOnPlayDestroy() { GameInteractor::Instance->ExecuteHooks(); } diff --git a/soh/soh/Enhancements/game-interactor/GameInteractor_Hooks.h b/soh/soh/Enhancements/game-interactor/GameInteractor_Hooks.h index d20864012ae..10ab3a877e0 100644 --- a/soh/soh/Enhancements/game-interactor/GameInteractor_Hooks.h +++ b/soh/soh/Enhancements/game-interactor/GameInteractor_Hooks.h @@ -35,6 +35,10 @@ void GameInteractor_ExecuteOnTimestamp (u8 item); void GameInteractor_ExecuteOnPlayerBonk(); void GameInteractor_ExecuteOnPlayerHealthChange(int16_t amount); void GameInteractor_ExecuteOnPlayerBottleUpdate(int16_t contents); +void GameInteractor_ExecuteOnPlayerHoldUpShield(); +void GameInteractor_ExecuteOnPlayerFirstPersonControl(Player* player); +void GameInteractor_ExecuteOnPlayerShieldControl(float_t* sp50, float_t* sp54); +void GameInteractor_ExecuteOnPlayerProcessStick(); void GameInteractor_ExecuteOnShopSlotChangeHooks(uint8_t cursorIndex, int16_t price); void GameInteractor_ExecuteOnPlayDestroy(); void GameInteractor_ExecuteOnPlayDrawEnd(); diff --git a/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h b/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h index 5d25bd12da2..8aace9a9085 100644 --- a/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h +++ b/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h @@ -1679,6 +1679,15 @@ typedef enum { // - `*VBFishingData` VB_SHOULD_SET_FISHING_RECORD, + // #### `result` + // ```c + // false + // ``` + // #### `args` + // - `*s8 iter2` + // - `s8 sp3C[4]` + VB_SHOULD_QUICKSPIN, + // #### `result` // ```c // (interactedActor->id == ACTOR_BG_TOKI_SWD) && LINK_IS_ADULT diff --git a/soh/soh/SohGui/SohGui.cpp b/soh/soh/SohGui/SohGui.cpp index 56da5eba034..40996fc5981 100644 --- a/soh/soh/SohGui/SohGui.cpp +++ b/soh/soh/SohGui/SohGui.cpp @@ -113,6 +113,7 @@ namespace SohGui { gui->GetGameOverlay()->TextDrawNotification(30.0f, true, "Press - to access enhancements menu"); #else gui->GetGameOverlay()->TextDrawNotification(30.0f, true, "Press F1 to access enhancements menu"); + gui->GetGameOverlay()->TextDrawNotification(30.0f, true, "Press F2 to enable the mouse cursor"); #endif }*/ diff --git a/soh/src/code/padmgr.c b/soh/src/code/padmgr.c index a8bf778af4f..13a82162f7d 100644 --- a/soh/src/code/padmgr.c +++ b/soh/src/code/padmgr.c @@ -3,6 +3,7 @@ #include #include "soh/Enhancements/game-interactor/GameInteractor.h" +#include "soh/Enhancements/controls/Mouse.h" #include "soh/OTRGlobals.h" #include "soh/ResourceManagerHelpers.h" @@ -317,6 +318,8 @@ void PadMgr_HandleRetraceMsg(PadMgr* padMgr) { osRecvMesg(queue, NULL, OS_MESG_BLOCK); osContGetReadData(padMgr->pads); + Mouse_UpdateAll(); + for (i = 0; i < __osMaxControllers; i++) { padMgr->padStatus[i].status = Controller_ShouldRumble(i); } diff --git a/soh/src/code/z_camera.c b/soh/src/code/z_camera.c index 7167daceb9c..7b95c70afd5 100644 --- a/soh/src/code/z_camera.c +++ b/soh/src/code/z_camera.c @@ -7,6 +7,7 @@ #include "overlays/actors/ovl_En_Horse/z_en_horse.h" #include "soh/frame_interpolation.h" +#include "soh/Enhancements/controls/Mouse.h" s16 Camera_ChangeSettingFlags(Camera* camera, s16 setting, s16 flags); s32 Camera_ChangeModeFlags(Camera* camera, s16 mode, u8 flags); @@ -1422,6 +1423,8 @@ s32 SetCameraManual(Camera* camera) { f32 newCamX = -D_8015BD7C->state.input[0].cur.right_stick_x * 10.0f; f32 newCamY = D_8015BD7C->state.input[0].cur.right_stick_y * 10.0f; + Mouse_HandleThirdPerson(&newCamX, &newCamY); + if ((fabsf(newCamX) >= 15.0f || fabsf(newCamY) >= 15.0f) && camera->play->manualCamera == false) { camera->play->manualCamera = true; @@ -1485,8 +1488,17 @@ s32 Camera_Free(Camera* camera) { camera->animState = 0; - f32 newCamX = -D_8015BD7C->state.input[0].cur.right_stick_x * 10.0f * (CVarGetFloat(CVAR_SETTING("FreeLook.CameraSensitivity.X"), 1.0f)); - f32 newCamY = D_8015BD7C->state.input[0].cur.right_stick_y * 10.0f * (CVarGetFloat(CVAR_SETTING("FreeLook.CameraSensitivity.Y"), 1.0f)); + f32 newCamX = -D_8015BD7C->state.input[0].cur.right_stick_x * 10.0f; + f32 newCamY = +D_8015BD7C->state.input[0].cur.right_stick_y * 10.0f; + + /* Disable mouse movement when holding down the shield */ + if (!(camera->player->stateFlags1 & 0x400000)) { + Mouse_HandleThirdPerson(&newCamX, &newCamY); + } + + newCamX *= (CVarGetFloat(CVAR_SETTING("FreeLook.CameraSensitivity.X"), 1.0f)); + newCamY *= (CVarGetFloat(CVAR_SETTING("FreeLook.CameraSensitivity.Y"), 1.0f)); + bool invertXAxis = (CVarGetInteger(CVAR_SETTING("FreeLook.InvertXAxis"), 0) && !CVarGetInteger(CVAR_ENHANCEMENT("MirroredWorld"), 0)) || (!CVarGetInteger(CVAR_SETTING("FreeLook.InvertXAxis"), 0) && CVarGetInteger(CVAR_ENHANCEMENT("MirroredWorld"), 0)); camera->play->camX += newCamX * (invertXAxis ? -1 : 1); diff --git a/soh/src/overlays/actors/ovl_player_actor/z_player.c b/soh/src/overlays/actors/ovl_player_actor/z_player.c index 8acdee4a4c2..312a7421528 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -2082,6 +2082,8 @@ void Player_ProcessControlStick(PlayState* play, Player* this) { direction = (u16)((s16)(sControlStickWorldYaw - this->actor.shape.rot.y) + 0x2000) >> 14; } + GameInteractor_ExecuteOnPlayerProcessStick(); + this->controlStickSpinAngles[this->controlStickDataIndex] = spinAngle; this->controlStickDirections[this->controlStickDataIndex] = direction; } @@ -4281,6 +4283,10 @@ s32 Player_CanSpinAttack(Player* this) { iter = &this->controlStickSpinAngles[0]; iter2 = &sp3C[0]; + if (GameInteractor_Should(VB_SHOULD_QUICKSPIN, false, iter2, sp3C)) { + return true; + } + for (i = 0; i < 4; i++, iter++, iter2++) { if ((*iter2 = *iter) < 0) { return false; @@ -6432,6 +6438,8 @@ s32 Player_ActionHandler_11(Player* this, PlayState* play) { Player_DetachHeldActor(play, this); if (Player_SetupAction(play, this, Player_Action_80843188, 0)) { + GameInteractor_ExecuteOnPlayerHoldUpShield(); + this->stateFlags1 |= PLAYER_STATE1_SHIELDING; if (!Player_IsChildWithHylianShield(this)) { @@ -9260,6 +9268,7 @@ void Player_Action_80843188(Player* this, PlayState* play) { sp54 = sControlInput->rel.stick_y * 100 * (CVarGetInteger(CVAR_SETTING("Controls.InvertShieldAimingYAxis"), 1) ? 1 : -1); sp50 = sControlInput->rel.stick_x * (CVarGetInteger(CVAR_ENHANCEMENT("MirroredWorld"), 0) ? 120 : -120) * (CVarGetInteger(CVAR_SETTING("Controls.InvertShieldAimingXAxis"), 0) ? -1 : 1); sp4E = this->actor.shape.rot.y - Camera_GetInputDirYaw(GET_ACTIVE_CAM(play)); + GameInteractor_ExecuteOnPlayerShieldControl(&sp50, &sp54); sp40 = Math_CosS(sp4E); sp4C = (Math_SinS(sp4E) * sp50) + (sp54 * sp40); @@ -12658,6 +12667,8 @@ s16 func_8084ABD8(PlayState* play, Player* this, s32 arg2, s16 arg3) { f32 xAxisMulti = CVarGetFloat(CVAR_SETTING("FirstPersonCameraSensitivity.X"), 1.0f); f32 yAxisMulti = CVarGetFloat(CVAR_SETTING("FirstPersonCameraSensitivity.Y"), 1.0f); + GameInteractor_ExecuteOnPlayerFirstPersonControl(this); + if (!func_8002DD78(this) && !func_808334B4(this) && (arg2 == 0)) { // First person without weapon // Y Axis if (!CVarGetInteger(CVAR_SETTING("MoveInFirstPerson"), 0)) { From bddef32a5ac3a97c3e0d43b0f971f272962bd937 Mon Sep 17 00:00:00 2001 From: aMannus Date: Mon, 24 Mar 2025 20:09:39 +0100 Subject: [PATCH 08/12] fix defaults + modIndex (#5201) --- soh/soh/Enhancements/randomizer/hook_handlers.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/soh/soh/Enhancements/randomizer/hook_handlers.cpp b/soh/soh/Enhancements/randomizer/hook_handlers.cpp index 9467cb10eff..9a7a2880602 100644 --- a/soh/soh/Enhancements/randomizer/hook_handlers.cpp +++ b/soh/soh/Enhancements/randomizer/hook_handlers.cpp @@ -300,12 +300,12 @@ void RandomizerOnPlayerUpdateForRCQueueHandler() { // Always show ItemGet animation outside of randomizer to keep behaviour consistent in vanilla IS_RANDO && ( - CVarGetInteger(CVAR_RANDOMIZER_ENHANCEMENT("TimeSavers.SkipGetItemAnimation"), SGIA_DISABLED) == SGIA_ALL || + CVarGetInteger(CVAR_RANDOMIZER_ENHANCEMENT("TimeSavers.SkipGetItemAnimation"), SGIA_JUNK) == SGIA_ALL || ( - CVarGetInteger(CVAR_RANDOMIZER_ENHANCEMENT("TimeSavers.SkipGetItemAnimation"), SGIA_DISABLED) == SGIA_JUNK && + CVarGetInteger(CVAR_RANDOMIZER_ENHANCEMENT("TimeSavers.SkipGetItemAnimation"), SGIA_JUNK) == SGIA_JUNK && ( //crude fix to ensure map hints are readable. Ideally replace with better hint tracking. - !(getItemEntry.getItemId >= RG_DEKU_TREE_MAP && getItemEntry.getItemId <= RG_ICE_CAVERN_MAP) && ( + !(getItemEntry.getItemId >= RG_DEKU_TREE_MAP && getItemEntry.getItemId <= RG_ICE_CAVERN_MAP && getItemEntry.modIndex == MOD_RANDOMIZER) && ( getItemEntry.getItemCategory == ITEM_CATEGORY_JUNK || getItemEntry.getItemCategory == ITEM_CATEGORY_SKULLTULA_TOKEN || getItemEntry.getItemCategory == ITEM_CATEGORY_LESSER @@ -767,7 +767,7 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l } case VB_PLAY_SLOW_CHEST_CS: { // We force fast chests if SkipGetItemAnimation is enabled because the camera in the CS looks pretty wonky otherwise - if (CVarGetInteger(CVAR_RANDOMIZER_ENHANCEMENT("TimeSavers.SkipGetItemAnimation"), SGIA_DISABLED)) { + if (CVarGetInteger(CVAR_RANDOMIZER_ENHANCEMENT("TimeSavers.SkipGetItemAnimation"), SGIA_JUNK)) { *should = false; } break; From 43510e5ad9f0fd6c6b720a0cb65eb6b232449690 Mon Sep 17 00:00:00 2001 From: Christopher Leggett Date: Mon, 24 Mar 2025 17:21:09 -0400 Subject: [PATCH 09/12] Fix Skull Tokens from Chests locking you in place (#5198) * temp fix for chest skulltulas * Implement way to load a vanilla message into a CustomMessage * dynamically inserts autodismiss text code to skulltula text. --- .../custom-message/CustomMessageManager.cpp | 38 +++++++++++++++++++ .../custom-message/CustomMessageManager.h | 2 + .../Enhancements/randomizer/hook_handlers.cpp | 5 ++- soh/soh/OTRGlobals.cpp | 8 +++- 4 files changed, 50 insertions(+), 3 deletions(-) diff --git a/soh/soh/Enhancements/custom-message/CustomMessageManager.cpp b/soh/soh/Enhancements/custom-message/CustomMessageManager.cpp index 4d4d27b3f52..1b993dab24d 100644 --- a/soh/soh/Enhancements/custom-message/CustomMessageManager.cpp +++ b/soh/soh/Enhancements/custom-message/CustomMessageManager.cpp @@ -114,6 +114,44 @@ CustomMessage::CustomMessage(Text text, TextBoxType type_,TextBoxPosition positi messages[LANGUAGE_FRA] = text.GetFrench(); } +typedef struct { + u16 textId; + u8 typePos; + const char* segment; + u32 msgSize; +} MessageTableEntry; + +extern "C" MessageTableEntry* sNesMessageEntryTablePtr; +extern "C" MessageTableEntry* sGerMessageEntryTablePtr; +extern "C" MessageTableEntry* sFraMessageEntryTablePtr; + +CustomMessage CustomMessage::LoadVanillaMessageTableEntry(uint16_t textId) { + const char* foundSeg; + const char* nextSeg; + MessageTableEntry* msgEntry = sNesMessageEntryTablePtr; + u16 bufferId = textId; + CustomMessage msg; + if (gSaveContext.language == LANGUAGE_GER) { + msgEntry = sGerMessageEntryTablePtr; + } else if (gSaveContext.language == LANGUAGE_FRA) { + msgEntry = sFraMessageEntryTablePtr; + } + while (msgEntry->textId != 0xFFFF) { + if (msgEntry->textId == bufferId) { + TextBoxPosition position = static_cast(msgEntry->typePos & 0xF); + TextBoxType type = static_cast(msgEntry->typePos >> 4); + // uint8_t icon = msgEntry->segment[1]; + std::string message = std::string(msgEntry->segment , msgEntry->msgSize); + msg = CustomMessage(message, type, position); + // msg.Format(static_cast(icon)); + return msg; + } + msgEntry++; + } + return CustomMessage(); +} + + const std::string CustomMessage::GetEnglish(MessageFormat format) const { return GetForLanguage(LANGUAGE_ENG, format); } diff --git a/soh/soh/Enhancements/custom-message/CustomMessageManager.h b/soh/soh/Enhancements/custom-message/CustomMessageManager.h index e8a96906493..0720d8ac424 100644 --- a/soh/soh/Enhancements/custom-message/CustomMessageManager.h +++ b/soh/soh/Enhancements/custom-message/CustomMessageManager.h @@ -47,6 +47,8 @@ class CustomMessage { CustomMessage(std::string english_, std::vector colors_, std::vector capital_ = {}, TextBoxType type_ = TEXTBOX_TYPE_BLACK, TextBoxPosition position_ = TEXTBOX_POS_BOTTOM); CustomMessage(Text text, TextBoxType type_ = TEXTBOX_TYPE_BLACK, TextBoxPosition position_ = TEXTBOX_POS_BOTTOM); + static CustomMessage LoadVanillaMessageTableEntry(uint16_t textId); + static std::string MESSAGE_END() ; static std::string ITEM_OBTAINED(uint8_t x) ; static std::string NEWLINE() ; diff --git a/soh/soh/Enhancements/randomizer/hook_handlers.cpp b/soh/soh/Enhancements/randomizer/hook_handlers.cpp index 9a7a2880602..2d40459ea23 100644 --- a/soh/soh/Enhancements/randomizer/hook_handlers.cpp +++ b/soh/soh/Enhancements/randomizer/hook_handlers.cpp @@ -236,6 +236,7 @@ void RandomizerOnFlagSetHandler(int16_t flagType, int16_t flag) { RandomizerCheck rc = GetRandomizerCheckFromFlag(flagType, flag); if (rc == RC_UNKNOWN_CHECK) return; + if (flagType == FLAG_GS_TOKEN && Rando::Context::GetInstance()->GetOption(RSK_SHUFFLE_TOKENS).Is(RO_TOKENSANITY_OFF)) return; auto loc = Rando::Context::GetInstance()->GetItemLocation(rc); if (loc == nullptr || loc->HasObtained() || loc->GetPlacedRandomizerGet() == RG_NONE) return; @@ -1610,7 +1611,6 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l case VB_GIVE_ITEM_FROM_LAB_DIVE: case VB_GIVE_ITEM_FROM_SKULL_KID_SARIAS_SONG: case VB_GIVE_ITEM_FROM_MAN_ON_ROOF: - case VB_GIVE_ITEM_SKULL_TOKEN: case VB_GIVE_ITEM_FROM_BLUE_WARP: case VB_GIVE_ITEM_FAIRY_OCARINA: case VB_GIVE_ITEM_WEIRD_EGG: @@ -1626,6 +1626,9 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l case VB_GIVE_ITEM_SHADOW_MEDALLION: *should = false; break; + case VB_GIVE_ITEM_SKULL_TOKEN: + *should = (Rando::Context::GetInstance()->GetOption(RSK_SHUFFLE_TOKENS).Is(RO_TOKENSANITY_OFF)); + break; default: break; } diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp index 5cdf06d9eac..792bf0639ac 100644 --- a/soh/soh/OTRGlobals.cpp +++ b/soh/soh/OTRGlobals.cpp @@ -2379,7 +2379,7 @@ extern "C" int CustomMessage_RetrieveIfExists(PlayState* play) { if (CVarGetInteger(CVAR_ENHANCEMENT("InjectItemCounts.GoldSkulltula"), 0) != 0) { // The freeze text cannot be manually dismissed and must be auto-dismissed. // This is fine and even wanted when skull tokens are not shuffled, but when - // when they are shuffled we don't want to be able to manually dismiss the box. + // when they are shuffled we want to be able to manually dismiss the box. // Otherwise if we get a token from a chest or an NPC we get stuck in the ItemGet // animation until the text box auto-dismisses. // RANDOTODO: Implement a way to determine if an item came from a skulltula and @@ -2395,7 +2395,11 @@ extern "C" int CustomMessage_RetrieveIfExists(PlayState* play) { s16 gsCount = gSaveContext.inventory.gsTokens + (IS_RANDO ? 1 : 0); messageEntry = CustomMessageManager::Instance->RetrieveMessage(customMessageTableID, textId, MF_FORMATTED); messageEntry.Replace("[[gsCount]]", std::to_string(gsCount)); - } + } else if (CVarGetInteger(CVAR_ENHANCEMENT("SkulltulaFreeze"), 0) != 0 && (!IS_RANDO || Randomizer_GetSettingValue(RSK_SHUFFLE_TOKENS) == RO_TOKENSANITY_OFF)) { + messageEntry = CustomMessage::LoadVanillaMessageTableEntry(TEXT_GS_FREEZE); + messageEntry.Replace(CustomMessage::MESSAGE_END(), "\x0E\x3C"); + messageEntry += CustomMessage::MESSAGE_END(); + } } else if ((IS_RANDO || CVarGetInteger(CVAR_ENHANCEMENT("BetterBombchuShopping"), 0)) && (textId == TEXT_BUY_BOMBCHUS_10_DESC || textId == TEXT_BUY_BOMBCHUS_10_PROMPT)) { messageEntry = CustomMessageManager::Instance->RetrieveMessage(customMessageTableID, textId, MF_FORMATTED); From c7ff6e47006359b49f12dd360e5fa0a7f77b911e Mon Sep 17 00:00:00 2001 From: aMannus Date: Mon, 24 Mar 2025 22:22:51 +0100 Subject: [PATCH 10/12] Update enhancement and randomizer presets (#5193) * Prepare fresh presets * Separate preset files & finish hell preset * Enhancement presets done * Finish randomizer presets * Update missed enhancement cvar * Better split presets.h * Address review comments --- .../Enhancements/Presets/PresetEntries.cpp | 679 +++++++++++++ .../{presets.cpp => Presets/Presets.cpp} | 2 +- soh/soh/Enhancements/Presets/Presets.h | 58 ++ soh/soh/Enhancements/enhancementTypes.h | 4 +- soh/soh/Enhancements/presets.h | 907 ------------------ .../Enhancements/randomizer/randomizer.cpp | 11 +- soh/soh/Enhancements/randomizer/settings.cpp | 3 +- soh/soh/OTRGlobals.cpp | 2 +- soh/soh/SohGui/SohGui.cpp | 2 +- soh/soh/SohGui/SohMenu.h | 2 +- soh/soh/SohGui/SohMenuBar.cpp | 2 +- soh/soh/SohGui/SohMenuEnhancements.cpp | 18 +- soh/soh/SohGui/SohMenuSettings.cpp | 2 +- 13 files changed, 761 insertions(+), 931 deletions(-) create mode 100644 soh/soh/Enhancements/Presets/PresetEntries.cpp rename soh/soh/Enhancements/{presets.cpp => Presets/Presets.cpp} (99%) create mode 100644 soh/soh/Enhancements/Presets/Presets.h delete mode 100644 soh/soh/Enhancements/presets.h diff --git a/soh/soh/Enhancements/Presets/PresetEntries.cpp b/soh/soh/Enhancements/Presets/PresetEntries.cpp new file mode 100644 index 00000000000..3b2167a2ea5 --- /dev/null +++ b/soh/soh/Enhancements/Presets/PresetEntries.cpp @@ -0,0 +1,679 @@ +#include "Presets.h" +#include +#include "soh/cvar_prefixes.h" +#include "soh/Enhancements/enhancementTypes.h" + +#define PRESET_ENTRY_S32(cvar, value) { cvar, PRESET_ENTRY_TYPE_S32, value } +#define PRESET_ENTRY_FLOAT(cvar, value) { cvar, PRESET_ENTRY_TYPE_FLOAT, value } +#define PRESET_ENTRY_STRING(cvar, value) { cvar, PRESET_ENTRY_TYPE_STRING, value } +#define PRESET_ENTRY_CPP_STRING(cvar, value) { cvar, PRESET_ENTRY_TYPE_CPP_STRING, value } + +// TODO: Ideally everything in this file will come from one/many JSON files + +// Enhancement presets +const std::vector vanillaPlusPresetEntries = { + // Quality of Life + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("Autosave"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InjectItemCounts.GoldSkulltula"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InjectItemCounts.HeartPiece"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InjectItemCounts.HeartContainer"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("BetterOwl"), 1), + + // Skips & Speed-ups + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SkipText"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TextSpeed"), 5), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FasterRupeeAccumulator"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SkipSaveConfirmation"), 1), + + // Graphics + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DisableLOD"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("RememberMapToggleState"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("VisualAgony"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DynamicWalletIcon"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TimeFlowFileSelect"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("WidescreenActorCulling"), 1), + + // Items + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DpadEquips"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("AssignableTunicsAndBoots"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DpadNoDropOcarinaInput"), 1), + + // Fixes + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("GravediggingTourFix"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixFloorSwitches"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixZoraHintDialogue"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixVineFall"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("EnemySpawnsOverWaterboxes"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixSawSoftlock"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DekuNutUpgradeFix"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixGrokenGiantsKnife"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixMenuLR"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixDungeonMinimapIcon"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TwoHandedIdle"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("NaviTextFix"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("GerudoWarriorClothingFix"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixTexturesOOB"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixEyesOpenWhileSleeping"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixHammerHand"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SceneSpecificDirtPathFix"), ZFIGHT_FIX_CONSISTENT_VANISH), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SilverRupeeJingleExtend"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixDaruniaDanceSpeed"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("CreditsFix"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("RedGanonBlood"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("PulsateBossIcon"), 1), + + // Difficulty + // NONE + + // Minigames + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("CustomizeFrogsOcarinaGame"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FrogsModifyFailTime"), 2), + + // Extra Modes + // NONE + + // Cheats + // NONE +}; + +const std::vector enhancedPresetEntries = { + // Quality of Life + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("Autosave"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("PauseWarp"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("NoInputForCredits"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InjectItemCounts.GoldSkulltula"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InjectItemCounts.HeartPiece"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InjectItemCounts.HeartContainer"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DisableCritWiggle"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("BetterOwl"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("QuitFishingAtDoor"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InstantPutaway"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TimeSavers.SleepingWaterfall"), 1), + + // Skips & Speed-ups + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SkipText"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TextSpeed"), 5), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SlowTextSpeed"), 5), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FasterHeavyBlockLift"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SkipSwimDeepEndAnim"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("ClimbSpeed"), 3), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FasterBlockPush"), 5), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("CrawlSpeed"), 2), + PRESET_ENTRY_FLOAT(CVAR_ENHANCEMENT("MweepSpeed"), 5.0f), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InstantScarecrow"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FasterRupeeAccumulator"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SkulltulaFreeze"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SkipSaveConfirmation"), 1), + + // Graphics + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DisableLOD"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("NewDrops"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("PauseMenuAnimatedLink"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("ShowDoorLocksOnBothSides"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("ToTMedallionsColors"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("RememberMapToggleState"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("VisualAgony"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DynamicWalletIcon"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("BetterAmmoRendering"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TimeFlowFileSelect"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("WidescreenActorCulling"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("ExtendedCullingExcludeGlitchActors"), 1), + + // Items + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DpadEquips"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("AssignableTunicsAndBoots"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DpadNoDropOcarinaInput"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastOcarinaPlayback"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MMBunnyHood"), BUNNY_HOOD_FAST), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("PersistentMasks"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("NutsExplodeBombs"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DisableFirstPersonChus"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("BetterBombchuShopping"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SeparateArrows"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SkipArrowAnimation"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastBoomerang"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("BetterFarore"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastFarores"), 1), + + // Fixes + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("GravediggingTourFix"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixFloorSwitches"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixZoraHintDialogue"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixVineFall"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("EnemySpawnsOverWaterboxes"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixSawSoftlock"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DekuNutUpgradeFix"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixGrokenGiantsKnife"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixMenuLR"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixDungeonMinimapIcon"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TwoHandedIdle"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("NaviTextFix"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("GerudoWarriorClothingFix"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixTexturesOOB"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixEyesOpenWhileSleeping"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixHammerHand"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SceneSpecificDirtPathFix"), ZFIGHT_FIX_CONSISTENT_VANISH), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SilverRupeeJingleExtend"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixDaruniaDanceSpeed"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("CreditsFix"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("RedGanonBlood"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("PulsateBossIcon"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("HoverFishing"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("N64WeirdFrames"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("BombchusOOB"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("QuickPutaway"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("QuickBongoKill"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("RestoreRBAValues"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("EarlyEyeballFrog"), 1), + + // Difficulty + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("EnableBombchuDrops"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DampeWin"), 1), + + // Minigames + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("CustomizeFrogsOcarinaGame"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FrogsModifyFailTime"), 2), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("CustomizeOcarinaGame"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("OcarinaGame.StartingNotes"), 5), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("CustomizeFishing"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("GuaranteeFishingBite"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FishNeverEscape"), 1), + + // Extra Modes + // NONE + + // Cheats + // NONE +}; + +const std::vector randomizerPresetEntries = { + // Quality of Life + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("Autosave"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DayGravePull"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DampeAllNight"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MarketSneak"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("PauseWarp"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("NoInputForCredits"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("IncludeHeldInputsBufferWindow"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InjectItemCounts.GoldSkulltula"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InjectItemCounts.HeartPiece"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InjectItemCounts.HeartContainer"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DisableCritWiggle"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("BetterOwl"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("QuitFishingAtDoor"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InstantPutaway"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TimeSavers.SleepingWaterfall"), 1), + + // Skips & Speed-ups + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Intro"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Entrances"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.LearnSong"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.BossIntro"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.QuickBossDeaths"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.OnePoint"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TimeSavers.SkipOwlInteractions"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TimeSavers.SkipMiscInteractions"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TimeSavers.DisableTitleCard"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastDrops"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TimeSavers.SkipForcedDialog"), FORCED_DIALOG_SKIP_ALL), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SkipText"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TextSpeed"), 5), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SlowTextSpeed"), 5), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FasterHeavyBlockLift"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastChests"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SkipSwimDeepEndAnim"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("ClimbSpeed"), 3), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FasterBlockPush"), 5), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("CrawlSpeed"), 2), + PRESET_ENTRY_FLOAT(CVAR_ENHANCEMENT("MweepSpeed"), 5.0f), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TimeSavers.SkipChildStealth"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TimeSavers.SkipTowerEscape"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InstantScarecrow"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FasterRupeeAccumulator"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SkipSaveConfirmation"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("ForgeTime"), 0), + + // Graphics + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DisableLOD"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("NewDrops"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("PauseMenuAnimatedLink"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("ShowDoorLocksOnBothSides"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("ToTMedallionsColors"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("RememberMapToggleState"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("VisualAgony"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DynamicWalletIcon"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FileSelectMoreInfo"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("BetterAmmoRendering"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TimeFlowFileSelect"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("WidescreenActorCulling"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("ExtendedCullingExcludeGlitchActors"), 1), + + // Items + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DpadEquips"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("AssignableTunicsAndBoots"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("EquipmentCanBeRemoved"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("ToggleStrength"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SwordToggle"), SWORD_TOGGLE_CHILD), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DpadNoDropOcarinaInput"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastOcarinaPlayback"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MMBunnyHood"), BUNNY_HOOD_FAST), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("AdultMasks"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("PersistentMasks"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MaskSelect"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("NutsExplodeBombs"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DisableFirstPersonChus"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("BetterBombchuShopping"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SeparateArrows"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SkipArrowAnimation"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastBoomerang"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("BetterFarore"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastFarores"), 1), + + // Fixes + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("GravediggingTourFix"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixFloorSwitches"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixZoraHintDialogue"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixVineFall"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("EnemySpawnsOverWaterboxes"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixSawSoftlock"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DekuNutUpgradeFix"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixGrokenGiantsKnife"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixMenuLR"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixDungeonMinimapIcon"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TwoHandedIdle"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("NaviTextFix"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("GerudoWarriorClothingFix"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixTexturesOOB"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixHammerHand"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SceneSpecificDirtPathFix"), ZFIGHT_FIX_CONSISTENT_VANISH), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SilverRupeeJingleExtend"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixDaruniaDanceSpeed"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("CreditsFix"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("RedGanonBlood"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("PulsateBossIcon"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("HoverFishing"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("N64WeirdFrames"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("BombchusOOB"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("QuickPutaway"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("QuickBongoKill"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("RestoreRBAValues"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("EarlyEyeballFrog"), 1), + + // Difficulty + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("GoronPot"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DampeWin"), 1), + + // Minigames + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("CustomizeFrogsOcarinaGame"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FrogsModifyFailTime"), 2), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("CustomizeOcarinaGame"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("OcarinaGame.StartingNotes"), 5), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("CustomizeFishing"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("GuaranteeFishingBite"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FishNeverEscape"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MinimumFishWeightChild"), 3), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MinimumFishWeightAdult"), 6), + + // Extra Modes + // NONE + + // Cheats + PRESET_ENTRY_S32(CVAR_CHEAT("EasyFrameAdvance"), 1), +}; + +// Randomizer presets +const std::vector randomizerBeginnerPresetEntries = { + // World tab + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ClosedForest"), RO_CLOSED_FOREST_OFF), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("KakarikoGate"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("DoorOfTime"), 2), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ZorasFountain"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("RainbowBridge"), RO_BRIDGE_GREG), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("GanonTrial"), RO_GANONS_TRIALS_SKIP), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("FortressCarpenters"), 1), + + // Items tab + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("IncludeTycoonWallet"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleOcarinas"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingMapsCompasses"), RO_DUNGEON_ITEM_LOC_STARTWITH), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("Keysanity"), RO_DUNGEON_ITEM_LOC_OWN_DUNGEON), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("BossKeysanity"), RO_DUNGEON_ITEM_LOC_OWN_DUNGEON), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleGanonBossKey"), RO_GANON_BOSS_KEY_LACS_REWARDS), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("LacsRewardCount"), 6), + + // Gamplay tab + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("CuccosToReturn"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("BigPoeTargetCount"), 0), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SkipChildZelda"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SkipEponaRace"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("CompleteMaskQuest"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SkipScarecrowsSong"), 1), + + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SheikLAHint"), 0), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("DampeHint"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("GregHint"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SariaHint"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("FrogsHint"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("BiggoronHint"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("MalonHint"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("HBAHint"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("MerchantText"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("10GSHint"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("20GSHint"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("30GSHint"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("40GSHint"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("50GSHint"), 1), + + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("FullWallets"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("EnableBombchuDrops"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("BlueFireArrows"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SunlightArrows"), 1), + + // Locations tab + PRESET_ENTRY_STRING(CVAR_RANDOMIZER_SETTING("ExcludedLocations"), "147,148,233,323,"), + + // Tricks/Glitches tab + // NONE + + // Starting inventory tab + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingKokiriSword"), RO_STARTING_OCARINA_FAIRY), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingOcarina"), RO_STARTING_OCARINA_FAIRY), +}; + +const std::vector randomizerStandardPresetEntries = { + // World tab + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ClosedForest"), RO_CLOSED_FOREST_OFF), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("KakarikoGate"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("DoorOfTime"), 2), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ZorasFountain"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("RainbowBridge"), RO_BRIDGE_GREG), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("GanonTrial"), RO_GANONS_TRIALS_SKIP), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("FortressCarpenters"), 1), + + // Items tab + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleSongs"), RO_SONG_SHUFFLE_ANYWHERE), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleTokens"), RO_TOKENSANITY_ALL), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleKokiriSword"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("IncludeTycoonWallet"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleOcarinas"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleGerudoToken"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("Shopsanity"), RO_SHOPSANITY_SPECIFIC_COUNT), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShopsanityCount"), 4), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShopsanityPrices"), RO_PRICE_BALANCED), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleScrubs"), RO_SCRUBS_ALL), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ScrubsPrices"), RO_PRICE_FIXED), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ScrubsFixedPrice"), 2), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleMerchants"), RO_SHUFFLE_MERCHANTS_BEANS_ONLY), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingMapsCompasses"), RO_DUNGEON_ITEM_LOC_STARTWITH), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("Keysanity"), RO_DUNGEON_ITEM_LOC_ANYWHERE), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("BossKeysanity"), RO_DUNGEON_ITEM_LOC_OWN_DUNGEON), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleGanonBossKey"), RO_GANON_BOSS_KEY_LACS_REWARDS), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("LacsRewardCount"), 7), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleKeyRings"), RO_KEYRINGS_COUNT), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleKeyRingsRandomCount"), 8), + + // Gamplay tab + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("CuccosToReturn"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("BigPoeTargetCount"), 0), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SkipChildZelda"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SkipEponaRace"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("CompleteMaskQuest"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SkipScarecrowsSong"), 1), + + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SheikLAHint"), 0), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("DampeHint"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("GregHint"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SariaHint"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("FrogsHint"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("BiggoronHint"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("MalonHint"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("HBAHint"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("MerchantText"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("10GSHint"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("20GSHint"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("30GSHint"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("40GSHint"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("50GSHint"), 1), + + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("FullWallets"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("BombchuBag"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("EnableBombchuDrops"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("BlueFireArrows"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SunlightArrows"), 1), + + // Locations tab + // NONE + + // Tricks/Glitches tab + // NONE + + // Starting inventory tab + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingOcarina"), RO_STARTING_OCARINA_FAIRY), +}; + +const std::vector randomizerAdvancedPresetEntries = { + // World tab + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ClosedForest"), RO_CLOSED_FOREST_OFF), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("KakarikoGate"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("DoorOfTime"), 2), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("RainbowBridge"), RO_BRIDGE_GREG), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingAge"), RO_AGE_RANDOM), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("GanonTrial"), RO_GANONS_TRIALS_SKIP), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("FortressCarpenters"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleDungeonsEntrances"), RO_DUNGEON_ENTRANCE_SHUFFLE_ON_PLUS_GANON), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleBossEntrances"), RO_BOSS_ROOM_ENTRANCE_SHUFFLE_FULL), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleOverworldSpawns"), 1), + + // Items tab + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleSongs"), RO_SONG_SHUFFLE_ANYWHERE), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleTokens"), RO_TOKENSANITY_ALL), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleKokiriSword"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleMasterSword"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("IncludeTycoonWallet"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleOcarinas"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleSwim"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleGerudoToken"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleDekuNutBag"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleDekuStickBag"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("Shopsanity"), RO_SHOPSANITY_SPECIFIC_COUNT), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShopsanityCount"), 7), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShopsanityPrices"), RO_PRICE_BALANCED), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleScrubs"), RO_SCRUBS_ALL), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ScrubsPrices"), RO_PRICE_FIXED), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ScrubsFixedPrice"), 2), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleCows"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleMerchants"), RO_SHUFFLE_MERCHANTS_ALL), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleFrogSongRupees"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleAdultTrade"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingMapsCompasses"), RO_DUNGEON_ITEM_LOC_STARTWITH), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("Keysanity"), RO_DUNGEON_ITEM_LOC_ANYWHERE), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("GerudoKeys"), RO_GERUDO_KEYS_ANYWHERE), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("BossKeysanity"), RO_DUNGEON_ITEM_LOC_ANYWHERE), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleGanonBossKey"), RO_GANON_BOSS_KEY_LACS_REWARDS), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("LacsRewardCount"), 8), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleKeyRings"), RO_KEYRINGS_COUNT), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleKeyRingsRandomCount"), 4), + + // Gamplay tab + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("CuccosToReturn"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("BigPoeTargetCount"), 0), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SkipChildZelda"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SkipEponaRace"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("CompleteMaskQuest"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SkipScarecrowsSong"), 1), + + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SheikLAHint"), 0), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("DampeHint"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("GregHint"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SariaHint"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("FrogsHint"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("MalonHint"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("HBAHint"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("MerchantText"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("40GSHint"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("50GSHint"), 1), + + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("FullWallets"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("BombchuBag"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("EnableBombchuDrops"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("BlueFireArrows"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SunlightArrows"), 1), + + // Locations tab + // NONE + + // Tricks/Glitches tab + // NONE + + // Starting inventory tab + // NONE +}; + +const std::vector hellModePresetEntries = { + // World tab + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ClosedForest"), RO_CLOSED_FOREST_OFF), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("KakarikoGate"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("DoorOfTime"), 2), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("LockOverworldDoors"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("RainbowBridge"), RO_BRIDGE_GREG), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingAge"), RO_AGE_RANDOM), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleDungeonsEntrances"), RO_DUNGEON_ENTRANCE_SHUFFLE_ON_PLUS_GANON), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleBossEntrances"), RO_BOSS_ROOM_ENTRANCE_SHUFFLE_FULL), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleOverworldEntrances"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleInteriorsEntrances"), RO_INTERIOR_ENTRANCE_SHUFFLE_ALL), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleGrottosEntrances"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleOwlDrops"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleWarpSongs"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleOverworldSpawns"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("MixedEntrances"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("MixDungeons"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("MixBosses"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("MixOverworld"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("MixInteriors"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("MixGrottos"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("DecoupleEntrances"), 1), + + // Items tab + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleSongs"), RO_SONG_SHUFFLE_ANYWHERE), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleTokens"), RO_TOKENSANITY_ALL), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleKokiriSword"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleMasterSword"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleChildWallet"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("IncludeTycoonWallet"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleOcarinas"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleOcarinaButtons"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleSwim"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleWeirdEgg"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleGerudoToken"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleFishingPole"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleDekuNutBag"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleDekuStickBag"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleFreestanding"), RO_SHUFFLE_FREESTANDING_ALL), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("Shopsanity"), RO_SHOPSANITY_SPECIFIC_COUNT), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShopsanityCount"), 7), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShopsanityPrices"), RO_PRICE_BALANCED), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("Fishsanity"), RO_FISHSANITY_BOTH), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("FishsanityPondCount"), 17), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("FishsanityAgeSplit"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleScrubs"), RO_SCRUBS_ALL), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ScrubsPrices"), RO_PRICE_BALANCED), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleBeehives"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleCows"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShufflePots"), RO_SHUFFLE_POTS_ALL), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleMerchants"), RO_SHUFFLE_MERCHANTS_ALL), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleFrogSongRupees"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleAdultTrade"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("Shuffle100GSReward"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleBossSouls"), 2), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleFairies"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingMapsCompasses"), RO_DUNGEON_ITEM_LOC_ANYWHERE), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("Keysanity"), RO_DUNGEON_ITEM_LOC_ANYWHERE), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("GerudoKeys"), RO_GERUDO_KEYS_ANYWHERE), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("BossKeysanity"), RO_DUNGEON_ITEM_LOC_ANYWHERE), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleGanonBossKey"), RO_GANON_BOSS_KEY_LACS_REWARDS), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("LacsRewardCount"), 10), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("LacsRewardOptions"), RO_LACS_GREG_REWARD), + + // Gamplay tab + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("CuccosToReturn"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("BigPoeTargetCount"), 0), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SkipEponaRace"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("BombchuBag"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("EnableBombchuDrops"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("BlueFireArrows"), 1), + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SunlightArrows"), 1), + + // Locations tab + // NONE + + // Tricks/Glitches tab + // NONE + + // Starting inventory tab + PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingHearts"), 0), +}; + +const std::map presetTypes = { + { PRESET_TYPE_ENHANCEMENTS, + { { CVAR_PREFIX_ENHANCEMENT, CVAR_PREFIX_CHEAT }, + { + { ENHANCEMENT_PRESET_DEFAULT, + { + "Default", + "Reset all options to their default values.", + {}, + } }, + { ENHANCEMENT_PRESET_VANILLA_PLUS, + { + "Vanilla Plus", + "Adds some quality of life features, but don't alter gameplay and aims to " + "preserve the authentic experience. Recommended for a first playthrough of OoT.", + vanillaPlusPresetEntries, + } }, + { ENHANCEMENT_PRESET_ENHANCED, + { "Enhanced", + "The \"Vanilla Plus\" preset, but with more quality of life enhancements that might alter gameplay " + "slightly. Recommended for returning players going through the vanilla game again.", + enhancedPresetEntries } }, + { ENHANCEMENT_PRESET_RANDOMIZER, + { "Randomizer", + "A baseline set of enhancements for playing randomizer. Includes many quality of life options and " + "options to speed up gameplay.", + randomizerPresetEntries } }, + } } }, + { PRESET_TYPE_RANDOMIZER, + { { CVAR_PREFIX_RANDOMIZER_SETTING, CVAR_PREFIX_RANDOMIZER_ENHANCEMENT }, + { + { RANDOMIZER_PRESET_DEFAULT, + { + "Default", + "Reset all options to their default values.", + {}, + } }, + { RANDOMIZER_PRESET_BEGINNER, + { + "Beginner", + "A simpler set of options and shuffled items meant for players new to the randomizer. ", + randomizerBeginnerPresetEntries, + } }, + { RANDOMIZER_PRESET_STANDARD, + { + "Standard", + "A set of options meant as a baseline for both newer and experienced randomizer players.", + randomizerStandardPresetEntries, + } }, + { RANDOMIZER_PRESET_ADVANCED, + { + "Advanced", + "Includes many more shuffled items and introduces some entrance shuffle options. Meant for advanced " + "randomizer players.", + randomizerAdvancedPresetEntries, + } }, + { RANDOMIZER_PRESET_HELL_MODE, + { "Hell Mode", + "Every location randomized, all entrance settings enabled, but still using glitchless logic. Expect " + "pain.", + hellModePresetEntries } }, + } } } +}; diff --git a/soh/soh/Enhancements/presets.cpp b/soh/soh/Enhancements/Presets/Presets.cpp similarity index 99% rename from soh/soh/Enhancements/presets.cpp rename to soh/soh/Enhancements/Presets/Presets.cpp index 3c542762f61..8d08869f5d7 100644 --- a/soh/soh/Enhancements/presets.cpp +++ b/soh/soh/Enhancements/Presets/Presets.cpp @@ -1,4 +1,4 @@ -#include "presets.h" +#include "Presets.h" #include #include #include diff --git a/soh/soh/Enhancements/Presets/Presets.h b/soh/soh/Enhancements/Presets/Presets.h new file mode 100644 index 00000000000..898bc9cc973 --- /dev/null +++ b/soh/soh/Enhancements/Presets/Presets.h @@ -0,0 +1,58 @@ +#pragma once + +#include +#include +#include +#include "soh/OTRGlobals.h" + +enum PresetEntryType { + PRESET_ENTRY_TYPE_S32, + PRESET_ENTRY_TYPE_FLOAT, + PRESET_ENTRY_TYPE_STRING, + PRESET_ENTRY_TYPE_CPP_STRING, +}; + +enum PresetType { + PRESET_TYPE_ENHANCEMENTS, + PRESET_TYPE_RANDOMIZER, +}; + +enum EnhancementPreset { + ENHANCEMENT_PRESET_DEFAULT, + ENHANCEMENT_PRESET_VANILLA_PLUS, + ENHANCEMENT_PRESET_ENHANCED, + ENHANCEMENT_PRESET_RANDOMIZER, +}; + +enum RandomizerPreset { + RANDOMIZER_PRESET_DEFAULT, + RANDOMIZER_PRESET_BEGINNER, + RANDOMIZER_PRESET_STANDARD, + RANDOMIZER_PRESET_ADVANCED, + RANDOMIZER_PRESET_HELL_MODE, +}; + +typedef struct PresetEntry { + const char* cvar; + PresetEntryType type; + std::variant value; +} PresetEntry; + +std::string FormatLocations(std::vector locs); + +void DrawPresetSelector(PresetType presetType); +void clearCvars(std::vector cvarsToClear); +void applyPreset(std::vector entries); + +typedef struct PresetDefinition { + const char* label; + const char* description; + std::vector entries; +} PresetDefinition; + +typedef struct PresetTypeDefinition { + std::vector blocksToClear; + std::map presets; +} PresetTypeDefinition; + +extern const std::map presetTypes; diff --git a/soh/soh/Enhancements/enhancementTypes.h b/soh/soh/Enhancements/enhancementTypes.h index 14228054b4d..36ef76cc894 100644 --- a/soh/soh/Enhancements/enhancementTypes.h +++ b/soh/soh/Enhancements/enhancementTypes.h @@ -30,8 +30,8 @@ typedef enum { typedef enum { BUNNY_HOOD_VANILLA, - BUNNY_HOOD_FAST_AND_JUMP, - BUNNY_HOOD_FAST + BUNNY_HOOD_FAST, + BUNNY_HOOD_FAST_AND_JUMP } BunnyHoodMode; typedef enum { diff --git a/soh/soh/Enhancements/presets.h b/soh/soh/Enhancements/presets.h deleted file mode 100644 index a7bca4e66a7..00000000000 --- a/soh/soh/Enhancements/presets.h +++ /dev/null @@ -1,907 +0,0 @@ -#pragma once - -#include -#include -#include -#include -#include -#include "soh/Enhancements/randomizer/randomizerTypes.h" -#include "soh/Enhancements/enhancementTypes.h" -#include "soh/OTRGlobals.h" -#include "soh/cvar_prefixes.h" - -enum PresetEntryType { - PRESET_ENTRY_TYPE_S32, - PRESET_ENTRY_TYPE_FLOAT, - PRESET_ENTRY_TYPE_STRING, - PRESET_ENTRY_TYPE_CPP_STRING, -}; - -enum PresetType { - PRESET_TYPE_ENHANCEMENTS, - PRESET_TYPE_RANDOMIZER, -}; - -enum EnhancementPreset { - ENHANCEMENT_PRESET_DEFAULT, - ENHANCEMENT_PRESET_VANILLA_PLUS, - ENHANCEMENT_PRESET_ENHANCED, - ENHANCEMENT_PRESET_RANDOMIZER, -}; - -enum RandomizerPreset { - RANDOMIZER_PRESET_DEFAULT, - RANDOMIZER_PRESET_SPOCK_RACE, - RANDOMIZER_PRESET_SPOCK_RACE_NO_LOGIC, - RANDOMIZER_PRESET_S6, - RANDOMIZER_PRESET_HELL_MODE, - RANDOMIZER_PRESET_BENCHMARK, -}; - -typedef struct PresetEntry { - const char* cvar; - PresetEntryType type; - std::variant value; -} PresetEntry; - -std::string FormatLocations(std::vector locs); - -#define PRESET_ENTRY_S32(cvar, value) \ - { cvar, PRESET_ENTRY_TYPE_S32, value } -#define PRESET_ENTRY_FLOAT(cvar, value) \ - { cvar, PRESET_ENTRY_TYPE_FLOAT, value } -#define PRESET_ENTRY_STRING(cvar, value) \ - { cvar, PRESET_ENTRY_TYPE_STRING, value } -#define PRESET_ENTRY_CPP_STRING(cvar, value) \ - { cvar, PRESET_ENTRY_TYPE_CPP_STRING, value } - -void DrawPresetSelector(PresetType presetType); -void clearCvars(std::vector cvarsToClear); -void applyPreset(std::vector entries); - -// TODO: Ideally everything below this point will come from one/many JSON files - -const std::vector vanillaPlusPresetEntries = { - // D-pad Support in text and file select - PRESET_ENTRY_S32(CVAR_SETTING("DpadInText"), 1), - // Play Ocarina with D-pad - PRESET_ENTRY_S32(CVAR_SETTING("OcarinaControl.Dpad"), 1), - // Play Ocarina with Right Stick - PRESET_ENTRY_S32(CVAR_SETTING("OcarinaControl.RStick"), 1), - // D-pad as Equip Items - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DpadEquips"), 1), - // Prevent Dropped Ocarina Inputs - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DpadNoDropOcarinaInput"), 1), - - // Text Speed (1 to 5) - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TextSpeed"), 5), - // Slow Text Speed (1 to 5) - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SlowTextSpeed"), 5), - // Skip Text - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SkipText"), 1), - // King Zora Speed (1 to 5) - PRESET_ENTRY_FLOAT(CVAR_ENHANCEMENT("MweepSpeed"), 2.0f), - // Faster Block Push (+0 to +5) - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FasterBlockPush"), 5), - // Better Owl - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("BetterOwl"), 1), - - // Assignable Tunics and Boots - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("AssignableTunicsAndBoots"), 1), - // Enable passage of time on file select - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TimeFlowFileSelect"), 1), - // Inject Item Counts in messages - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InjectItemCounts.GoldSkulltula"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InjectItemCounts.HeartPiece"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InjectItemCounts.HeartContainer"), 1), - - // Dynamic Wallet Icon - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DynamicWalletIcon"), 1), - // Always show dungeon entrances - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("AlwaysShowDungeonMinimapIcon"), 1), - - // Fix L&R Pause menu - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixMenuLR"), 1), - // Fix Dungeon entrances - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixDungeonMinimapIcon"), 1), - // Fix Two Handed idle animations - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TwoHandedIdle"), 1), - // Fix the Gravedigging Tour Glitch - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("GravediggingTourFix"), 1), - // Fix Deku Nut upgrade - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DekuNutUpgradeFix"), 1), - // Fix Navi text HUD position - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("NaviTextFix"), 1), - // Extend Silver Rupee Jingle - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SilverRupeeJingleExtend"), 1), - // Fix some Floor Switches - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixFloorSwitches"), 1), - - // Red Ganon blood - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("RedGanonBlood"), 1), - // Fish while hovering - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("HoverFishing"), 1), - // N64 Weird Frames - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("N64WeirdFrames"), 1), - // Bombchus out of bounds - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("BombchusOOB"), 1), - // Quick Putaway - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("QuickPutaway"), 1), - // Skip save confirmation - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SkipSaveConfirmation"), 1), -}; - -const std::vector enhancedPresetEntries = { - // D-pad Support in text and file select - PRESET_ENTRY_S32(CVAR_SETTING("DpadInText"), 1), - // Play Ocarina with D-pad - PRESET_ENTRY_S32(CVAR_SETTING("OcarinaControl.Dpad"), 1), - // Play Ocarina with Right Stick - PRESET_ENTRY_S32(CVAR_SETTING("OcarinaControl.RStick"), 1), - // D-pad as Equip Items - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DpadEquips"), 1), - // Prevent Dropped Ocarina Inputs - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DpadNoDropOcarinaInput"), 1), - - // Text Speed (1 to 5) - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TextSpeed"), 5), - // Slow Text Speed (1 to 5) - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SlowTextSpeed"), 5), - // Skip Text - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SkipText"), 1), - // King Zora Speed (1 to 5) - PRESET_ENTRY_FLOAT(CVAR_ENHANCEMENT("MweepSpeed"), 5.0f), - // Faster Block Push (+0 to +5) - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FasterBlockPush"), 5), - // Better Owl - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("BetterOwl"), 1), - - // Assignable Tunics and Boots - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("AssignableTunicsAndBoots"), 1), - // Enable passage of time on file select - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TimeFlowFileSelect"), 1), - // Inject Item Counts in messages - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InjectItemCounts.GoldSkulltula"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InjectItemCounts.HeartPiece"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InjectItemCounts.HeartContainer"), 1), - - // Dynamic Wallet Icon - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DynamicWalletIcon"), 1), - // Always show dungeon entrances - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("AlwaysShowDungeonMinimapIcon"), 1), - - // Fix L&R Pause menu - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixMenuLR"), 1), - // Fix Dungeon entrances - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixDungeonMinimapIcon"), 1), - // Fix Two Handed idle animations - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TwoHandedIdle"), 1), - // Fix the Gravedigging Tour Glitch - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("GravediggingTourFix"), 1), - // Fix Deku Nut upgrade - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DekuNutUpgradeFix"), 1), - // Fix Navi text HUD position - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("NaviTextFix"), 1), - // Extend Silver Rupee Jingle - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SilverRupeeJingleExtend"), 1), - // Fix enemies not spawning on ground over water - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("EnemySpawnsOverWaterboxes"), 1), - // Fix some Floor Switches - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixFloorSwitches"), 1), - - // Red Ganon blood - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("RedGanonBlood"), 1), - // Fish while hovering - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("HoverFishing"), 1), - // N64 Weird Frames - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("N64WeirdFrames"), 1), - // Bombchus out of bounds - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("BombchusOOB"), 1), - // Quick Putaway - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("QuickPutaway"), 1), - // Skip save confirmation - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SkipSaveConfirmation"), 1), - // Biggoron Forge Time (0 to 3) - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("ForgeTime"), 0), - // Vine/Ladder Climb speed (+0 to +12) - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("ClimbSpeed"), 3), - // Faster Heavy Block Lift - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FasterHeavyBlockLift"), 1), - // No Forced Navi - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("NoForcedNavi"), 1), - // No Skulltula Freeze - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SkulltulaFreeze"), 1), - // MM Bunny Hood - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MMBunnyHood"), BUNNY_HOOD_FAST_AND_JUMP), - // Adult Bunny Hood - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("AdultMasks"), 1), - // Fast Chests - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastChests"), 1), - // Fast Drops - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastDrops"), 1), - // Fast Ocarina Playback - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastOcarinaPlayback"), 1), - // Instant Putaway - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InstantPutaway"), 1), - // Instant Boomerang Recall - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastBoomerang"), 1), - // Nuts Explode Bombs - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("NutsExplodeBombs"), 1), - // Ask to Equip New Items - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("AskToEquip"), 1), - // Mask Select in Inventory - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MaskSelect"), 1), - // Always Win Goron Pot - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("GoronPot"), 1), - // Always Win Dampe Digging - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DampeWin"), 1), - // Skip Magic Arrow Equip Animation - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SkipArrowAnimation"), 1), - - // Equip arrows on multiple slots - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SeparateArrows"), 1), - - // Disable Navi Call Audio - PRESET_ENTRY_S32(CVAR_AUDIO("DisableNaviCallAudio"), 1), - - // Equipment Toggle - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("EquipmentCanBeRemoved"), 1), - // Link's Cow in Both Time Periods - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("CowOfTime"), 1), - - // Enable 3D Dropped items/projectiles - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("NewDrops"), 1), - - // Fix Anubis fireballs - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("AnubisFix"), 1), - - // Autosave - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("Autosave"), 1), - - // Bombchu shop doesn't sell out, and 10 bombchus cost 99 instead of 100 - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("BetterBombchuShopping"), 1), -}; - -const std::vector randomizerPresetEntries = { - // D-pad Support in text and file select - PRESET_ENTRY_S32(CVAR_SETTING("DpadInText"), 1), - // Play Ocarina with D-pad - PRESET_ENTRY_S32(CVAR_SETTING("OcarinaControl.Dpad"), 1), - // Play Ocarina with Right Stick - PRESET_ENTRY_S32(CVAR_SETTING("OcarinaControl.RStick"), 1), - // D-pad as Equip Items - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DpadEquips"), 1), - // Prevent Dropped Ocarina Inputs - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DpadNoDropOcarinaInput"), 1), - - // Text Speed (1 to 5) - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TextSpeed"), 5), - // Slow Text Speed (1 to 5) - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SlowTextSpeed"), 5), - // Skip Text - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SkipText"), 1), - // King Zora Speed (1 to 5) - PRESET_ENTRY_FLOAT(CVAR_ENHANCEMENT("MweepSpeed"), 5.0f), - // Faster Block Push (+0 to +5) - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FasterBlockPush"), 5), - // Better Owl - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("BetterOwl"), 1), - - // Assignable Tunics and Boots - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("AssignableTunicsAndBoots"), 1), - // Enable passage of time on file select - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TimeFlowFileSelect"), 1), - // Inject Item Counts in messages - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InjectItemCounts.GoldSkulltula"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InjectItemCounts.HeartPiece"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InjectItemCounts.HeartContainer"), 1), - - // Dynamic Wallet Icon - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DynamicWalletIcon"), 1), - // Always show dungeon entrances - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("AlwaysShowDungeonMinimapIcon"), 1), - - // Fix L&R Pause menu - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixMenuLR"), 1), - // Fix Dungeon entrances - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixDungeonMinimapIcon"), 1), - // Fix Two Handed idle animations - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TwoHandedIdle"), 1), - // Fix the Gravedigging Tour Glitch - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("GravediggingTourFix"), 1), - // Fix Deku Nut upgrade - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DekuNutUpgradeFix"), 1), - // Fix Navi text HUD position - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("NaviTextFix"), 1), - // Extend Silver Rupee Jingle - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SilverRupeeJingleExtend"), 1), - // Fix some Floor Switches - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixFloorSwitches"), 1), - - // Red Ganon blood - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("RedGanonBlood"), 1), - // Fish while hovering - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("HoverFishing"), 1), - // N64 Weird Frames - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("N64WeirdFrames"), 1), - // Bombchus out of bounds - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("BombchusOOB"), 1), - // Quick Putaway - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("QuickPutaway"), 1), - // Skip save confirmation - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SkipSaveConfirmation"), 1), - // Biggoron Forge Time (0 to 3) - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("ForgeTime"), 0), - // Vine/Ladder Climb speed (+0 to +12) - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("ClimbSpeed"), 3), - // Faster Heavy Block Lift - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FasterHeavyBlockLift"), 1), - // No Forced Navi - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("NoForcedNavi"), 1), - // No Skulltula Freeze - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SkulltulaFreeze"), 1), - // MM Bunny Hood - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MMBunnyHood"), BUNNY_HOOD_FAST_AND_JUMP), - // Adult Bunny Hood - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("AdultMasks"), 1), - // Fast Chests - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastChests"), 1), - // Fast Drops - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastDrops"), 1), - // Fast Ocarina Playback - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastOcarinaPlayback"), 1), - // Instant Putaway - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InstantPutaway"), 1), - // Instant Boomerang Recall - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastBoomerang"), 1), - // Nuts Explode Bombs - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("NutsExplodeBombs"), 1), - // Ask to Equip New Items - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("AskToEquip"), 1), - // Mask Select in Inventory - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MaskSelect"), 1), - // Always Win Goron Pot - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("GoronPot"), 1), - // Always Win Dampe Digging - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DampeWin"), 1), - // Skip Magic Arrow Equip Animation - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SkipArrowAnimation"), 1), - // Exit Market at Night - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MarketSneak"), 1), - - // Equip arrows on multiple slots - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SeparateArrows"), 1), - - // Disable Navi Call Audio - PRESET_ENTRY_S32(CVAR_AUDIO("DisableNaviCallAudio"), 1), - - // Equipment Toggle - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("EquipmentCanBeRemoved"), 1), - // Link's Cow in Both Time Periods - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("CowOfTime"), 1), - - // Enable 3D Dropped items/projectiles - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("NewDrops"), 1), - - // Fix Anubis fireballs - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("AnubisFix"), 1), - - // Autosave - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("Autosave"), 1), - - // Customize Fishing Behaviour - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("CustomizeFishing"), 1), - // Guarantee Bite - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("GuaranteeFishingBite"), 1), - // Fish Never Escape - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FishNeverEscape"), 1), - // Child Minimum Weight (6 to 10) - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MinimumFishWeightChild"), 3), - // Adult Minimum Weight (8 to 13) - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MinimumFishWeightAdult"), 6), - - // Customize Lost Woods Ocarina Game Behavior - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("CustomizeOcarinaGame"), 1), - // Start With Five Notes - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("OcarinaGame.StartingNotes"), 5), - // Round One Notes - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("OcarinaGame.RoundOneNotes"), 5), - - // Visual Stone of Agony - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("VisualAgony"), 1), - // Pull grave during the day - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DayGravePull"), 1), - // Pull out Ocarina to Summon Scarecrow - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InstantScarecrow"), 1), - // Chest size & texture matches contents - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("ChestSizeAndTextureMatchContents"), CSMC_BOTH), - - // Color Temple of Time's Medallions - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("ToTMedallionsColors"), 1), - - // Frames to wait - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MinFrameCount"), 200), - - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("NoInputForCredits"), 1), - - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastFarores"), 1), -}; - -const std::vector spockRacePresetEntries = { - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("LogicRules"), 0), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TextSpeed"), 5), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SlowTextSpeed"), 5), - PRESET_ENTRY_FLOAT(CVAR_ENHANCEMENT("MweepSpeed"), 5.0f), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("ClimbSpeed"), 4), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FasterBlockPush"), 5), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FasterHeavyBlockLift"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("NoForcedNavi"), 1), - PRESET_ENTRY_S32(CVAR_AUDIO("DisableNaviCallAudio"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastChests"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastDrops"), 1), - PRESET_ENTRY_S32(CVAR_SETTING("DpadInText"), 1), - PRESET_ENTRY_S32(CVAR_SETTING("OcarinaControl.Dpad"), 1), - PRESET_ENTRY_S32(CVAR_SETTING("OcarinaControl.RStick"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DpadEquips"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastOcarinaPlayback"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InstantScarecrow"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MarketSneak"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InstantPutaway"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastBoomerang"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("AdultMasks"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MMBunnyHood"), BUNNY_HOOD_FAST), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SeparateArrows"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("AssignableTunicsAndBoots"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("EquipmentCanBeRemoved"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DayGravePull"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("NewDrops"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("CreditsFix"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SkipText"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SkulltulaFreeze"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("PauseAnyCursor"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastFarores"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("NoInputForCredits"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MaskSelect"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InjectItemCounts.GoldSkulltula"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InjectItemCounts.HeartPiece"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InjectItemCounts.HeartContainer"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("CustomizeFishing"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FishNeverEscape"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InstantFishing"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("GuaranteeFishingBite"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MinimumFishWeightAdult"), 6), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MinimumFishWeightChild"), 3), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("GoronPot"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("ForgeTime"), 0), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DampeAllNight"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("10GSHint"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("20GSHint"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("30GSHint"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("40GSHint"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("50GSHint"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("AllLocationsReachable"), 0), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("BlueFireArrows"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("BombchuBag"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("CompleteMaskQuest"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("CuccosToReturn"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("DampeHint"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("DoorOfTime"), RO_DOOROFTIME_OPEN), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("EnableBombchuDrops"), 1), - PRESET_ENTRY_CPP_STRING(CVAR_RANDOMIZER_SETTING("ExcludedLocations"), FormatLocations( - { RC_MARKET_10_BIG_POES, RC_KAK_40_GOLD_SKULLTULA_REWARD, RC_KAK_50_GOLD_SKULLTULA_REWARD, RC_ZR_FROGS_OCARINA_GAME })), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ClosedForest"), RO_CLOSED_FOREST_OFF), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("FullWallets"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("GanonTrial"), RO_GANONS_TRIALS_SKIP), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("FortressCarpenters"), RO_GF_CARPENTERS_FAST), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("GregHint"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("GsExpectSunsSong"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("KakarikoGate"), RO_KAK_GATE_OPEN), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("LacsRewardCount"), 5), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("RainbowBridge"), RO_BRIDGE_GREG), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ScrubText"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("IncludeTycoonWallet"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("Shopsanity"), RO_SHOPSANITY_RANDOM), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShopsanityPrices"), RO_PRICE_BALANCED), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleGanonBossKey"), RO_GANON_BOSS_KEY_LACS_REWARDS), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleKeyRings"), RO_KEYRINGS_COUNT), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleKokiriSword"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleOcarinas"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleScrubs"), RO_SCRUBS_ALL), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ScrubsPrice"), RO_PRICE_FIXED), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ScrubsFixedPrice"), 10), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SkipChildStealth"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SkipChildZelda"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SkipEponaRace"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SkipScarecrowsSong"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SkipTowerEscape"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingConsumables"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingMapsCompasses"), RO_DUNGEON_ITEM_LOC_STARTWITH), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingOcarina"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SunlightArrows"), 1), -}; - -const std::vector spockRaceNoLogicPresetEntries = { - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("AdultMasks"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MinimumFishWeightAdult"), 6), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("AssignableTunicsAndBoots"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MinimumFishWeightChild"), 3), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("ClimbSpeed"), 4), - PRESET_ENTRY_S32(CVAR_COSMETIC("Goron.NeckLength"), 1000), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("CreditsFix"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("CustomizeFishing"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DampeAllNight"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DayGravePull"), 1), - PRESET_ENTRY_S32(CVAR_AUDIO("DisableNaviCallAudio"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DpadNoDropOcarinaInput"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("EquipmentCanBeRemoved"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastBoomerang"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastChests"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastDrops"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastFarores"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastOcarinaPlayback"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FasterBlockPush"), 5), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FasterHeavyBlockLift"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FishNeverEscape"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("ForgeTime"), 0), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("GoronPot"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("GuaranteeFishingBite"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InjectItemCounts.GoldSkulltula"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InjectItemCounts.HeartPiece"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InjectItemCounts.HeartContainer"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InstantFishing"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InstantPutaway"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MMBunnyHood"), BUNNY_HOOD_FAST), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MarketSneak"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MaskSelect"), 1), - PRESET_ENTRY_FLOAT(CVAR_ENHANCEMENT("MweepSpeed"), 5.0f), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("NoForcedNavi"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("NoInputForCredits"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("PauseAnyCursor"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("10GSHint"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("20GSHint"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("30GSHint"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("40GSHint"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("50GSHint"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("AllLocationsReachable"), 0), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("BlueFireArrows"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("BombchuBag"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("BossKeysanity"), RO_DUNGEON_ITEM_LOC_ANYWHERE), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("CompleteMaskQuest"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("CuccosToReturn"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("DampeHint"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("DoorOfTime"), RO_DOOROFTIME_OPEN), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("EnableBombchuDrops"), 1), - PRESET_ENTRY_CPP_STRING(CVAR_RANDOMIZER_SETTING("ExcludedLocations"), FormatLocations( - { RC_MARKET_10_BIG_POES, RC_KAK_40_GOLD_SKULLTULA_REWARD, RC_KAK_50_GOLD_SKULLTULA_REWARD, RC_ZR_FROGS_OCARINA_GAME })), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ClosedForest"), RO_CLOSED_FOREST_OFF), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("FullWallets"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("GanonTrial"), RO_GANONS_TRIALS_SKIP), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("FortressCarpenters"), RO_GF_CARPENTERS_FAST), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("GerudoKeys"), RO_GERUDO_KEYS_ANYWHERE), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("GregHint"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("GsExpectSunsSong"), 0), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("KakarikoGate"), RO_KAK_GATE_OPEN), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("Keysanity"), RO_DUNGEON_ITEM_LOC_ANYWHERE), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("LacsRewardCount"), 5), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("LogicRules"), RO_LOGIC_NO_LOGIC), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("RainbowBridge"), RO_BRIDGE_GREG), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ScrubText"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("IncludeTycoonWallet"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("Shopsanity"), RO_SHOPSANITY_RANDOM), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShopsanityPrices"), RO_PRICE_BALANCED), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleAdultTrade"), 0), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleMerchants"), RO_SHUFFLE_MERCHANTS_BEANS_ONLY), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleMerchantPrices"), RO_PRICE_VANILLA), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleGanonBossKey"), RO_GANON_BOSS_KEY_LACS_REWARDS), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleGerudoToken"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleKeyRings"), RO_KEYRINGS_COUNT), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleKokiriSword"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleOcarinas"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleScrubs"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleSongs"), RO_SONG_SHUFFLE_ANYWHERE), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleTokens"), RO_TOKENSANITY_ALL), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SkipChildStealth"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SkipChildZelda"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SkipEponaRace"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SkipScarecrowsSong"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SkipTowerEscape"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingConsumables"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingMapsCompasses"), RO_DUNGEON_ITEM_LOC_STARTWITH), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingOcarina"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SunlightArrows"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SeparateArrows"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InstantScarecrow"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SkulltulaFreeze"), 1), -}; - -const std::vector s6PresetEntries = { - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("ChestSizeAndTextureMatchContents"), CSMC_BOTH), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastChests"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MMBunnyHood"), BUNNY_HOOD_FAST), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("AdultMasks"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("BigPoeTargetCount"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("CuccosToReturn"), 4), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("DoorOfTime"), RO_DOOROFTIME_OPEN), - PRESET_ENTRY_CPP_STRING(CVAR_RANDOMIZER_SETTING("ExcludedLocations"), FormatLocations({ RC_DEKU_THEATER_MASK_OF_TRUTH })), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ClosedForest"), RO_CLOSED_FOREST_DEKU_ONLY), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("GanonTrial"), RO_GANONS_TRIALS_SKIP), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("FortressCarpenters"), RO_GF_CARPENTERS_FAST), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("IceTraps"), RO_ICE_TRAPS_OFF), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("KakarikoGate"), RO_KAK_GATE_OPEN), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("MedallionCount"), 6), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("MQDungeons"), RO_MQ_DUNGEONS_NONE), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("RainbowBridge"), RO_BRIDGE_MEDALLIONS), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleAdultTrade"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleDungeonReward"), RO_DUNGEON_REWARDS_END_OF_DUNGEON), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleGanonBossKey"), RO_GANON_BOSS_KEY_STARTWITH), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleKokiriSword"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleOverworldSpawns"), RO_GENERIC_ON), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SkipChildStealth"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SkipChildZelda"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SkipEponaRace"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SkipTowerEscape"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SleepingWaterfall"), RO_WATERFALL_CLOSED), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingAge"), RO_AGE_RANDOM), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingConsumables"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingDekuShield"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingMapsCompasses"), RO_DUNGEON_ITEM_LOC_STARTWITH), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingOcarina"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ZorasFountain"), RO_ZF_CLOSED), -}; - -const std::vector hellModePresetEntries = { - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("ChestSizeAndTextureMatchContents"), CSMC_BOTH), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastChests"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MMBunnyHood"), BUNNY_HOOD_FAST), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("AdultMasks"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("BigPoeTargetCount"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("BlueFireArrows"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("BossKeysanity"), RO_DUNGEON_ITEM_LOC_ANYWHERE), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("CompleteMaskQuest"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("CuccosToReturn"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("DoorOfTime"), RO_DOOROFTIME_OPEN), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("EnableBombchuDrops"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ClosedForest"), RO_CLOSED_FOREST_OFF), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("GanonTrial"), RO_GANONS_TRIALS_SET_NUMBER), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("GanonTrialCount"), 6), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("GerudoKeys"), RO_GERUDO_KEYS_ANYWHERE), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("GsExpectSunsSong"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("IceTraps"), RO_ICE_TRAPS_ONSLAUGHT), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ItemPool"), RO_ITEM_POOL_MINIMAL), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("KakarikoGate"), RO_KAK_GATE_OPEN), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("Keysanity"), RO_DUNGEON_ITEM_LOC_ANYWHERE), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("LinksPocket"), RO_LINKS_POCKET_NOTHING), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("MQDungeons"), RO_MQ_DUNGEONS_RANDOM_NUMBER), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("RainbowBridge"), RO_BRIDGE_DUNGEON_REWARDS), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("IncludeTycoonWallet"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("Shopsanity"), RO_SHOPSANITY_SPECIFIC_COUNT), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShopsanityCount"), RO_SHOPSANITY_COUNT_FOUR_ITEMS), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShopsanityPrices"), RO_PRICE_RANGE), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShopsanityPriceRange1"), 0), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShopsanityPriceRange2"), 999), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleAdultTrade"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleMerchants"), RO_SHUFFLE_MERCHANTS_BEANS_ONLY), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleMerchantPrices"), RO_PRICE_VANILLA), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleCows"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleDungeonReward"), RO_DUNGEON_REWARDS_ANYWHERE), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleFrogSongRupees"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleGanonBossKey"), RO_GANON_BOSS_KEY_LACS_DUNGEONS), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleGerudoToken"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleKeyRings"), RO_KEYRINGS_RANDOM), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleKokiriSword"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleMasterSword"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleOcarinas"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleScrubs"), RO_SCRUBS_ALL), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ScrubsPrice"), RO_PRICE_CHEAP_BALANCED), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleSongs"), RO_SONG_SHUFFLE_ANYWHERE), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleTokens"), RO_TOKENSANITY_ALL), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleWeirdEgg"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SkipChildStealth"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SkipEponaRace"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SkipScarecrowsSong"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SkipTowerEscape"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SleepingWaterfall"), RO_WATERFALL_OPEN), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingAge"), RO_AGE_RANDOM), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingMapsCompasses"), RO_DUNGEON_ITEM_LOC_ANYWHERE), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SunlightArrows"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ZorasFountain"), RO_ZF_OPEN), -}; - -const std::vector BenchmarkPresetEntries = { - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ClosedForest"), RO_CLOSED_FOREST_DEKU_ONLY), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("KakarikoGate"), RO_KAK_GATE_OPEN), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("DoorOfTime"), RO_DOOROFTIME_SONGONLY), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SleepingWaterfall"), RO_WATERFALL_CLOSED), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ZorasFountain"), RO_ZF_CLOSED), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("FortressCarpenters"), RO_GF_CARPENTERS_NORMAL), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("RainbowBridge"), RO_BRIDGE_DUNGEON_REWARDS), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("RewardCount"), 5), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("BridgeRewardOptions"), RO_BRIDGE_GREG_REWARD), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("GanonTrial"), RO_GANONS_TRIALS_SET_NUMBER), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("GanonTrialCount"), 6), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingAge"), RO_AGE_RANDOM), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleDungeonsEntrances"), RO_DUNGEON_ENTRANCE_SHUFFLE_ON), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleBossEntrances"), RO_BOSS_ROOM_ENTRANCE_SHUFFLE_FULL), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleOverworldEntrances"), RO_GENERIC_OFF), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleInteriorsEntrances"), RO_INTERIOR_ENTRANCE_SHUFFLE_OFF), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleGrottosEntrances"), RO_GENERIC_ON), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleWarpSongs"), RO_GENERIC_ON), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleOverworldSpawns"), RO_GENERIC_ON), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("MixedEntrances"), RO_GENERIC_OFF), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("DecoupleEntrances"), RO_GENERIC_OFF), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("BombchusInLogic"), RO_GENERIC_ON), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("EnableBombchuDrops"), RO_GENERIC_ON), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("TriforceHunt"), RO_GENERIC_OFF), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("MQDungeons"), RO_MQ_DUNGEONS_RANDOM_NUMBER), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("MQDungeonsSelection"), RO_GENERIC_OFF), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleDungeonReward"), RO_DUNGEON_REWARDS_END_OF_DUNGEON), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("LinksPocket"), RO_LINKS_POCKET_DUNGEON_REWARD), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleSongs"), RO_SONG_SHUFFLE_ANYWHERE), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("Shopsanity"), RO_SHOPSANITY_SPECIFIC_COUNT), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShopsanityCount"), RO_SHOPSANITY_COUNT_FOUR_ITEMS), - //RANDOTODO add refactored price/scrub/merchant settings - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleTokens"), RO_TOKENSANITY_OFF), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleBeehives"), RO_GENERIC_ON), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleCows"), RO_GENERIC_ON), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleKokiriSword"), RO_GENERIC_ON), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleMasterSword"), RO_GENERIC_ON), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleChildWallet"), RO_GENERIC_ON), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleOcarinas"), RO_GENERIC_ON), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleOcarinaButtons"), RO_GENERIC_OFF), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleSwim"), RO_GENERIC_ON), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleGerudoToken"), RO_GENERIC_ON), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleFrogSongRupees"), RO_GENERIC_ON), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleAdultTrade"), RO_GENERIC_ON), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("Shuffle100GSReward"), RO_GENERIC_OFF), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleBossSouls"), RO_BOSS_SOULS_OFF), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleDekuStickBag"), RO_GENERIC_ON), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleDekuNutBag"), RO_GENERIC_ON), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("Fishsanity"), RO_FISHSANITY_BOTH), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("FishsanityAgeSplit"), RO_GENERIC_OFF), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingMapsCompasses"), RO_DUNGEON_ITEM_LOC_OWN_DUNGEON), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("GerudoKeys"), RO_GERUDO_KEYS_ANYWHERE), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("BossKeysanity"), RO_DUNGEON_ITEM_LOC_OWN_DUNGEON), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleGanonBossKey"), RO_GANON_BOSS_KEY_LACS_MEDALLIONS), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("LacsMedallionCount"), 6), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleKeyRings"), RO_KEYRINGS_OFF), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SkipChildZelda"), RO_GENERIC_ON), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SkipEponaRace"), RO_GENERIC_ON), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SkipScarecrowsSong"), RO_GENERIC_ON), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("BigPoeTargetCount"), 1), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("CuccosToReturn"), 4), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("CompleteMaskQuest"), RO_GENERIC_ON), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("GossipStoneHints"), RO_GOSSIP_STONES_NEED_NOTHING), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("HintClarity"), RO_HINT_CLARITY_CLEAR), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("HintDistribution"), RO_HINT_DIST_STRONG), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("AltarHint"), RO_GENERIC_ON), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("GanondorfHint"), RO_GENERIC_ON), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SheikLAHint"), RO_GENERIC_ON), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("DampeHint"), RO_GENERIC_OFF), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("GregHint"), RO_GENERIC_ON), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SariaHint"), RO_GENERIC_OFF), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("FrogsHint"), RO_GENERIC_ON), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("OoTHint"), RO_GENERIC_ON), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("BiggoronHint"), RO_GENERIC_ON), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("BigPoesHint"), RO_GENERIC_OFF), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ChickensHint"), RO_GENERIC_ON), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("MalonHint"), RO_GENERIC_ON), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("HBAHint"), RO_GENERIC_OFF), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("WarpSongText"), RO_GENERIC_ON), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ScrubText"), RO_GENERIC_ON), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("10GSHint"), RO_GENERIC_ON), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("20GSHint"), RO_GENERIC_ON), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("30GSHint"), RO_GENERIC_ON), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("40GSHint"), RO_GENERIC_ON), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("50GSHint"), RO_GENERIC_ON), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("MaskShopHint"), RO_GENERIC_ON), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("BlueFireArrows"), RO_GENERIC_ON), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SunlightArrows"), RO_GENERIC_ON), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("InfiniteUpgrades"), RO_INF_UPGRADES_PROGRESSIVE), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SkeletonKey"), RO_GENERIC_OFF), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ItemPool"), RO_ITEM_POOL_BALANCED), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("IceTraps"), RO_ICE_TRAPS_NORMAL), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingOcarina"), RO_STARTING_OCARINA_FAIRY), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingDekuShield"), RO_GENERIC_ON), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingKokiriSword"), RO_GENERIC_OFF), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingMasterSword"), RO_GENERIC_OFF), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingConsumables"), RO_GENERIC_ON), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("FullWallets"), RO_GENERIC_ON), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingZeldasLullaby"), RO_GENERIC_OFF), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingEponasSong"), RO_GENERIC_OFF), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingSariasSong"), RO_GENERIC_OFF), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingSunsSong"), RO_GENERIC_OFF), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingSongOfTime"), RO_GENERIC_OFF), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingSongOfStorms"), RO_GENERIC_OFF), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingMinuetOfForest"), RO_GENERIC_OFF), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingBoleroOfFire"), RO_GENERIC_OFF), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingSerenadeOfWater"), RO_GENERIC_OFF), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingRequiemOfSpirit"), RO_GENERIC_OFF), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingNocturneOfShadow"), RO_GENERIC_OFF), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingPreludeOfLight"), RO_GENERIC_OFF), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingSkulltulaToken"), 0), - PRESET_ENTRY_S32("gRandomizeStartingHearts", 2), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("LogicRules"), RO_LOGIC_GLITCHLESS), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("AllLocationsReachable"), RO_GENERIC_ON), - PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("GsExpectSunsSong"), RO_GENERIC_ON), -}; - -typedef struct PresetDefinition { - const char* label; - const char* description; - std::vector entries; -} PresetDefinition; - -typedef struct PresetTypeDefinition { - std::vector blocksToClear; - std::map presets; -} PresetTypeDefinition; - -const std::map presetTypes = { - { PRESET_TYPE_ENHANCEMENTS, { { CVAR_PREFIX_ENHANCEMENT, CVAR_PREFIX_CHEAT }, { - { ENHANCEMENT_PRESET_DEFAULT, { - "Default", - "Reset all options to their default values.", - {}, - } }, - { ENHANCEMENT_PRESET_VANILLA_PLUS, { - "Vanilla Plus", - "Adds Quality of Life features that enhance your experience, but don't alter gameplay. Recommended for a first playthrough of OoT.", - vanillaPlusPresetEntries, - } }, - { ENHANCEMENT_PRESET_ENHANCED, { - "Enhanced", - "The \"Vanilla Plus\" preset, but with more quality of life enhancements that might alter gameplay slightly. Recommended for returning players.", - enhancedPresetEntries - } }, - { ENHANCEMENT_PRESET_RANDOMIZER, { - "Randomizer", - "The \"Enhanced\" preset, plus any other enhancements that are recommended for playing Randomizer.", - randomizerPresetEntries - } }, - } } }, - { PRESET_TYPE_RANDOMIZER, { { CVAR_PREFIX_RANDOMIZER_SETTING, CVAR_PREFIX_RANDOMIZER_ENHANCEMENT }, { - { RANDOMIZER_PRESET_DEFAULT, { - "Default", - "Reset all options to their default values.", - {}, - } }, - { RANDOMIZER_PRESET_SPOCK_RACE, { - "Spock Race", - "Race preset used for the official Ship of Harkinian race on June 3rd 2023. The following settings are notable:\n" \ - "- Rainbow Bridge is set to Greg\n" \ - "- Ganon's Boss Key is 5 dungeon rewards\n" \ - "- Shopsanity and Scrubsanity enabled\n" \ - "- All locations reachable is off\n", \ - spockRacePresetEntries, - } }, - { RANDOMIZER_PRESET_SPOCK_RACE_NO_LOGIC, { - "Spock Race - No Logic", - "No Logic Race preset used for official Ship of Harkinian No Logic races. The following settings are " - "notable:\n" - "- Rainbow Bridge is set to Greg\n" - "- Ganon's Boss Key is 5 dungeon rewards\n" - "- Shopsanity and Scrubsanity enabled\n" - "- All locations reachable is off\n", - spockRaceNoLogicPresetEntries, - } }, - { RANDOMIZER_PRESET_S6, { - "S6 Tournament (Adapted)", - "Matches OOTR S6 tournament settings as close as we can get with the options available in SoH. The following differences are notable:\n" \ - "- Both child and adult overworld spawns are randomized\n" \ - "- Dungeon rewards are shuffled at the end of dungeons, rather than at the end of their own dungeon\n" \ - "- Full adult trade sequence is shuffled instead of the selected 4\n" \ - "- Hint distribution no \"tournament\" mode, falling back to balanced", - s6PresetEntries, - } }, - { RANDOMIZER_PRESET_HELL_MODE, { - "Hell Mode", - "All settings maxed but still using glitchless logic. Expect pain.", - hellModePresetEntries - } }, - { RANDOMIZER_PRESET_BENCHMARK, { - "Benchmark", - "Used for benchmarking the logic.", - BenchmarkPresetEntries - } }, - } } } -}; diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index 4b88d7e2a78..081df968c5e 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer.cpp @@ -17,7 +17,7 @@ #include #include "../custom-message/CustomMessageTypes.h" #include "../item-tables/ItemTableManager.h" -#include "../presets.h" +#include "../Presets/Presets.h" #include "../../../src/overlays/actors/ovl_En_GirlA/z_en_girla.h" #include #include "randomizer_check_objects.h" @@ -1924,11 +1924,10 @@ bool GenerateRandomizer(std::string seed /*= ""*/) { static const std::unordered_map randomizerPresetList = { { RANDOMIZER_PRESET_DEFAULT, "Default" }, - { RANDOMIZER_PRESET_SPOCK_RACE, "Spock Race" }, - { RANDOMIZER_PRESET_SPOCK_RACE_NO_LOGIC, "Spock Race (No Logic)" }, - { RANDOMIZER_PRESET_S6, "S6" }, - { RANDOMIZER_PRESET_HELL_MODE, "Hell Mode" }, - { RANDOMIZER_PRESET_BENCHMARK, "Benchmark" } + { RANDOMIZER_PRESET_BEGINNER, "Beginner" }, + { RANDOMIZER_PRESET_STANDARD, "Standard" }, + { RANDOMIZER_PRESET_ADVANCED, "Advanced" }, + { RANDOMIZER_PRESET_HELL_MODE, "Hell Mode" } }; static int32_t randomizerPresetSelected = RANDOMIZER_PRESET_DEFAULT; diff --git a/soh/soh/Enhancements/randomizer/settings.cpp b/soh/soh/Enhancements/randomizer/settings.cpp index 2e6a61e8911..f001a7cb780 100644 --- a/soh/soh/Enhancements/randomizer/settings.cpp +++ b/soh/soh/Enhancements/randomizer/settings.cpp @@ -1268,7 +1268,8 @@ void Settings::UpdateOptionProperties() { mOptions[RSK_GANONS_TRIALS].Enable(); mOptions[RSK_TRIAL_COUNT].Enable(); // Only show the trial count slider if Trials is set to Set Number - if (CVarGetInteger(CVAR_RANDOMIZER_SETTING("GanonTrial"), RO_GANONS_TRIALS_SKIP) == RO_GANONS_TRIALS_SET_NUMBER) { + if (CVarGetInteger(CVAR_RANDOMIZER_SETTING("GanonTrial"), RO_GANONS_TRIALS_SET_NUMBER) == + RO_GANONS_TRIALS_SET_NUMBER) { mOptions[RSK_GANONS_TRIALS].RemoveFlag(IMFLAG_SEPARATOR_BOTTOM); mOptions[RSK_TRIAL_COUNT].Unhide(); } else { diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp index 792bf0639ac..ee98a70b348 100644 --- a/soh/soh/OTRGlobals.cpp +++ b/soh/soh/OTRGlobals.cpp @@ -43,7 +43,7 @@ #include "window/gui/resource/Font.h" #include #include "Enhancements/custom-message/CustomMessageManager.h" -#include "Enhancements/presets.h" +#include "Enhancements/Presets/Presets.h" #include "util.h" #include diff --git a/soh/soh/SohGui/SohGui.cpp b/soh/soh/SohGui/SohGui.cpp index 40996fc5981..222df054f0a 100644 --- a/soh/soh/SohGui/SohGui.cpp +++ b/soh/soh/SohGui/SohGui.cpp @@ -25,7 +25,7 @@ #include "include/z64audio.h" #include "soh/SaveManager.h" #include "soh/OTRGlobals.h" -#include "soh/Enhancements/presets.h" +#include "soh/Enhancements/Presets/Presets.h" #include "soh/resource/type/Skeleton.h" #include "libultraship/libultraship.h" diff --git a/soh/soh/SohGui/SohMenu.h b/soh/soh/SohGui/SohMenu.h index 9b65e2e7967..bb4fc7b0f6c 100644 --- a/soh/soh/SohGui/SohMenu.h +++ b/soh/soh/SohGui/SohMenu.h @@ -7,7 +7,7 @@ #include "graphic/Fast3D/gfx_rendering_api.h" #include "soh/cvar_prefixes.h" #include "soh/Enhancements/enhancementTypes.h" -#include "soh/Enhancements/presets.h" +#include "soh/Enhancements/Presets/Presets.h" extern "C" { #include "z64.h" diff --git a/soh/soh/SohGui/SohMenuBar.cpp b/soh/soh/SohGui/SohMenuBar.cpp index ed63fea7b63..e7633f0f223 100644 --- a/soh/soh/SohGui/SohMenuBar.cpp +++ b/soh/soh/SohGui/SohMenuBar.cpp @@ -14,7 +14,7 @@ #include "functions.h" #include "variables.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/presets.h" +#include "soh/Enhancements/Presets/Presets.h" #include "soh/Enhancements/mods.h" #include "soh/Notification/Notification.h" #include "soh/Enhancements/cosmetics/authenticGfxPatches.h" diff --git a/soh/soh/SohGui/SohMenuEnhancements.cpp b/soh/soh/SohGui/SohMenuEnhancements.cpp index 85cbc673494..3ad6b40647f 100644 --- a/soh/soh/SohGui/SohMenuEnhancements.cpp +++ b/soh/soh/SohGui/SohMenuEnhancements.cpp @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include static std::string comboboxTooltip = ""; @@ -883,16 +883,16 @@ void SohMenu::AddMenuEnhancements() { AddWidget(path, "Fix Camera Drift", WIDGET_CVAR_CHECKBOX) .CVar(CVAR_ENHANCEMENT("FixCameraDrift")) .Options(CheckboxOptions().Tooltip( - "Fixes camera slightly drifting to the left when standing still due to a math error.")); + "Fixes camera slightly drifting to the left when standing still due to a math error. May impact certain glitches.")); AddWidget(path, "Fix Camera Swing", WIDGET_CVAR_CHECKBOX) .CVar(CVAR_ENHANCEMENT("FixCameraSwing")) .Options(CheckboxOptions().Tooltip( "Fixes camera getting stuck on collision when standing still. Also fixes slight shift " - "back in camera when Link stops moving.")); + "back in camera when Link stops moving. May impact certain glitches.")); AddWidget(path, "Fix Hanging Ledge Swing Rate", WIDGET_CVAR_CHECKBOX) .CVar(CVAR_ENHANCEMENT("FixHangingLedgeSwingRate")) .Options(CheckboxOptions().Tooltip( - "Fixes camera swing rate when the player falls off a ledge and the camera swings around.")); + "Fixes camera swing rate when the player falls off a ledge and the camera swings around. May impact certain glitches.")); path.column = SECTION_COLUMN_2; AddWidget(path, "Graphical Fixes", WIDGET_SEPARATOR_TEXT); @@ -1360,6 +1360,11 @@ void SohMenu::AddMenuEnhancements() { .PreFunc(fishingDisabledFunc) .Options( CheckboxOptions().Tooltip("The Pond Owner will not ask to confirm if you want to keep a smaller Fish.")); + AddWidget(path, "All Fish are Hyrule Loaches", WIDGET_CVAR_CHECKBOX) + .CVar(CVAR_ENHANCEMENT("AllHyruleLoaches")) + .PreFunc(fishingDisabledFunc) + .Options(CheckboxOptions().Tooltip("Every fish in the Fishing Pond will always be a Hyrule Loach.\n\n" + "NOTE: This requires reloading the area.")); AddWidget(path, "Child Minimum Weight: %d lbs.", WIDGET_CVAR_SLIDER_INT) .CVar(CVAR_ENHANCEMENT("MinimumFishWeightChild")) .PreFunc(fishingDisabledFunc) @@ -1370,11 +1375,6 @@ void SohMenu::AddMenuEnhancements() { .PreFunc(fishingDisabledFunc) .Options(IntSliderOptions().Min(6).Max(13).DefaultValue(13).Format("%d lbs.").Tooltip( "The minimum weight for the unique fishing reward as an Adult.")); - AddWidget(path, "All Fish are Hyrule Loaches", WIDGET_CVAR_SLIDER_INT) - .CVar(CVAR_ENHANCEMENT("AllHyruleLoaches")) - .PreFunc(fishingDisabledFunc) - .Options(IntSliderOptions().Tooltip("Every fish in the Fishing Pond will always be a Hyrule Loach.\n\n" - "NOTE: This requires reloading the area.")); // Extra Modes path.sidebarName = "Extra Modes"; diff --git a/soh/soh/SohGui/SohMenuSettings.cpp b/soh/soh/SohGui/SohMenuSettings.cpp index 20ce9ff5049..eaa739afcff 100644 --- a/soh/soh/SohGui/SohMenuSettings.cpp +++ b/soh/soh/SohGui/SohMenuSettings.cpp @@ -113,7 +113,7 @@ void SohMenu::AddMenuSettings() { AddWidget(path, "Boot", WIDGET_SEPARATOR_TEXT); AddWidget(path, "Boot Sequence", WIDGET_CVAR_COMBOBOX) - .CVar(CVAR_ENHANCEMENT("BootSequence")) + .CVar(CVAR_SETTING("BootSequence")) .Options(ComboboxOptions() .DefaultIndex(BOOTSEQUENCE_DEFAULT) .LabelPosition(LabelPositions::Far) From 084627b8af862404b8df4288efab44301b2f466b Mon Sep 17 00:00:00 2001 From: Christopher Leggett Date: Mon, 24 Mar 2025 17:58:56 -0400 Subject: [PATCH 11/12] Force excluded locations update when preset is applied. (#5205) * Force excluded locations update when preset is applied. * Apply same fix for tricks tab * Address review comment --- soh/soh/Enhancements/randomizer/randomizer.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index 081df968c5e..8809d8691d8 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer.cpp @@ -1937,6 +1937,8 @@ void RandomizerSettingsWindow::DrawElement() { generated = 0; randoThread.join(); } + static bool locationsTabOpen = false; + static bool tricksTabOpen = false; bool disableEditingRandoSettings = CVarGetInteger(CVAR_GENERAL("RandoGenerating"), 0) || CVarGetInteger(CVAR_GENERAL("OnFileSelectNameEntry"), 0); ImGui::BeginDisabled(CVarGetInteger(CVAR_SETTING("DisableChanges"), 0) || disableEditingRandoSettings); const PresetTypeDefinition presetTypeDef = presetTypes.at(PRESET_TYPE_RANDOMIZER); @@ -1971,6 +1973,9 @@ void RandomizerSettingsWindow::DrawElement() { CVarSetInteger(presetTypeCvar.c_str(), randomizerPresetSelected); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); mSettings->UpdateOptionProperties(); + // force excluded location list and trick list update if tab is open. + locationsTabOpen = false; + tricksTabOpen = false; } UIWidgets::Spacer(0); @@ -2060,7 +2065,6 @@ void RandomizerSettingsWindow::DrawElement() { ImGui::EndDisabled(); ImGui::BeginDisabled(CVarGetInteger(CVAR_RANDOMIZER_SETTING("LogicRules"), RO_LOGIC_GLITCHLESS) == RO_LOGIC_VANILLA); - static bool locationsTabOpen = false; if (ImGui::BeginTabItem("Locations")) { ImGui::PushStyleVar(ImGuiStyleVar_CellPadding, cellPadding); if (!locationsTabOpen) { @@ -2189,7 +2193,6 @@ void RandomizerSettingsWindow::DrawElement() { } ImGui::EndDisabled(); - static bool tricksTabOpen = false; if (ImGui::BeginTabItem("Tricks/Glitches")) { if (!tricksTabOpen) { tricksTabOpen = true; From e96f91ca4cec3d112077ce9551324c654e1e7377 Mon Sep 17 00:00:00 2001 From: Nicholas Estelami Date: Tue, 25 Mar 2025 23:11:50 -0400 Subject: [PATCH 12/12] Setup gInterpolationIndex --- soh/soh/OTRGlobals.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp index 28d5fb868b5..83ef576bc02 100644 --- a/soh/soh/OTRGlobals.cpp +++ b/soh/soh/OTRGlobals.cpp @@ -1419,8 +1419,11 @@ void RunCommands(Gfx* Commands, const std::vector UIWidgets::Colors themeColor = static_cast(CVarGetInteger(CVAR_SETTING("Menu.Theme"), UIWidgets::Colors::LightBlue)); ImGui::PushStyleColor(ImGuiCol_TitleBgActive, UIWidgets::ColorValues.at(themeColor)); + gInterpolationIndex = 0; + for (const auto& m : mtx_replacements) { wnd->DrawAndRunGraphicsCommands(Commands, m); + gInterpolationIndex++; } ImGui::PopStyleColor(); }