From 41e0465ddf54b1fff70825921285fefbb0930a05 Mon Sep 17 00:00:00 2001 From: Anthony Stewart Date: Mon, 17 Mar 2025 11:48:52 -0500 Subject: [PATCH] Check shop price against current wallet. --- .../randomizer/randomizer_check_tracker.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp b/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp index c32d07c87..ff72eb0b2 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp @@ -546,6 +546,7 @@ void CheckTrackerShopSlotChange(uint8_t cursorSlot, int16_t basePrice) { if (status == RCSHOW_SEEN) { OTRGlobals::Instance->gRandoContext->GetItemLocation(slot)->SetCheckStatus(RCSHOW_IDENTIFIED); SaveManager::Instance->SaveSection(gSaveContext.fileNum, sectionId, true); + RecalculateAccessibleChecks(); } } @@ -1667,12 +1668,6 @@ void DrawLocation(RandomizerCheck rc) { if (conditionStr != "true") { UIWidgets::InsertHelpHoverText(conditionStr); } - if (!itemLoc->HasObtained() && itemLoc->IsAccessible()) { - ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(extraColor.r / 255.0f, extraColor.g / 255.0f, extraColor.b / 255.0f, extraColor.a / 255.0f)); - ImGui::SameLine(); - ImGui::Text(" (Accessible)"); - ImGui::PopStyleColor(); - } break; } } @@ -1779,8 +1774,15 @@ void RecalculateAccessibleChecks() { std::vector accessibleChecks = ReachabilitySearch(targetLocations, RG_NONE, true); for (auto& rc : accessibleChecks) { - Rando::ItemLocation* itemLocation = OTRGlobals::Instance->gRandoContext->GetItemLocation(rc); - itemLocation->SetAccessible(true); + const auto& location = Rando::StaticData::GetLocation(rc); + const auto& itemLocation = OTRGlobals::Instance->gRandoContext->GetItemLocation(rc); + if (location->GetRCType() == RCTYPE_SHOP && itemLocation->GetCheckStatus() == RCSHOW_IDENTIFIED) { + if (CanBuyAnother(rc)) { + itemLocation->SetAccessible(true); + } + } else { + itemLocation->SetAccessible(true); + } } totalChecksAccessible = 0;