Shipwright/soh/soh/Enhancements/randomizer/randomizer_check_tracker.h
Malkierian c4f34624ba
Flag tracker (#3447)
* Hook into flagset hooks for processing check tracking. Has some manual workarounds (some breaks still need to be found).
Remove areaChecks and looping functionality as redundant.

* Additional vanilla handling.

* Fix tracker not showing MQ checks in MQ non-rando.
Fix tracker marking non-MQ variants of dungeon checks (e.g. map chest, etc) when collecting in MQ.

* Set all areas to spoiled if not rando.

* Revert attempt to spoil in randomizer based on MQ dungeon count as I don't know how that works at the moment.

* Restore and update spoiling based on MQ dungeon settings (none, selection, or count of 12).
Fix Anju As Adult check.

* Remove Anchor-specific code :baguette:

* Use `ClearAreaTotals()` in `Teardown()` instead of the duplicate code there.

* Update to `ClearAreaChecksAndTotals()` with `vec.clear()` added.

* Fix type spoiling again. Now spoils on 0 MQ dungeons, not rando, if the option is enabled in check tracker settings, selection, or set number of 12.
Fix vanilla checks being marked collected in MQ dungeons.

* Fix 100 GS check.

* ACTUALLY fix 100 GS: change flag type to `RandomizerInf()` in `item_location.cpp`, add RC to RandoInf for it to the table. Also don't send GI for flag if father, falsely triggers ZR frogs minigame.

* Fix gravedigging tour tracking.

* Fix membership card check tracking.
Change scene and flag values to any existing enums.
Clarifying formatting for the checking loop vOrMQ conditions.

* Fix Gravedigging Tour tracking.
Simplify Always Win Gravedigging Tour and Fix Gravedigging Tour Glitch applications.
Modified all necessary paths to use vanilla GDT PoH collection flag instead of randomizer variant.

* Fix Kak Potion Shop being "seen" when entering as child.
2023-11-28 21:25:48 -05:00

58 lines
1.5 KiB
C++

#pragma once
#include <nlohmann/json.hpp>
#include "randomizerTypes.h"
#include "randomizer_check_objects.h"
#include <libultraship/libultraship.h>
namespace CheckTracker {
class CheckTrackerSettingsWindow : public LUS::GuiWindow {
public:
using LUS::GuiWindow::GuiWindow;
~CheckTrackerSettingsWindow() {};
protected:
void InitElement() override {};
void DrawElement() override;
void UpdateElement() override {};
};
class CheckTrackerWindow : public LUS::GuiWindow {
public:
using LUS::GuiWindow::GuiWindow;
~CheckTrackerWindow() {};
protected:
void InitElement() override;
void DrawElement() override;
void UpdateElement() override {};
};
//Converts an index into a Little Endian bitmask, as follows:
//00: 0000000100000000
//01: 0000001000000000
//...
//06: 0100000000000000
//07: 1000000000000000
//08: 0000000000000001
//09: 0000000000000010
//...
//14: 0000000001000000
//15: 0000000010000000
//repeat...
#define INDEX_TO_16BIT_LITTLE_ENDIAN_BITMASK(idx) (0x8000 >> (7 - (idx % 8) + ((idx % 16) / 8) * 8))
void DefaultCheckData(RandomizerCheck rc);
void Teardown();
void UpdateAllOrdering();
bool IsVisibleInCheckTracker(RandomizerCheckObject rcObj);
void InitTrackerData(bool isDebug);
RandomizerCheckArea GetCheckArea();
void UpdateCheck(uint32_t, RandomizerCheckTrackerData);
} // namespace CheckTracker
void to_json(nlohmann::json & j, const RandomizerCheckTrackerData& rctd);
void from_json(const nlohmann::json& j, RandomizerCheckTrackerData& rctd);