From 38031e2545c25bc1483c66287dbb10150ade0be6 Mon Sep 17 00:00:00 2001 From: gymnast86 Date: Fri, 8 May 2026 16:00:42 -0700 Subject: [PATCH] set all letters obtained when skip minor cutscenes is on --- include/d/d_com_inf_game.h | 9 +++++++++ include/d/d_save.h | 5 +++++ src/d/d_com_inf_game.cpp | 10 +++++----- src/dusk/randomizer/game/randomizer_context.cpp | 15 +++++++++------ src/dusk/randomizer/game/randomizer_context.hpp | 9 ++++++--- .../randomizer/generator/data/settings_list.yaml | 1 + 6 files changed, 35 insertions(+), 14 deletions(-) diff --git a/include/d/d_com_inf_game.h b/include/d/d_com_inf_game.h index 3bf686f37c..5cb2c6e67d 100644 --- a/include/d/d_com_inf_game.h +++ b/include/d/d_com_inf_game.h @@ -1853,7 +1853,16 @@ inline u8 dComIfGs_getGetNumber(int i_no) { inline void dComIfGs_setGetNumber(int i_no, u8 i_value) { g_dComIfG_gameInfo.info.getPlayer().getLetterInfo().setGetNumber(i_no, i_value); } +#if TARGET_PC +// For rando +inline void dComIfGs_setAllLetterGet() { + g_dComIfG_gameInfo.info.getPlayer().getLetterInfo().setAllLetterGet(); +} +inline void dComIfGs_setAllLetterRead() { + g_dComIfG_gameInfo.info.getPlayer().getLetterInfo().setAllLetterRead(); +} +#endif inline void dComIfGs_addFishNum(u8 param_0) { g_dComIfG_gameInfo.info.getPlayer().getFishingInfo().addFishCount(param_0); } diff --git a/include/d/d_save.h b/include/d/d_save.h index b7cfdd2e2d..5e35175d25 100644 --- a/include/d/d_save.h +++ b/include/d/d_save.h @@ -481,6 +481,11 @@ public: int isLetterReadFlag(int i_no) const; u8 getGetNumber(int i_no) { return mGetNumber[i_no]; } void setGetNumber(int i_no, u8 i_value) { mGetNumber[i_no] = i_value; } +#if TARGET_PC + // For rando + void setAllLetterGet() { mLetterGetFlags[0] |= 0xFFFF;} + void setAllLetterRead() { mLetterReadFlags[0] |= 0xFFFF;} +#endif /* 0x00 */ BE(u32) mLetterGetFlags[2]; /* 0x08 */ BE(u32) mLetterReadFlags[2]; diff --git a/src/d/d_com_inf_game.cpp b/src/d/d_com_inf_game.cpp index 99a7563cbd..983643907e 100644 --- a/src/d/d_com_inf_game.cpp +++ b/src/d/d_com_inf_game.cpp @@ -2923,11 +2923,11 @@ void dComIfGs_setupRandomizerSave() { execItemGet(dItemNo_Randomizer_DROP_CONTAINER03_e); } - // if (skipMinorCutscenes()) - // { - // dComIfGs_setAllLetterGet(); - // dComIfGs_setAllLetterRead(); - // } + if (randoData.mSettings[RandomizerContext::SKIP_MINOR_CUTSCENES] == RandomizerContext::ON) + { + dComIfGs_setAllLetterGet(); + dComIfGs_setAllLetterRead(); + } if (dComIfGs_isEventBit(MIDNAS_DESPERATE_HOUR_COMPLETED)) { diff --git a/src/dusk/randomizer/game/randomizer_context.cpp b/src/dusk/randomizer/game/randomizer_context.cpp index 393f4073f9..21de77b09d 100644 --- a/src/dusk/randomizer/game/randomizer_context.cpp +++ b/src/dusk/randomizer/game/randomizer_context.cpp @@ -258,8 +258,8 @@ std::string RandomizerContext::GetSeedDataPath() const { return std::string(SDL_GetPrefPath(dusk::OrgName, dusk::AppName)) + "randomizer/seeds/" + this->mHash + "/seed.dat"; } -s32 RandomizerContext::settingToEnum(const std::string& settingName) { - static const std::unordered_map nameToEnum = { +int RandomizerContext::SettingToEnum(const std::string& settingName) { + static const std::unordered_map nameToEnum = { {"Hyrule Barrier Dungeons", HYRULE_BARRIER_DUNGEONS}, {"Hyrule Barrier Requirements", HYRULE_BARRIER_REQUIREMENTS}, {"Hyrule Barrier Fused Shadows", HYRULE_BARRIER_FUSED_SHADOWS}, @@ -273,6 +273,7 @@ s32 RandomizerContext::settingToEnum(const std::string& settingName) { {"Hyrule Castle Big Key Poe Souls", HYRULE_BIG_KEY_POE_SOULS}, {"Hyrule Castle Big Key Hearts", HYRULE_BIG_KEY_HEARTS}, {"Palace of Twilight Requirements", PALACE_OF_TWILIGHT_REQUIREMENTS}, + {"Skip Minor Cutscenes", SKIP_MINOR_CUTSCENES}, }; if (nameToEnum.contains(settingName)) { @@ -282,8 +283,10 @@ s32 RandomizerContext::settingToEnum(const std::string& settingName) { return -1; } -s32 RandomizerContext::optionToEnum(const std::string& optionName) { - static const std::unordered_map nameToEnum = { +int RandomizerContext::OptionToEnum(const std::string& optionName) { + static const std::unordered_map nameToEnum = { + {"On", ON}, + {"Off", OFF}, {"None", NONE}, {"Vanilla", VANILLA}, {"Open", OPEN}, @@ -731,7 +734,7 @@ RandomizerContext WriteSeedData(const std::unique_ptrNeedInGame()) { - auto settingEnum = RandomizerContext::settingToEnum(setting); + auto settingEnum = RandomizerContext::SettingToEnum(setting); if (settingEnum == -1) { throw std::runtime_error("Setting \"" + setting + "\" does not have an associated enum value"); } @@ -741,7 +744,7 @@ RandomizerContext WriteSeedData(const std::unique_ptrOptionsAreNumbers()) { optionEnum = world->Setting(setting).GetCurrentOptionAsNumber(); } else { - optionEnum = RandomizerContext::optionToEnum(option); + optionEnum = RandomizerContext::OptionToEnum(option); } if (optionEnum == -1) { throw std::runtime_error("Option \"" + option + "\" for setting \"" + setting + "\" does not have an associated enum value"); diff --git a/src/dusk/randomizer/game/randomizer_context.hpp b/src/dusk/randomizer/game/randomizer_context.hpp index 718f3ced41..1f8ee08752 100644 --- a/src/dusk/randomizer/game/randomizer_context.hpp +++ b/src/dusk/randomizer/game/randomizer_context.hpp @@ -71,9 +71,12 @@ public: HYRULE_BIG_KEY_HEARTS, HYRULE_BIG_KEY_DUNGEONS, PALACE_OF_TWILIGHT_REQUIREMENTS, + SKIP_MINOR_CUTSCENES, }; enum Options { + ON, + OFF, NONE, VANILLA, OPEN, @@ -84,9 +87,9 @@ public: DUNGEONS, }; - static int settingToEnum(const std::string& settingName); + static int SettingToEnum(const std::string& settingName); - static int optionToEnum(const std::string& optionName); + static int OptionToEnum(const std::string& optionName); }; /* @@ -143,7 +146,7 @@ public: // Used to store an item id for a flow message override so that we can give the item // once the textbox is closed instead of when the message appears. This lines up - // more naturally with how the timing of how the game normally gives items and affects + // more naturally with the timing of when the game normally gives items and affects // things like the sound of the rupee counter going up. u8 mFlowMessageItemId{0}; }; diff --git a/src/dusk/randomizer/generator/data/settings_list.yaml b/src/dusk/randomizer/generator/data/settings_list.yaml index 3d25129826..f627e53250 100644 --- a/src/dusk/randomizer/generator/data/settings_list.yaml +++ b/src/dusk/randomizer/generator/data/settings_list.yaml @@ -316,6 +316,7 @@ - Name: Skip Minor Cutscenes Tracker Important: True + Need In Game: True Default Option: "Off" Options: - "Off": description