mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
fix: add $C (class) and $R (race) quest text placeholders
Quest dialogs were showing literal "$C" instead of the player's class name. Added support for $c/$C (class) and $r/$R (race) placeholders in both game_screen and quest_log_screen substitution functions.
This commit is contained in:
parent
e0346c85df
commit
f8f514d28c
2 changed files with 21 additions and 2 deletions
|
|
@ -19600,8 +19600,16 @@ std::string GameScreen::replaceGenderPlaceholders(const std::string& text, game:
|
|||
pos += replacement.length();
|
||||
}
|
||||
|
||||
// Resolve class and race names for $C and $R placeholders
|
||||
std::string className = "Adventurer";
|
||||
std::string raceName = "Unknown";
|
||||
if (character) {
|
||||
className = game::getClassName(character->characterClass);
|
||||
raceName = game::getRaceName(character->race);
|
||||
}
|
||||
|
||||
// Replace simple placeholders.
|
||||
// $n = player name
|
||||
// $n/$N = player name, $c/$C = class name, $r/$R = race name
|
||||
// $p = subject pronoun (he/she/they)
|
||||
// $o = object pronoun (him/her/them)
|
||||
// $s = possessive adjective (his/her/their)
|
||||
|
|
@ -19615,6 +19623,8 @@ std::string GameScreen::replaceGenderPlaceholders(const std::string& text, game:
|
|||
std::string replacement;
|
||||
switch (code) {
|
||||
case 'n': case 'N': replacement = playerName; break;
|
||||
case 'c': case 'C': replacement = className; break;
|
||||
case 'r': case 'R': replacement = raceName; break;
|
||||
case 'p': replacement = pronouns.subject; break;
|
||||
case 'o': replacement = pronouns.object; break;
|
||||
case 's': replacement = pronouns.possessive; break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue