Skip to content

Commit

Permalink
Cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
leggettc18 committed Jul 31, 2022
1 parent e8d2b0c commit 2f9874c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
6 changes: 3 additions & 3 deletions soh/soh/Enhancements/custom_message/CustomMessageManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
18 changes: 7 additions & 11 deletions soh/soh/Enhancements/randomizer/randomizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "$";
Expand Down Expand Up @@ -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];
}
Expand Down Expand Up @@ -4750,22 +4746,22 @@ typedef struct {
} GetItemMessage;

void CreateGetItemMessages(std::vector<GetItemMessage> 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 });
}
}

void CreateScrubMessages() {
CustomMessageManager* customMessage = CustomMessageManager::Instance;
customMessage->AddCustomMessageTable(Randomizer::scrubMessageTableID);
CustomMessageManager* customMessageManager = CustomMessageManager::Instance;
customMessageManager->AddCustomMessageTable(Randomizer::scrubMessageTableID);
const std::vector<u8> 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",
Expand Down

0 comments on commit 2f9874c

Please sign in to comment.