Restore Vanilla Tracking (#4394)

* Re-enabled vanilla tracking in the check tracker. Utilized Rando::Context for check status.

* Restore check tracker window custom background functionality.
This commit is contained in:
Malkierian 2024-10-13 22:22:49 -07:00 committed by GitHub
commit 65fbf2cc41
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 34 additions and 11 deletions

View file

@ -647,6 +647,10 @@ void CheckTrackerItemReceive(GetItemEntry giEntry) {
}
void CheckTrackerSceneFlagSet(int16_t sceneNum, int16_t flagType, int32_t flag) {
if (IS_RANDO) {
return;
}
if (flagType != FLAG_SCENE_TREASURE && flagType != FLAG_SCENE_COLLECTIBLE) {
return;
}
@ -668,6 +672,10 @@ void CheckTrackerSceneFlagSet(int16_t sceneNum, int16_t flagType, int32_t flag)
}
void CheckTrackerFlagSet(int16_t flagType, int32_t flag) {
if (IS_RANDO) {
return;
}
SpoilerCollectionCheckType checkMatchType = SpoilerCollectionCheckType::SPOILER_CHK_NONE;
switch (flagType) {
case FLAG_GS_TOKEN:
@ -1289,8 +1297,12 @@ bool IsCheckShuffled(RandomizerCheck rc) {
bool IsVisibleInCheckTracker(RandomizerCheck rc) {
auto loc = Rando::StaticData::GetLocation(rc);
return IsCheckShuffled(rc) || (loc->GetRCType() == RCTYPE_SKULL_TOKEN && alwaysShowGS) ||
(loc->GetRCType() == RCTYPE_SHOP && (showShops && (!hideShopRightChecks)));
if (IS_RANDO) {
return IsCheckShuffled(rc) || (loc->GetRCType() == RCTYPE_SKULL_TOKEN && alwaysShowGS) ||
(loc->GetRCType() == RCTYPE_SHOP && (showShops && (!hideShopRightChecks)));
} else {
return loc->IsVanillaCompletion() && (!loc->IsDungeon() || (loc->IsDungeon() && loc->GetQuest() == gSaveContext.questId));
}
}
void UpdateInventoryChecks() {
@ -1639,6 +1651,15 @@ void ImGuiDrawTwoColorPickerSection(const char* text, const char* cvarMainName,
}
}
void CheckTrackerWindow::Draw() {
if (!IsVisible()) {
return;
}
DrawElement();
// Sync up the IsVisible flag if it was changed by ImGui
SyncVisibilityConsoleVariable();
}
static const char* windowType[] = { "Floating", "Window" };
static const char* displayType[] = { "Always", "Combo Button Hold" };
static const char* buttonStrings[] = { "A Button", "B Button", "C-Up", "C-Down", "C-Left", "C-Right", "L Button",
@ -1716,12 +1737,12 @@ void CheckTrackerWindow::InitElement() {
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnExitGame>([](uint32_t fileNum) {
Teardown();
});
// GameInteractor::Instance->RegisterGameHook<GameInteractor::OnItemReceive>(CheckTrackerItemReceive);
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnItemReceive>(CheckTrackerItemReceive);
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnGameFrameUpdate>(CheckTrackerFrame);
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnTransitionEnd>(CheckTrackerTransition);
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnShopSlotChange>(CheckTrackerShopSlotChange);
// GameInteractor::Instance->RegisterGameHook<GameInteractor::OnSceneFlagSet>(CheckTrackerSceneFlagSet);
// GameInteractor::Instance->RegisterGameHook<GameInteractor::OnFlagSet>(CheckTrackerFlagSet);
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnSceneFlagSet>(CheckTrackerSceneFlagSet);
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnFlagSet>(CheckTrackerFlagSet);
}
void CheckTrackerWindow::UpdateElement() {