From 6da79ea4c63a127f728f6d1c8b1762be606fe467 Mon Sep 17 00:00:00 2001 From: aMannus Date: Fri, 3 Nov 2023 23:36:18 +0100 Subject: [PATCH] Fix Triforce Count u16 mistakes --- .../Enhancements/debugger/debugSaveEditor.cpp | 2 +- soh/soh/Enhancements/randomizer/draw.cpp | 6 +++--- soh/soh/Enhancements/randomizer/randomizer.cpp | 18 +++++++++--------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/soh/soh/Enhancements/debugger/debugSaveEditor.cpp b/soh/soh/Enhancements/debugger/debugSaveEditor.cpp index 945a826042..58e124b7a6 100644 --- a/soh/soh/Enhancements/debugger/debugSaveEditor.cpp +++ b/soh/soh/Enhancements/debugger/debugSaveEditor.cpp @@ -515,7 +515,7 @@ void DrawInfoTab() { UIWidgets::InsertHelpHoverText("Z-Targeting behavior"); if (IS_RANDO && OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_TRIFORCE_HUNT)) { - ImGui::InputScalar("Triforce Pieces", ImGuiDataType_U16, &gSaveContext.triforcePiecesCollected); + ImGui::InputScalar("Triforce Pieces", ImGuiDataType_U8, &gSaveContext.triforcePiecesCollected); UIWidgets::InsertHelpHoverText("Currently obtained Triforce Pieces. For Triforce Hunt."); bool thFlag = gSaveContext.grantBossKey != 0; diff --git a/soh/soh/Enhancements/randomizer/draw.cpp b/soh/soh/Enhancements/randomizer/draw.cpp index eacc62725b..570ac5801c 100644 --- a/soh/soh/Enhancements/randomizer/draw.cpp +++ b/soh/soh/Enhancements/randomizer/draw.cpp @@ -214,7 +214,7 @@ extern "C" void Randomizer_DrawTriforcePiece(PlayState* play, GetItemEntry getIt Gfx_SetupDL_25Xlu(play->state.gfxCtx); - uint16_t current = gSaveContext.triforcePiecesCollected; + uint8_t current = gSaveContext.triforcePiecesCollected; Matrix_Scale(0.035f, 0.035f, 0.035f, MTXMODE_APPLY); @@ -238,8 +238,8 @@ extern "C" void Randomizer_DrawTriforcePieceGI(PlayState* play, GetItemEntry get Gfx_SetupDL_25Xlu(play->state.gfxCtx); - uint16_t current = gSaveContext.triforcePiecesCollected; - uint16_t required = OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_TRIFORCE_HUNT_PIECES_REQUIRED); + uint8_t current = gSaveContext.triforcePiecesCollected; + uint8_t required = OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_TRIFORCE_HUNT_PIECES_REQUIRED); Matrix_Scale(triforcePieceScale, triforcePieceScale, triforcePieceScale, MTXMODE_APPLY); diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index 955bfc17af..549195d50f 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer.cpp @@ -5549,9 +5549,9 @@ void CreateTriforcePieceMessages() { CustomMessage Randomizer::GetTriforcePieceMessage() { // Item is only given after the textbox, so reflect that inside the textbox. - uint16_t current = gSaveContext.triforcePiecesCollected + 1; - uint16_t required = OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_TRIFORCE_HUNT_PIECES_REQUIRED); - uint16_t remaining = required - current; + uint8_t current = gSaveContext.triforcePiecesCollected + 1; + uint8_t required = OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_TRIFORCE_HUNT_PIECES_REQUIRED); + uint8_t remaining = required - current; float percentageCollected = (float)current / (float)required; uint8_t messageIndex; @@ -5580,12 +5580,12 @@ void CreateChristmasTreeMessages() { CustomMessage ChristmasTreeMessages[2] = { { "The %yChristmas tree%w seems to be&missing some of %gits magic%w... Find all&ornaments to save %rChristmas%w!", - "The Christmas tree seems to be&missing some of its magic...", - "The Christmas tree seems to be&missing some of its magic..." }, + "The %yChristmas tree%w seems to be&missing some of %gits magic%w... Find all&ornaments to save %rChristmas%w!", + "The %yChristmas tree%w seems to be&missing some of %gits magic%w... Find all&ornaments to save %rChristmas%w!" }, { "The tree's magic has been fully&restored. %gMerry %rChristmas%w!", - "The tree's magic has been fully restored. Merry Christmas!", - "The tree's magic has been fully restored. Merry Christmas!" } + "The tree's magic has been fully&restored. %gMerry %rChristmas%w!", + "The tree's magic has been fully&restored. %gMerry %rChristmas%w!" } }; CustomMessageManager* customMessageManager = CustomMessageManager::Instance; customMessageManager->AddCustomMessageTable(Randomizer::christmasTreeMessageTableID); @@ -5596,8 +5596,8 @@ void CreateChristmasTreeMessages() { CustomMessage Randomizer::GetChristmasTreeMessage() { // Item is only given after the textbox, so reflect that inside the textbox. - uint16_t current = gSaveContext.triforcePiecesCollected; - uint16_t required = OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_TRIFORCE_HUNT_PIECES_REQUIRED); + uint8_t current = gSaveContext.triforcePiecesCollected; + uint8_t required = OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_TRIFORCE_HUNT_PIECES_REQUIRED); uint8_t messageIndex; if (current < required) {