Actually fix issues with log settings (#4813)

* remove taking settings from a loaded spoiler instead of the imGUI settings

* actually fix most SpoilerLoad issues

* fix vanilla saves making future generations have so settings

* remove extra comment
This commit is contained in:
Pepper0ni 2025-01-06 06:34:51 +00:00 committed by GitHub
parent 2f8bb02502
commit cb738306d8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 81 additions and 88 deletions

View File

@ -1,7 +1,7 @@
#include "ShuffleFreestanding.h"
extern "C" {
#include "functions.h";
#include "functions.h"
extern PlayState* gPlayState;
}

View File

@ -1873,11 +1873,8 @@ void GenerateRandomizerImgui(std::string seed = "") {
CVarSetInteger(CVAR_GENERAL("RandoGenerating"), 1);
CVarSave();
auto ctx = Rando::Context::GetInstance();
/*RANDOTODO proper UI for selecting if a spoiler loaded should be used for settings
if (!ctx->IsSpoilerLoaded()) {
// We use the settings from the spoiler rather than CVars.
//RANDOTODO proper UI for selecting if a spoiler loaded should be used for settings
ctx->GetSettings()->SetAllFromCVar();
}*/
// todo: this efficently when we build out cvar array support
std::set<RandomizerCheck> excludedLocations;

View File

@ -2063,13 +2063,9 @@ void Settings::UpdateOptionProperties() {
void Settings::FinalizeSettings(const std::set<RandomizerCheck>& excludedLocations, const std::set<RandomizerTrick>& enabledTricks) {
const auto ctx = Rando::Context::GetInstance();
if (!ctx->IsSpoilerLoaded()) {
for (Option& option : mOptions) {
option.SetContextIndex(option.GetMenuOptionIndex());
}
// If we've loaded a spoiler file, the settings have already been populated, so we
// only need to do things like resolve the starting age or determine MQ dungeons.
// Any logic dependent on cvarSettings should go in this if statement
// if we skip child zelda, we start with zelda's letter, and malon starts
// at the ranch, so we should *not* shuffle the weird egg
@ -2125,7 +2121,6 @@ void Settings::FinalizeSettings(const std::set<RandomizerCheck>& excludedLocatio
mOptions[RSK_LINKS_POCKET].SetContextIndex(RO_LINKS_POCKET_DUNGEON_REWARD);
}
if (!ctx->IsSpoilerLoaded()) {
ctx->AddExcludedOptions();
for (const auto locationKey : ctx->everyPossibleLocation) {
if (const auto location = ctx->GetItemLocation(locationKey); excludedLocations.contains(location->GetRandomizerCheck())) {
@ -2139,7 +2134,6 @@ void Settings::FinalizeSettings(const std::set<RandomizerCheck>& excludedLocatio
for (const auto randomizerTrick : enabledTricks) {
mTrickOptions[randomizerTrick].SetContextIndex(1);
}
}
if (!mOptions[RSK_SHUFFLE_KOKIRI_SWORD]) {
if (mOptions[RSK_STARTING_KOKIRI_SWORD]) {
ctx->GetItemLocation(RC_KF_KOKIRI_SWORD_CHEST)->GetExcludedOption()->SetContextIndex(1);
@ -2158,7 +2152,7 @@ void Settings::FinalizeSettings(const std::set<RandomizerCheck>& excludedLocatio
}
}
}
}
if (mOptions[RSK_SHUFFLE_DEKU_STICK_BAG]) {
mOptions[RSK_STARTING_STICKS].SetContextIndex(false);

View File

@ -662,6 +662,8 @@ void SaveManager::Init() {
OTRGlobals::Instance->gRandoContext->ClearItemLocations();
}
}
auto ctx = Rando::Context::GetInstance();
ctx->GetSettings()->CreateOptions();
}
void SaveManager::InitMeta(int fileNum) {