From 73606edf4ef6ddceedb15aff304f93fea8bc0a4c Mon Sep 17 00:00:00 2001 From: Garrett Cox Date: Fri, 2 Sep 2022 11:08:48 -0500 Subject: [PATCH] Use merchantMessageTableID --- soh/soh/Enhancements/randomizer/randomizer.cpp | 9 ++++----- soh/soh/Enhancements/randomizer/randomizer.h | 1 - soh/soh/OTRGlobals.cpp | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index 70b0a007b..44372dc65 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer.cpp @@ -32,7 +32,6 @@ u8 generated; const std::string Randomizer::getItemMessageTableID = "Randomizer"; const std::string Randomizer::hintMessageTableID = "RandomizerHints"; -const std::string Randomizer::shopMessageTableID = "RandomizerShops"; const std::string Randomizer::merchantMessageTableID = "RandomizerMerchants"; const std::string Randomizer::rupeeMessageTableID = "RandomizerRupees"; const std::string Randomizer::NaviRandoMessageTableID = "RandomizerNavi"; @@ -741,8 +740,8 @@ void Randomizer::LoadShopMessages(const char* spoilerFileName) { ParseHintLocationsFile(spoilerFileName); } - CustomMessageManager::Instance->ClearMessageTable(Randomizer::shopMessageTableID); - CustomMessageManager::Instance->AddCustomMessageTable(Randomizer::shopMessageTableID); + CustomMessageManager::Instance->ClearMessageTable(Randomizer::merchantMessageTableID); + CustomMessageManager::Instance->AddCustomMessageTable(Randomizer::merchantMessageTableID); // Make an inverse of std::unordered_map SpoilerfileGetNameToEnum // so that we can get the name of the item from the RandomizerCheck @@ -758,13 +757,13 @@ void Randomizer::LoadShopMessages(const char* spoilerFileName) { std::string shopItemName = GetEnumToSpoilerfileName[this->itemLocations[shopItemCheck]]; u16 shopItemPrice = randomizerMerchantPrices[shopItemCheck]; CustomMessageManager::Instance->CreateMessage( - Randomizer::shopMessageTableID, index, { TEXTBOX_TYPE_BLACK, TEXTBOX_POS_VARIABLE, + Randomizer::merchantMessageTableID, index, { TEXTBOX_TYPE_BLACK, TEXTBOX_POS_VARIABLE, "\x08%r" + shopItemName + ": " + std::to_string(shopItemPrice) + " Rupees&%wSpecial deal! ONE LEFT!&Get it while it lasts!\x0A\x02", "\x08%r" + shopItemName + ": " + std::to_string(shopItemPrice) + " Rubis&%wOffre spéciale! DERNIER EN STOCK!&Faites vite!\x0A\x02", "\x08%r" + shopItemName + ": " + std::to_string(shopItemPrice) + " Rupees&%wSpecial deal! ONE LEFT!&Get it while it lasts!\x0A\x02", }); CustomMessageManager::Instance->CreateMessage( - Randomizer::shopMessageTableID, index + shopItemRandomizerChecks.size(), { TEXTBOX_TYPE_BLACK, TEXTBOX_POS_VARIABLE, + Randomizer::merchantMessageTableID, index + shopItemRandomizerChecks.size(), { TEXTBOX_TYPE_BLACK, TEXTBOX_POS_VARIABLE, "\x08" + shopItemName + ": " + std::to_string(shopItemPrice) + " Rupees\x09&&\x1B%gBuy&Don't buy%w\x09\x02", "\x08" + shopItemName + ": " + std::to_string(shopItemPrice) + " Rubis\x09&&\x1B%gAcheter&Ne pas acheter%w\x09\x02", "\x08" + shopItemName + ": " + std::to_string(shopItemPrice) + " Rupees\x09&&\x1B%gBuy&Don't buy%w\x09\x02", diff --git a/soh/soh/Enhancements/randomizer/randomizer.h b/soh/soh/Enhancements/randomizer/randomizer.h index 491e7866e..f450edfbb 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.h +++ b/soh/soh/Enhancements/randomizer/randomizer.h @@ -36,7 +36,6 @@ class Randomizer { static const std::string getItemMessageTableID; static const std::string hintMessageTableID; - static const std::string shopMessageTableID; static const std::string merchantMessageTableID; static const std::string rupeeMessageTableID; static const std::string NaviRandoMessageTableID; diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp index 6ac370f15..e5542e1d2 100644 --- a/soh/soh/OTRGlobals.cpp +++ b/soh/soh/OTRGlobals.cpp @@ -1608,7 +1608,7 @@ extern "C" CustomMessageEntry Randomizer_GetNaviMessage() { } extern "C" CustomMessageEntry Randomizer_GetShopMessage(s16 shopItemId) { - return CustomMessageManager::Instance->RetrieveMessage(Randomizer::shopMessageTableID, shopItemId); + return CustomMessageManager::Instance->RetrieveMessage(Randomizer::merchantMessageTableID, shopItemId); } extern "C" CustomMessageEntry Randomizer_GetAltarMessage() {