fix required dungeons sign when no dungeons are required

This commit is contained in:
gymnast86
2026-06-01 01:53:04 -07:00
parent dc88e11115
commit f12838ea3b
8 changed files with 40 additions and 1 deletions
@@ -1506,6 +1506,11 @@ Hyrule Castle:
Cryptic:
Text: the {kingdom's castle}
# NO REQUIRED DUNGEON TEXT
No Required Dungeons Text:
Standard:
Text: No Required Dungeons
# ITEM GET TEXT
Foolish Get Item Text:
Standard:
@@ -1506,6 +1506,11 @@ Hyrule Castle:
Cryptic:
Text: the {kingdom's castle}
# NO REQUIRED DUNGEON TEXT
No Required Dungeons Text:
Standard:
Text: No Required Dungeons
# ITEM GET TEXT
Foolish Get Item Text:
Standard:
@@ -1506,6 +1506,11 @@ Hyrule Castle:
Cryptic:
Text: the {kingdom's castle}
# NO REQUIRED DUNGEON TEXT
No Required Dungeons Text:
Standard:
Text: No Required Dungeons
# ITEM GET TEXT
Foolish Get Item Text:
Standard:
@@ -1506,6 +1506,11 @@ Hyrule Castle:
Cryptic:
Text: the {kingdom's castle}
# NO REQUIRED DUNGEON TEXT
No Required Dungeons Text:
Standard:
Text: No Required Dungeons
# ITEM GET TEXT
Foolish Get Item Text:
Standard:
@@ -1506,6 +1506,11 @@ Hyrule Castle:
Cryptic:
Text: the {kingdom's castle}
# NO REQUIRED DUNGEON TEXT
No Required Dungeons Text:
Standard:
Text: No Required Dungeons
# ITEM GET TEXT
Foolish Get Item Text:
Standard:
@@ -26,6 +26,10 @@ namespace randomizer::logic::hints {
requiredDungeonText += dungeonColors.at(dungeonName) + getTextObject(dungeonName) + "\n";
}
}
if (requiredDungeonText.empty()) {
requiredDungeonText += getTextObject("No Required Dungeons Text");
}
}
}
@@ -185,6 +185,15 @@ namespace randomizer {
}
}
bool Text::empty() const {
for (auto& text : mText) {
if (!text.empty()) {
return false;
}
}
return true;
}
Text& Text::operator+=(const Text& rhs) {
for (size_t i = 0; i < mText.size(); ++i) {
mText[i] += rhs.mText[i];
@@ -68,10 +68,11 @@ namespace randomizer {
*
* @param oldStr the string to replace
* @param replacementText the Text object to replace the old string
* @param count the number of occurences to replace
* @param count the number of occurrences to replace
*/
void Replace(const std::string& oldStr, const Text& replacementText, int count = 1);
void Replace(const std::string& oldStr, const std::string& replacementText, int count = 1);
bool empty() const;
Text& operator+=(const Text& rhs);
Text& operator+=(const std::string& rhs);
friend Text operator+(Text lhs, Text& rhs);