Check tracker show logic (#3972)

* Initial Implementation

* Fix missing locations

* Update locacc_castle_town.cpp

---------

Co-authored-by: Christopher Leggett <chris@leggett.dev>
This commit is contained in:
Pepe20129 2024-07-06 03:13:49 +02:00 committed by GitHub
commit 8b001da317
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 920 additions and 850 deletions

View file

@ -5,6 +5,7 @@
#include "dungeon.h"
#include "../../OTRGlobals.h"
#include "../../UIWidgets.hpp"
#include "3drando/location_access.hpp"
#include <string>
#include <vector>
@ -927,6 +928,8 @@ void CheckTrackerWindow::DrawElement() {
return;
}
AreaTable_Init();
ImGui::TableNextRow(0, headerHeight);
ImGui::TableNextColumn();
UIWidgets::EnhancementCheckbox(
@ -1561,6 +1564,19 @@ void DrawLocation(RandomizerCheck rc) {
ImGui::Text(" (%s)", txt.c_str());
ImGui::PopStyleColor();
}
if (CVarGetInteger("gCheckTrackerOptionShowLogic", 0)) {
std::vector<LocationAccess> locationsInRegion = areaTable[itemLoc->GetParentRegionKey()].locations;
for (auto& locationInRegion : locationsInRegion) {
if (locationInRegion.GetLocation() == rc) {
std::string conditionStr = locationInRegion.GetConditionStr();
if (conditionStr != "true") {
UIWidgets::InsertHelpHoverText(conditionStr);
}
return;
}
}
}
}
static std::set<std::string> rainbowCVars = {
@ -1698,6 +1714,8 @@ void CheckTrackerSettingsWindow::DrawElement() {
RecalculateAreaTotals();
}
UIWidgets::Tooltip("If enabled, will show GS locations in the tracker regardless of tokensanity settings.");
UIWidgets::EnhancementCheckbox("Show Logic", "gCheckTrackerOptionShowLogic");
UIWidgets::Tooltip("If enabled, will show a check's logic when hovering over it.");
// Filtering settings
UIWidgets::PaddedSeparator();