mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-22 02:00:11 +00:00
WIP
This commit is contained in:
parent
8c51bc235d
commit
511255216c
4 changed files with 9 additions and 4 deletions
|
|
@ -879,7 +879,7 @@ const char *G_KeynumToString(INT32 keynum)
|
|||
// return a string with the ascii char if displayable
|
||||
if (keynum > ' ' && keynum <= 'z' && keynum != KEY_CONSOLE)
|
||||
{
|
||||
keynamestr[0] = (char)keynum;
|
||||
keynamestr[0] = (char)(keynum - 32); // Uppercase looks better!
|
||||
keynamestr[1] = '\0';
|
||||
return keynamestr;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6303,7 +6303,7 @@ void K_ClearPersistentMessages()
|
|||
}
|
||||
|
||||
// Return value can be used for "paired" splitscreen messages, true = was displayed
|
||||
void K_AddMessageForPlayer(const player_t *player, const char *msg, boolean interrupt, boolean persist)
|
||||
void K_AddMessageForPlayer(player_t *player, const char *msg, boolean interrupt, boolean persist)
|
||||
{
|
||||
if (!player)
|
||||
return;
|
||||
|
|
@ -6319,7 +6319,12 @@ void K_AddMessageForPlayer(const player_t *player, const char *msg, boolean inte
|
|||
if (interrupt)
|
||||
state->clear();
|
||||
|
||||
// FIXME: SUPER BAD HACK.
|
||||
// Need a way to parse messages as a given player instead.
|
||||
player_t *oldstplyr = stplyr;
|
||||
stplyr = player;
|
||||
std::string parsedmsg = srb2::Draw::TextElement().parse(msg).string();
|
||||
stplyr = oldstplyr;
|
||||
|
||||
if (persist)
|
||||
state->objective = parsedmsg;
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ extern patch_t *kp_facenum[MAXPLAYERS+1];
|
|||
extern patch_t *kp_unknownminimap;
|
||||
|
||||
void K_AddMessage(const char *msg, boolean interrupt, boolean persist);
|
||||
void K_AddMessageForPlayer(const player_t *player, const char *msg, boolean interrupt, boolean persist);
|
||||
void K_AddMessageForPlayer(player_t *player, const char *msg, boolean interrupt, boolean persist);
|
||||
void K_ClearPersistentMessages(void);
|
||||
void K_ClearPersistentMessageForPlayer(player_t *player);
|
||||
void K_TickMessages(void);
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ Draw::TextElement& Draw::TextElement::parse(std::string_view raw)
|
|||
ourProfile = PR_GetLocalPlayerProfile(0);
|
||||
|
||||
string_.append("\x88");
|
||||
string_.append(G_KeynumToString(ourProfile->controls[id->second][0]));
|
||||
string_.append((G_KeynumToString(ourProfile->controls[id->second][0])));
|
||||
string_.append("\x80");
|
||||
}
|
||||
else // This is a color code or some other generic glyph, treat it as is.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue