mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-07-30 19:40:31 -07:00
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:
parent
2f8bb02502
commit
cb738306d8
4 changed files with 81 additions and 88 deletions
|
@ -1,7 +1,7 @@
|
||||||
#include "ShuffleFreestanding.h"
|
#include "ShuffleFreestanding.h"
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include "functions.h";
|
#include "functions.h"
|
||||||
extern PlayState* gPlayState;
|
extern PlayState* gPlayState;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1873,11 +1873,8 @@ void GenerateRandomizerImgui(std::string seed = "") {
|
||||||
CVarSetInteger(CVAR_GENERAL("RandoGenerating"), 1);
|
CVarSetInteger(CVAR_GENERAL("RandoGenerating"), 1);
|
||||||
CVarSave();
|
CVarSave();
|
||||||
auto ctx = Rando::Context::GetInstance();
|
auto ctx = Rando::Context::GetInstance();
|
||||||
/*RANDOTODO proper UI for selecting if a spoiler loaded should be used for settings
|
//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.
|
|
||||||
ctx->GetSettings()->SetAllFromCVar();
|
ctx->GetSettings()->SetAllFromCVar();
|
||||||
}*/
|
|
||||||
|
|
||||||
// todo: this efficently when we build out cvar array support
|
// todo: this efficently when we build out cvar array support
|
||||||
std::set<RandomizerCheck> excludedLocations;
|
std::set<RandomizerCheck> excludedLocations;
|
||||||
|
|
|
@ -2063,13 +2063,9 @@ void Settings::UpdateOptionProperties() {
|
||||||
|
|
||||||
void Settings::FinalizeSettings(const std::set<RandomizerCheck>& excludedLocations, const std::set<RandomizerTrick>& enabledTricks) {
|
void Settings::FinalizeSettings(const std::set<RandomizerCheck>& excludedLocations, const std::set<RandomizerTrick>& enabledTricks) {
|
||||||
const auto ctx = Rando::Context::GetInstance();
|
const auto ctx = Rando::Context::GetInstance();
|
||||||
if (!ctx->IsSpoilerLoaded()) {
|
|
||||||
for (Option& option : mOptions) {
|
for (Option& option : mOptions) {
|
||||||
option.SetContextIndex(option.GetMenuOptionIndex());
|
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
|
// 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
|
// 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);
|
mOptions[RSK_LINKS_POCKET].SetContextIndex(RO_LINKS_POCKET_DUNGEON_REWARD);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ctx->IsSpoilerLoaded()) {
|
|
||||||
ctx->AddExcludedOptions();
|
ctx->AddExcludedOptions();
|
||||||
for (const auto locationKey : ctx->everyPossibleLocation) {
|
for (const auto locationKey : ctx->everyPossibleLocation) {
|
||||||
if (const auto location = ctx->GetItemLocation(locationKey); excludedLocations.contains(location->GetRandomizerCheck())) {
|
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) {
|
for (const auto randomizerTrick : enabledTricks) {
|
||||||
mTrickOptions[randomizerTrick].SetContextIndex(1);
|
mTrickOptions[randomizerTrick].SetContextIndex(1);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (!mOptions[RSK_SHUFFLE_KOKIRI_SWORD]) {
|
if (!mOptions[RSK_SHUFFLE_KOKIRI_SWORD]) {
|
||||||
if (mOptions[RSK_STARTING_KOKIRI_SWORD]) {
|
if (mOptions[RSK_STARTING_KOKIRI_SWORD]) {
|
||||||
ctx->GetItemLocation(RC_KF_KOKIRI_SWORD_CHEST)->GetExcludedOption()->SetContextIndex(1);
|
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]) {
|
if (mOptions[RSK_SHUFFLE_DEKU_STICK_BAG]) {
|
||||||
mOptions[RSK_STARTING_STICKS].SetContextIndex(false);
|
mOptions[RSK_STARTING_STICKS].SetContextIndex(false);
|
||||||
|
|
|
@ -662,6 +662,8 @@ void SaveManager::Init() {
|
||||||
OTRGlobals::Instance->gRandoContext->ClearItemLocations();
|
OTRGlobals::Instance->gRandoContext->ClearItemLocations();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
auto ctx = Rando::Context::GetInstance();
|
||||||
|
ctx->GetSettings()->CreateOptions();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SaveManager::InitMeta(int fileNum) {
|
void SaveManager::InitMeta(int fileNum) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue