diff --git a/base/all-all/sbardef.lmp b/base/all-all/sbardef.lmp index 4872a236f..0f35134ee 100644 --- a/base/all-all/sbardef.lmp +++ b/base/all-all/sbardef.lmp @@ -1067,7 +1067,7 @@ "y": 52, "alignment": 1, "tranmap": null, - "translation": "CRGOLD", + "translation": null, "type": 8, "font": "Console", "duration": 2.5, @@ -1908,7 +1908,7 @@ "y": 68, "alignment": 1, "tranmap": null, - "translation": "CRGOLD", + "translation": null, "type": 8, "font": "Console", "duration": 2.5, @@ -2201,7 +2201,7 @@ "y": 68, "alignment": 1, "tranmap": null, - "translation": "CRGOLD", + "translation": null, "type": 8, "font": "Console", "duration": 2.5, diff --git a/base/all-all/sbhuddef.lmp b/base/all-all/sbhuddef.lmp index a0e41722a..37ebcfe75 100644 --- a/base/all-all/sbhuddef.lmp +++ b/base/all-all/sbhuddef.lmp @@ -246,7 +246,7 @@ "y": 52, "alignment": 1, "tranmap": null, - "translation": "CRGOLD", + "translation": null, "type": 8, "font": "Console", "duration": 2.5, diff --git a/base/extras.wad/sbardef.lmp b/base/extras.wad/sbardef.lmp index 4872a236f..0f35134ee 100644 --- a/base/extras.wad/sbardef.lmp +++ b/base/extras.wad/sbardef.lmp @@ -1067,7 +1067,7 @@ "y": 52, "alignment": 1, "tranmap": null, - "translation": "CRGOLD", + "translation": null, "type": 8, "font": "Console", "duration": 2.5, @@ -1908,7 +1908,7 @@ "y": 68, "alignment": 1, "tranmap": null, - "translation": "CRGOLD", + "translation": null, "type": 8, "font": "Console", "duration": 2.5, @@ -2201,7 +2201,7 @@ "y": 68, "alignment": 1, "tranmap": null, - "translation": "CRGOLD", + "translation": null, "type": 8, "font": "Console", "duration": 2.5, diff --git a/base/id1.wad/sbardef.lmp b/base/id1.wad/sbardef.lmp index cfd7cc664..dc02a73dc 100644 --- a/base/id1.wad/sbardef.lmp +++ b/base/id1.wad/sbardef.lmp @@ -1067,7 +1067,7 @@ "y": 52, "alignment": 1, "tranmap": null, - "translation": "CRGOLD", + "translation": null, "type": 8, "font": "Console", "duration": 2.5, @@ -1908,7 +1908,7 @@ "y": 68, "alignment": 1, "tranmap": null, - "translation": "CRGOLD", + "translation": null, "type": 8, "font": "Console", "duration": 2.5, @@ -2201,7 +2201,7 @@ "y": 68, "alignment": 1, "tranmap": null, - "translation": "CRGOLD", + "translation": null, "type": 8, "font": "Console", "duration": 2.5, diff --git a/src/st_sbardef.c b/src/st_sbardef.c index edb29d1eb..99eed9ff7 100644 --- a/src/st_sbardef.c +++ b/src/st_sbardef.c @@ -212,7 +212,7 @@ static boolean ParseSbarElemType(json_t *json, sbarelementtype_t type, switch (widget->type) { case sbw_message: - case sbw_secret: + case sbw_announce: widget->duration = JS_GetNumberValue(json, "duration") * TICRATE; break; diff --git a/src/st_sbardef.h b/src/st_sbardef.h index 1596d1323..d79711f8d 100644 --- a/src/st_sbardef.h +++ b/src/st_sbardef.h @@ -115,7 +115,7 @@ typedef enum sbw_speed, sbw_message, - sbw_secret, + sbw_announce, sbw_chat, sbw_title, } sbarwidgettype_t; diff --git a/src/st_widgets.c b/src/st_widgets.c index e39887de9..e329c497a 100644 --- a/src/st_widgets.c +++ b/src/st_widgets.c @@ -133,21 +133,40 @@ static void UpdateMessage(sbe_widget_t *widget, player_t *player) } } -static void UpdateSecretMessage(sbe_widget_t *widget, player_t *player) +static char announce_string[HU_MAXLINELENGTH]; + +static void UpdateAnnounceMessage(sbe_widget_t *widget, player_t *player) { + static enum + { + announce_none, + announce_map, + announce_secret + } state = announce_none; + ST_ClearLines(widget); - if (!hud_secret_message) + if ((state == announce_secret && !hud_secret_message) + || (state == announce_map && !hud_map_announce)) { return; } - static char string[80]; + static char string[HU_MAXLINELENGTH]; - if (player->secretmessage) + if (announce_string[0]) + { + state = announce_map; + widget->duration_left = widget->duration; + M_StringCopy(string, announce_string, sizeof(string)); + announce_string[0] = '\0'; + } + else if (player->secretmessage) { + state = announce_secret; widget->duration_left = widget->duration; - M_StringCopy(string, player->secretmessage, sizeof(string)); + M_snprintf(string, sizeof(string), GOLD_S "%s" ORIG_S, + player->secretmessage); player->secretmessage = NULL; } @@ -156,6 +175,10 @@ static void UpdateSecretMessage(sbe_widget_t *widget, player_t *player) ST_AddLine(widget, string); --widget->duration_left; } + else + { + state = announce_none; + } } typedef struct @@ -570,12 +593,18 @@ void ST_ResetTitle(void) M_snprintf(title_string, sizeof(title_string), "\x1b%c%s" ORIG_S, '0' + hudcolor_titl, string); + announce_string[0] = '\0'; if (hud_map_announce && leveltime == 0) { if (gamemapinfo && U_CheckField(gamemapinfo->author)) - displaymsg("%s by %s", string, gamemapinfo->author); + { + M_snprintf(announce_string, sizeof(announce_string), "%s by %s", + string, gamemapinfo->author); + } else - displaymsg("%s", string); + { + M_snprintf(announce_string, sizeof(announce_string), "%s", string); + } } } @@ -1082,8 +1111,8 @@ void ST_UpdateWidget(sbarelem_t *elem, player_t *player) case sbw_chat: UpdateChat(widget); break; - case sbw_secret: - UpdateSecretMessage(widget, player); + case sbw_announce: + UpdateAnnounceMessage(widget, player); break; case sbw_title: UpdateTitle(widget);