Organize ship specific save context additions (#4597)

* Basic restructure

* Undo most randomizerInf changes for now

* Small fixes

* Fix linux & mac builds?

* Fix remnants of randomizerInf changes

* Post-merge fix

* Post-merge fix
This commit is contained in:
Pepe20129
2025-01-15 13:04:47 +01:00
committed by GitHub
parent 0d80c4695f
commit 7f31fd2e4e
42 changed files with 695 additions and 640 deletions

View File

@@ -411,17 +411,17 @@ ItemTrackerNumbers GetItemCurrentAndMax(ItemTrackerItem item) {
break;
case ITEM_HEART_CONTAINER:
result.maxCapacity = result.currentCapacity = 8;
result.currentAmmo = gSaveContext.sohStats.heartContainers;
result.currentAmmo = gSaveContext.ship.stats.heartContainers;
break;
case ITEM_HEART_PIECE:
result.maxCapacity = result.currentCapacity = 36;
result.currentAmmo = gSaveContext.sohStats.heartPieces;
result.currentAmmo = gSaveContext.ship.stats.heartPieces;
break;
case ITEM_KEY_SMALL:
// Though the ammo/capacity naming doesn't really make sense for keys, we are
// hijacking the same system to display key counts as there are enough similarities
result.currentAmmo = MAX(gSaveContext.inventory.dungeonKeys[item.data], 0);
result.currentCapacity = gSaveContext.sohStats.dungeonKeys[item.data];
result.currentCapacity = gSaveContext.ship.stats.dungeonKeys[item.data];
switch (item.data) {
case SCENE_FOREST_TEMPLE:
result.maxCapacity = FOREST_TEMPLE_SMALL_KEY_MAX;
@@ -582,11 +582,11 @@ void DrawItemCount(ItemTrackerItem item, bool hideMax) {
std::string maxString = "";
uint8_t piecesRequired = (OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_TRIFORCE_HUNT_PIECES_REQUIRED) + 1);
uint8_t piecesTotal = (OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_TRIFORCE_HUNT_PIECES_TOTAL) + 1);
ImU32 currentColor = gSaveContext.triforcePiecesCollected >= piecesRequired ? IM_COL_GREEN : IM_COL_WHITE;
ImU32 currentColor = gSaveContext.ship.quest.data.randomizer.triforcePiecesCollected >= piecesRequired ? IM_COL_GREEN : IM_COL_WHITE;
ImU32 maxColor = IM_COL_GREEN;
int32_t trackerTriforcePieceNumberDisplayMode = CVarGetInteger(CVAR_TRACKER_ITEM("TriforcePieceCounts"), TRIFORCE_PIECE_COLLECTED_REQUIRED_MAX);
currentString += std::to_string(gSaveContext.triforcePiecesCollected);
currentString += std::to_string(gSaveContext.ship.quest.data.randomizer.triforcePiecesCollected);
currentString += "/";
// gItemTrackerTriforcePieceTrack
if (trackerTriforcePieceNumberDisplayMode == TRIFORCE_PIECE_COLLECTED_REQUIRED_MAX) {
@@ -651,11 +651,11 @@ void DrawItem(ItemTrackerItem item) {
switch (item.id) {
case ITEM_HEART_CONTAINER:
actualItemId = item.id;
hasItem = gSaveContext.sohStats.heartContainers > 0;
hasItem = gSaveContext.ship.stats.heartContainers > 0;
break;
case ITEM_HEART_PIECE:
actualItemId = item.id;
hasItem = gSaveContext.sohStats.heartPieces > 0;
hasItem = gSaveContext.ship.stats.heartPieces > 0;
break;
case ITEM_MAGIC_SMALL:
case ITEM_MAGIC_LARGE: