Merge branch 'develop-blair' of github.com:Malkierian/Shipwright into develop

This commit is contained in:
Malkierian 2025-06-30 09:26:51 -07:00
commit 002e8e9f09
34 changed files with 503 additions and 313 deletions

View file

@ -500,6 +500,9 @@ void SetShopSeen(uint32_t sceneNum, bool prices) {
}
void CheckTrackerLoadGame(int32_t fileNum) {
if (IS_BOSS_RUSH) {
return;
}
LoadSettings();
TrySetAreas();
for (auto& entry : Rando::StaticData::GetLocationTable()) {
@ -592,7 +595,7 @@ void CheckTrackerLoadGame(int32_t fileNum) {
Rando::Context::GetInstance()->GetEntranceShuffler()->ApplyEntranceOverrides();
}
RecalculateAvailableChecks();
recalculateAvailable = true;
}
void CheckTrackerShopSlotChange(uint8_t cursorSlot, int16_t basePrice) {
@ -1005,6 +1008,11 @@ void CheckTrackerWindow::DrawElement() {
return;
}
if (recalculateAvailable) {
recalculateAvailable = false;
RecalculateAvailableChecks();
}
SceneID sceneId = SCENE_ID_MAX;
if (gPlayState != nullptr) {
sceneId = (SceneID)gPlayState->sceneNum;
@ -1603,10 +1611,11 @@ bool IsCheckShuffled(RandomizerCheck rc) {
bool IsVisibleInCheckTracker(RandomizerCheck rc) {
auto loc = Rando::StaticData::GetLocation(rc);
if (IS_RANDO) {
return IsCheckShuffled(rc) ||
(alwaysShowGS && loc->GetRCType() == RCTYPE_SKULL_TOKEN &&
OTRGlobals::Instance->gRandoContext->IsQuestOfLocationActive(rc)) ||
(loc->GetRCType() == RCTYPE_SHOP && showShops && !hideShopUnshuffledChecks);
return !Rando::Context::GetInstance()->GetItemLocation(rc)->IsExcluded() &&
(IsCheckShuffled(rc) ||
(alwaysShowGS && loc->GetRCType() == RCTYPE_SKULL_TOKEN &&
OTRGlobals::Instance->gRandoContext->IsQuestOfLocationActive(rc)) ||
(loc->GetRCType() == RCTYPE_SHOP && showShops && !hideShopUnshuffledChecks));
} else {
return loc->IsVanillaCompletion() &&
(!loc->IsDungeon() || (loc->IsDungeon() && loc->GetQuest() == gSaveContext.ship.quest.id));
@ -2000,7 +2009,7 @@ void ImGuiDrawTwoColorPickerSection(const char* text, const char* cvarMainName,
}
void RecalculateAvailableChecks(RandomizerRegion startingRegion /* = RR_ROOT */) {
if (!enableAvailableChecks) {
if (!enableAvailableChecks || !GameInteractor::IsSaveLoaded()) {
return;
}
@ -2072,10 +2081,6 @@ static std::unordered_map<int32_t, const char*> buttonStrings = {
};
void CheckTrackerSettingsWindow::DrawElement() {
if (recalculateAvailable) {
recalculateAvailable = false;
RecalculateAvailableChecks();
}
ImGui::PushStyleVar(ImGuiStyleVar_CellPadding, { 8.0f, 8.0f });
if (ImGui::BeginTable("CheckTrackerSettingsTable", 2, ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV)) {
ImGui::TableSetupColumn("General settings", ImGuiTableColumnFlags_WidthStretch, 200.0f);
@ -2156,10 +2161,7 @@ void CheckTrackerSettingsWindow::DrawElement() {
"with your current progress.")
.Color(THEME_COLOR))) {
enableAvailableChecks = CVarGetInteger(CVAR_TRACKER_CHECK("EnableAvailableChecks"), 0);
if (GameInteractor::IsSaveLoaded(true)) {
RecalculateAvailableChecks();
}
RecalculateAvailableChecks();
}
ImGui::EndDisabled();