From 2f9874c68f2a8e37839be4e382c686a7a56d3136 Mon Sep 17 00:00:00 2001 From: Christopher Leggett Date: Sun, 31 Jul 2022 19:31:22 -0400 Subject: [PATCH] Cleanup. --- .../custom_message/CustomMessageManager.cpp | 6 +++--- soh/soh/Enhancements/randomizer/randomizer.cpp | 18 +++++++----------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/soh/soh/Enhancements/custom_message/CustomMessageManager.cpp b/soh/soh/Enhancements/custom_message/CustomMessageManager.cpp index f5c31aa5b68..e4e190c5c42 100644 --- a/soh/soh/Enhancements/custom_message/CustomMessageManager.cpp +++ b/soh/soh/Enhancements/custom_message/CustomMessageManager.cpp @@ -112,11 +112,11 @@ CustomMessageEntry CustomMessageManager::RetrieveMessage(std::string tableID, ui } bool CustomMessageManager::ClearMessageTable(std::string tableID) { - auto result = messageTables.find(tableID); - if (result == messageTables.end()) { + auto foundMessageTable = messageTables.find(tableID); + if (foundMessageTable == messageTables.end()) { return false; } - auto& messageTable = result->second; + auto& messageTable = foundMessageTable->second; messageTable.clear(); } diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index 00bcadaf1a8..dcfa3667524 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer.cpp @@ -1843,7 +1843,7 @@ std::string FormatJsonHintText(std::string jsonHint) { start_pos += textBoxSpecialCharacterString.length(); } } - + // add icons to altar text for (char iconChar : {'0', '1', '2', '3', '4', '5', '6', '7', '8', 'o', 'c', 'i', 'l', 'b', 'L', 'k'}) { std::string textToReplace = "$"; @@ -2403,10 +2403,6 @@ std::string Randomizer::GetGanonHintText() const { return ganonHintText; } -//CustomMessageEntry Randomizer::GetHintFromCheck(RandomizerCheck check) { -// return CustomMessage::Instance->RetrieveMessage(hintMessageTableID, check); -//} - u8 Randomizer::GetRandoSettingValue(RandomizerSettingKey randoSettingKey) { return this->randoSettings[randoSettingKey]; } @@ -4750,10 +4746,10 @@ typedef struct { } GetItemMessage; void CreateGetItemMessages(std::vector messageEntries) { - CustomMessageManager* customMessage = CustomMessageManager::Instance; - customMessage->AddCustomMessageTable(Randomizer::getItemMessageTableID); + CustomMessageManager* customMessageManager = CustomMessageManager::Instance; + customMessageManager->AddCustomMessageTable(Randomizer::getItemMessageTableID); for (GetItemMessage messageEntry : messageEntries) { - customMessage->CreateGetItemMessage(Randomizer::getItemMessageTableID, messageEntry.giid, messageEntry.iid, + customMessageManager->CreateGetItemMessage(Randomizer::getItemMessageTableID, messageEntry.giid, messageEntry.iid, { TEXTBOX_TYPE_BLUE, TEXTBOX_POS_BOTTOM, messageEntry.english, messageEntry.german, messageEntry.french }); @@ -4761,11 +4757,11 @@ void CreateGetItemMessages(std::vector messageEntries) { } void CreateScrubMessages() { - CustomMessageManager* customMessage = CustomMessageManager::Instance; - customMessage->AddCustomMessageTable(Randomizer::scrubMessageTableID); + CustomMessageManager* customMessageManager = CustomMessageManager::Instance; + customMessageManager->AddCustomMessageTable(Randomizer::scrubMessageTableID); const std::vector prices = { 10, 40 }; for (u8 price : prices) { - customMessage->CreateMessage(Randomizer::scrubMessageTableID, price, + customMessageManager->CreateMessage(Randomizer::scrubMessageTableID, price, { TEXTBOX_TYPE_BLACK, TEXTBOX_POS_BOTTOM, "\x12\x38\x82\All right! You win! In return for&sparing me, I will sell you a&%gmysterious item%w!&%r" + std::to_string(price) + " Rupees%w it is!\x07\x10\xA3",