Shipwright/soh/soh/Enhancements/randomizer/randomizer_check_objects.h
sonoftunk b56e8926f0
Randomizer Auto Location tracker (#1942)
* Initial Auto-Location Tracking

* Updates styling for checked items in Check Tracker

* Fixes crashing issues with Check Tracker rendering

* Auto scroll Check Tracker windows to current area

* Checks Tracker only shows checked locations once in game

* Fixes issue where Check Tracker would auto-scroll to wrong location when entering a grotto

* Fixes gerudo fortress checks showing in tracker when settings have them removed

* InfTable Check Location Fixes: Lost Dog Richard, Rolling Gorons, HBA 1000, Thawed Zora

* Fixes most Event Chk Inf Checks on Check Tracker, and Frogs

* Check Tracker - Song from Malon now works

* Check Tracker
- Fixes Claim Check check not tracking
- Fixes spoiler for Claim Check check when getting Biggoron's Sword
- Fixes LACS being spoiled and not tracking

* Check Tracker - Fixes #2 for Skull Mask and Mask of Truth checks

* Check Tracker
- Adds support for merchants
- Fixes #7 for Bomchu Salesman
- Fixes #12 for Medigoron

* Check Tracker - Fixes #8 for Song from Saria

* Check Tracker - Fixes #9 for Adult Shooting Gallery

* Check Tracker - Fixes #10 for Composer Grave

* Check Tracker - Fixes #14 for Song from Ocarina of Time

* Check Tracker - Fixes #16 for Shooting the Sun

* Check Tracker - Fixes #19 for Darunia's Joy

* Save Editor - Adds missing label for Treasure Chest Game

* Check Tracker - Fixes Great Faries checks

* Check Tracker - Fixes Sheik at Temple

* Check Tracker - Fixes Great Fairy auto-scroll to wrong location

* Check Tracker - Updates blue warp checks
- Fixes Bongo Bongo and Twinrova checks

* Check Tracker - Fixes Dampe's Gravedigging Tour

* Check Tracker - Fixes Prescription to King Zora

* Check Tracker - Fixes Bazaar showing under wrong area on tracker between adult/child

* Check Tracker - Fixes scroll for Hyrule Market and Bazaar

* Check Tracker - Fixes giving Adult Trade Items shown on tracker: Broken Sword, Saw, Cojiro, Eyeball Froge, and Eyedrops

* Cleans up item_location

* Check Tracker - Item List
- Fixes item list not updating when changing seeds/options
- Separates item exclusion list from item check list
- Clean up comments

* Check Tracker - Adds Skip functionality to buttons

* Check Tracker - Refactors adult trade items to RandomizerInf

* Check Tracker - Fixes an issue where any time an item is removed the tracker would cause an application crash

* Check Tracker - Item names are now dependent on file language

* Check Tracker - Fixes Gerudo Card check not showing in Fast setting

* Reorders headers to (hopefully) avoid CI build conflicts on linux/consoles

* Explicitly defines vector header in randomizer.h to fix compile errors

* Complete Refactor of Check Tracker ImGui

* Adds missing check tracker files to CMakeLists

* Reverts the Item_location whitespace cleanup from ad10807c

* Check Tracker - Loading Fixes
- Fixes a bug where loading a save file a second time would add all the checks again
- Fixes a bug where the check tracker would not render at all until in a save file

* Check Tracker - Fixes a bug where checks would sometimes fail to load

* Check Tracker - Fixes duplicated checks when using Only on Pause or Only on Combo

* Check Tracker - Works around issue where single characters don't show in EnhancementCombobox, and fixes a label for combo buttons held option

* Check Tracker - Applies all Check Tracker changes to Item Location

* Check Tracker - Updated Check List
- Adds Link's pocket, either in KF or HM depending on starting age
- Supports Scrubs and Merchants
- Uses enums instead of magic numbers
- Updates DC Scrub Short Names for MQ

* Check Tracker - Adds a performance mode option

* Check Tracker - List Fixes (requires new rando generation)
- Fixes Frogs Rupees always visible
- Fixes Kokiri Sword Chest not showing
- Fixes Weird Egg not showing

* Check Tracker - MQ List basic support

* Check Tracker - MQ/Vanilla anti-spoilers

* Check Tracker - Collecting a compass now spoils the area

* Check Tracker - Basic Vanilla Support and fixes
- Vanilla items show in check tracker, even if many won't auto check
- Fixes an issue with Gerudo Fortress Keys
- Refactors IsVisibleInCheckTracker to randomizer_check_tracjer

* Check Tracker - Fixes merge conflict from 08a487f35e

* Check Tracker - Fixes tracker loading as Floating when default value is set to Windowed

* Randomizer Location Exclusion List
- Adds Scrubs, Merchants, Shops. Adult Trade items, MQ Dungeons, and Bean Salesman
- Fixes Kokiri Sword Chest, Weird Egg, and Frog Song Rupees from misbehaving
- Updates Gerudo Fortress logic to be dependent on Open/Fast/Normal Fortress
- Removes Invalid Check
- Adds RO Enum for MQ settings
- Updates magic values to RO enum

* Location Exclusion List - Scrubs that are always randomized now always show on the list

* For now, removes some extra code only needed for a Check Tracker.

* Randomizer Location Exclusion List - Fixes Eyeball Frog from showing up when Adult Trade Items was off

* Location Tracker - Updates Eyedrops to use RandomizerInf instead of Chest

* Check Tracker - Fixes a bug where Link's Pocket item wasn't acting as checked for area item count

* Check Tracker - Fixes a bug where Locations would incorrectly say Vanilla due to the first check in the area being a non-MQ check

* Check Tracker - Fixes a crash when Check Tracker is docked but not visible

* Check Tracker - Fixes areas being spoiled when loading different save files

* Check Tracker - Only reset variables if they are initialized

* Check Tracker - Cleans up old comments, unused variables, methods, and macros, adds language TODOs,

* Check Tracker - Readds rainbow UI elements after Cosmetics Editor refactor

* Check Tracker - Removal of flag lookup that was refactored, no longer needed header, and some trivial whitespace fixes.

* Check Tracker - Refactors Index to Bitmask code to a macro

* Check Tracker - Changes ordering from alphabetical to RandomizerCheck ordering

* Check Tracker - Wraps everything in a namespace to avoid global variable usage

* Check Tracker - Explicitly defines for-loop scope

* Check Tracker - refactors dungeon lookup from static array to function

* Fixes a bug when using EnhancementColor with alpha

* Check Tracker - Refactors all colour to use direct conversions

* Check Tracker - refactors settings loading and check visibility for readability

* Check Tracker - Fixes a bug where the wrong label showed on the Check Tracker BG Color

* UIWidgets - Adds Alpha bar to EnhancementColor when using alpha parameter
2022-12-10 22:39:23 -05:00

102 lines
3.1 KiB
C++

#pragma once
#include "randomizerTypes.h"
#include <string>
#include <map>
// Forward Declarations to avoid duplicate definition issues
enum ActorID : int;
enum SceneID : int;
// Check types based on main settings
typedef enum {
RCTYPE_STANDARD, // Base set of rando checks
RCTYPE_SKULL_TOKEN, // Gold Skulltulas
RCTYPE_COW, // Cows
RCTYPE_ADULT_TRADE, // Adult trade quest checks
RCTYPE_FROG_SONG, // Frog song purple rupee checks
RCTYPE_MAP_COMPASS, // Maps/Compasses
RCTYPE_SMALL_KEY, // Small Keys
RCTYPE_GF_KEY, // Gerudo Fortress Keys
RCTYPE_BOSS_KEY, // Boss Keys
RCTYPE_GANON_BOSS_KEY, // Ganon's boss key
RCTYPE_SHOP, // shops
RCTYPE_SCRUB, // scrubs
RCTYPE_MERCHANT, // merchants
RCTYPE_CHEST_GAME, //todo replace this once we implement it, just using it to exclude for now
RCTYPE_LINKS_POCKET, //todo this feels hacky
RCTYPE_GOSSIP_STONE,
} RandomizerCheckType;
typedef enum {
RCVORMQ_VANILLA,
RCVORMQ_MQ,
RCVORMQ_BOTH
} RandomizerCheckVanillaOrMQ;
typedef enum {
RCAREA_KOKIRI_FOREST,
RCAREA_LOST_WOODS,
RCAREA_SACRED_FOREST_MEADOW,
RCAREA_HYRULE_FIELD,
RCAREA_LAKE_HYLIA,
RCAREA_GERUDO_VALLEY,
RCAREA_GERUDO_FORTRESS,
RCAREA_WASTELAND,
RCAREA_DESERT_COLOSSUS,
RCAREA_MARKET,
RCAREA_HYRULE_CASTLE,
RCAREA_KAKARIKO_VILLAGE,
RCAREA_GRAVEYARD,
RCAREA_DEATH_MOUNTAIN_TRAIL,
RCAREA_GORON_CITY,
RCAREA_DEATH_MOUNTAIN_CRATER,
RCAREA_ZORAS_RIVER,
RCAREA_ZORAS_DOMAIN,
RCAREA_ZORAS_FOUNTAIN,
RCAREA_LON_LON_RANCH,
RCAREA_DEKU_TREE,
RCAREA_DODONGOS_CAVERN,
RCAREA_JABU_JABUS_BELLY,
RCAREA_FOREST_TEMPLE,
RCAREA_FIRE_TEMPLE,
RCAREA_WATER_TEMPLE,
RCAREA_SPIRIT_TEMPLE,
RCAREA_SHADOW_TEMPLE,
RCAREA_BOTTOM_OF_THE_WELL,
RCAREA_ICE_CAVERN,
RCAREA_GERUDO_TRAINING_GROUND,
RCAREA_GANONS_CASTLE,
//If adding any more areas, Check Tracker will need a refactor
RCAREA_INVALID
} RandomizerCheckArea;
#define TWO_ACTOR_PARAMS(a, b) (abs(a) << 16) | abs(b)
#define RC_OBJECT(rc, rc_v_or_mq, rc_type, rc_area, actor_id, scene_id, actor_params, og_item_id, rc_shortname, rc_spoilername) \
{ rc, {rc, rc_v_or_mq, rc_type, rc_area, actor_id, scene_id, actor_params, og_item_id, false, rc_shortname, rc_spoilername} }
typedef struct {
RandomizerCheck rc;
RandomizerCheckVanillaOrMQ vOrMQ;
RandomizerCheckType rcType;
RandomizerCheckArea rcArea;
ActorID actorId;
SceneID sceneId;
int32_t actorParams;
GetItemID ogItemId;
bool visibleInImgui;
std::string rcShortName;
std::string rcSpoilerName;
} RandomizerCheckObject;
namespace RandomizerCheckObjects {
bool AreaIsDungeon(RandomizerCheckArea area);
bool AreaIsOverworld(RandomizerCheckArea area);
std::string GetRCAreaName(RandomizerCheckArea area);
std::map<RandomizerCheck, RandomizerCheckObject> GetAllRCObjects();
std::map<RandomizerCheckArea, std::map<RandomizerCheck, RandomizerCheckObject>> GetAllRCObjectsByArea();
std::map<SceneID, RandomizerCheckArea> GetAllRCAreaBySceneID();
RandomizerCheckArea GetRCAreaBySceneID(SceneID sceneId);
void UpdateImGuiVisibility();
}