Animated roomnames, setroomname command

This commit adds a better system for animated roomnames.

The old system, like many other systems, were very hardcoded, and can be
described as mostly else-if chains, with some fun string comparisons.
The new system uses lists of text for transformations and glitchy names,
making it much easier to add new cases if needeed.

This commit implements the system but does not replace the old system,
where that is done in the next commit.

The settings for special roomnames can be read from level XML, and
`setroomname()` can be used from commands to set a new, static name.
This commit is contained in:
AllyTally
2022-12-11 19:05:20 -04:00
committed by Misa Elizabeth Kai
parent 27da7fe935
commit dd108a035f
6 changed files with 172 additions and 1 deletions

View File

@@ -5498,7 +5498,12 @@ void Game::customloadquick(const std::string& savfile)
{
map.showtrinkets = help.Int(pText);
}
else if (SDL_strcmp(pKey, "roomname") == 0)
{
map.setroomname(pText);
map.roomnameset = true;
map.roomname_special = true;
}
}
map.showteleporters = true;
@@ -5972,6 +5977,11 @@ bool Game::customsavequick(const std::string& savfile)
xml::update_tag(msgs, "showtrinkets", (int) map.showtrinkets);
if (map.roomnameset)
{
xml::update_tag(msgs, "roomname", map.roomname);
}
std::string summary = savearea + ", " + timestring();
xml::update_tag(msgs, "summary", summary.c_str());