This commit is contained in:
Christopher Leggett 2022-07-31 19:31:22 -04:00
parent e8d2b0cceb
commit 2f9874c68f
No known key found for this signature in database
GPG Key ID: 7093AE5FF7037D79
2 changed files with 10 additions and 14 deletions

View File

@ -112,11 +112,11 @@ CustomMessageEntry CustomMessageManager::RetrieveMessage(std::string tableID, ui
} }
bool CustomMessageManager::ClearMessageTable(std::string tableID) { bool CustomMessageManager::ClearMessageTable(std::string tableID) {
auto result = messageTables.find(tableID); auto foundMessageTable = messageTables.find(tableID);
if (result == messageTables.end()) { if (foundMessageTable == messageTables.end()) {
return false; return false;
} }
auto& messageTable = result->second; auto& messageTable = foundMessageTable->second;
messageTable.clear(); messageTable.clear();
} }

View File

@ -2403,10 +2403,6 @@ std::string Randomizer::GetGanonHintText() const {
return ganonHintText; return ganonHintText;
} }
//CustomMessageEntry Randomizer::GetHintFromCheck(RandomizerCheck check) {
// return CustomMessage::Instance->RetrieveMessage(hintMessageTableID, check);
//}
u8 Randomizer::GetRandoSettingValue(RandomizerSettingKey randoSettingKey) { u8 Randomizer::GetRandoSettingValue(RandomizerSettingKey randoSettingKey) {
return this->randoSettings[randoSettingKey]; return this->randoSettings[randoSettingKey];
} }
@ -4750,10 +4746,10 @@ typedef struct {
} GetItemMessage; } GetItemMessage;
void CreateGetItemMessages(std::vector<GetItemMessage> messageEntries) { void CreateGetItemMessages(std::vector<GetItemMessage> messageEntries) {
CustomMessageManager* customMessage = CustomMessageManager::Instance; CustomMessageManager* customMessageManager = CustomMessageManager::Instance;
customMessage->AddCustomMessageTable(Randomizer::getItemMessageTableID); customMessageManager->AddCustomMessageTable(Randomizer::getItemMessageTableID);
for (GetItemMessage messageEntry : messageEntries) { 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, { TEXTBOX_TYPE_BLUE, TEXTBOX_POS_BOTTOM,
messageEntry.english, messageEntry.german, messageEntry.english, messageEntry.german,
messageEntry.french }); messageEntry.french });
@ -4761,11 +4757,11 @@ void CreateGetItemMessages(std::vector<GetItemMessage> messageEntries) {
} }
void CreateScrubMessages() { void CreateScrubMessages() {
CustomMessageManager* customMessage = CustomMessageManager::Instance; CustomMessageManager* customMessageManager = CustomMessageManager::Instance;
customMessage->AddCustomMessageTable(Randomizer::scrubMessageTableID); customMessageManager->AddCustomMessageTable(Randomizer::scrubMessageTableID);
const std::vector<u8> prices = { 10, 40 }; const std::vector<u8> prices = { 10, 40 };
for (u8 price : prices) { for (u8 price : prices) {
customMessage->CreateMessage(Randomizer::scrubMessageTableID, price, customMessageManager->CreateMessage(Randomizer::scrubMessageTableID, price,
{ TEXTBOX_TYPE_BLACK, TEXTBOX_POS_BOTTOM, { 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" + "\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", std::to_string(price) + " Rupees%w it is!\x07\x10\xA3",