Skip to content

Commit

Permalink
Hide messages when loading levels
Browse files Browse the repository at this point in the history
Instead of clearing them. Also hid secret message.
  • Loading branch information
MrAlaux committed Dec 2, 2024
1 parent eb82738 commit 37a13ea
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/g_game.c
Original file line number Diff line number Diff line change
Expand Up @@ -1388,8 +1388,8 @@ static void G_DoLoadLevel(void)
// Rewind
G_SetRewindCountdown(0);

// Clear messages
ST_ClearMessages();
// Hide messages (but don't delete them outright)
ST_HideMessages();

// Minimap
if (minimap_was_on) {
Expand Down
13 changes: 13 additions & 0 deletions src/st_widgets.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,19 @@ void ST_ClearMessages(void)
message_index = 0;
}

void ST_HideMessages(void)
{
linkedmessage_t *m = message_list_head;

while (m)
{
m->duration_left = 0;
m = m->next;
}

players[consoleplayer].secretmessage = ""; // Clear secret message too
}

// [Nugget] -----------------------------------------------------------------/

static void UpdateMessage(sbe_widget_t *widget, player_t *player)
Expand Down
1 change: 1 addition & 0 deletions src/st_widgets.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ extern boolean sp_chat;
boolean ST_GetChatOn(void);
int ST_GetNumMessageLines(void);
void ST_ClearMessages(void);
void ST_HideMessages(void);

// [Nugget] =================================================================/

Expand Down

0 comments on commit 37a13ea

Please sign in to comment.