From 682e781d761eae299e544fac147f9f901904c981 Mon Sep 17 00:00:00 2001 From: danij Date: Tue, 5 May 2009 04:55:00 +0000 Subject: [PATCH] Fixed all games: CCmd "msgrefresh" not working. Changed jDoom/jDoom64/jHeretic: Renamed cvar "msg-secret" to "server-game-announce-secret". --- doomsday/plugins/common/include/hu_log.h | 21 +- doomsday/plugins/common/src/f_infine.c | 7 +- doomsday/plugins/common/src/g_game.c | 4 +- doomsday/plugins/common/src/hu_log.c | 332 +++++++++++++-------- doomsday/plugins/common/src/hu_stuff.c | 6 +- doomsday/plugins/common/src/p_player.c | 10 +- doomsday/plugins/common/src/p_saveg.c | 2 +- doomsday/plugins/common/src/p_user.c | 2 +- doomsday/plugins/jdoom/data/conhelp.txt | 6 +- doomsday/plugins/jdoom/src/d_console.c | 2 + doomsday/plugins/jdoom/src/d_main.c | 6 +- doomsday/plugins/jdoom64/data/conhelp.txt | 6 +- doomsday/plugins/jdoom64/src/d_console.c | 2 + doomsday/plugins/jdoom64/src/d_main.c | 6 +- doomsday/plugins/jheretic/data/conhelp.txt | 6 +- doomsday/plugins/jheretic/src/h_console.c | 4 + doomsday/plugins/jheretic/src/h_main.c | 6 +- doomsday/plugins/jhexen/src/h2_main.c | 6 +- doomsday/plugins/jhexen/src/hconsole.c | 5 + 19 files changed, 259 insertions(+), 180 deletions(-) diff --git a/doomsday/plugins/common/include/hu_log.h b/doomsday/plugins/common/include/hu_log.h index 0db0008bde..f07f998bf0 100644 --- a/doomsday/plugins/common/include/hu_log.h +++ b/doomsday/plugins/common/include/hu_log.h @@ -40,16 +40,21 @@ # include "jhexen.h" #endif -void HUMsg_Register(void); +// Log Message Flags (LMF_*), used with Hu_LogPost. +#define LMF_NOHIDE (0x1) +#define LMF_YELLOW (0x2) -void HUMsg_Start(void); -void HUMsg_PlayerMessage(int player, char* message, int tics, - boolean noHide, boolean yellow); -void HUMsg_ClearMessages(int player); -void HUMsg_Refresh(int player); +void Hu_LogRegister(void); -void HUMsg_Drawer(int player); -void HUMsg_Ticker(void); +void Hu_LogStart(int player); +void Hu_LogShutdown(void); + +void Hu_LogPost(int player, byte flags, const char* msg, int tics); +void Hu_LogRefresh(int player); +void Hu_LogEmpty(int player); + +void Hu_LogDrawer(int player); +void Hu_LogTicker(void); #endif /**\file diff --git a/doomsday/plugins/common/src/f_infine.c b/doomsday/plugins/common/src/f_infine.c index b495fa22b4..6dcee9473e 100644 --- a/doomsday/plugins/common/src/f_infine.c +++ b/doomsday/plugins/common/src/f_infine.c @@ -396,10 +396,6 @@ void FI_ClearState(void) { int i, c; - // Clear the message queue for all local players. - for(i = 0; i < MAXPLAYERS; ++i) - HUMsg_ClearMessages(i); - // General game state. G_SetGameAction(GA_NONE); if(fi->mode != FIMODE_OVERLAY) @@ -588,6 +584,9 @@ void FI_Start(char *finalescript, infinemode_t mode) // Init InFine state. FI_NewState(finalescript); fi->mode = mode; + // Clear the message queue for all local players. + for(i = 0; i < MAXPLAYERS; ++i) + Hu_LogEmpty(i); FI_ClearState(); if(!IS_CLIENT) diff --git a/doomsday/plugins/common/src/g_game.c b/doomsday/plugins/common/src/g_game.c index cef92ba13d..220001d40b 100644 --- a/doomsday/plugins/common/src/g_game.c +++ b/doomsday/plugins/common/src/g_game.c @@ -476,7 +476,7 @@ void G_CommonPreInit(void) AM_Register(); // For the automap. Hu_MenuRegister(); // For the menu. HU_Register(); // For the HUD displays. - HUMsg_Register(); // For the player message logs. + Hu_LogRegister(); // For the player message logs. Chat_Register(); Hu_MsgRegister(); // For the game messages. ST_Register(); // For the hud/statusbar. @@ -1183,7 +1183,7 @@ void G_PlayerLeaveMap(int player) p->poisonCount = 0; #endif - HUMsg_ClearMessages(p - players); + Hu_LogEmpty(p - players); } /** diff --git a/doomsday/plugins/common/src/hu_log.c b/doomsday/plugins/common/src/hu_log.c index bbd29453d4..745e1b4637 100644 --- a/doomsday/plugins/common/src/hu_log.c +++ b/doomsday/plugins/common/src/hu_log.c @@ -33,9 +33,7 @@ #include #include -#include #include -#include #if __JDOOM__ # include "jdoom.h" @@ -47,6 +45,7 @@ # include "jhexen.h" #endif +#include "hu_log.h" #include "hu_stuff.h" #include "p_tick.h" // for P_IsPaused() #include "d_net.h" @@ -58,12 +57,15 @@ #define LOG_MSG_FLASHFADETICS (1*TICSPERSEC) #define LOG_MSG_TIMEOUT (4*TICRATE) +// Local Message flags: +#define MF_JUSTADDED (0x1) + // TYPES ------------------------------------------------------------------- typedef struct logmsg_s { char* text; - int time; - int duration; // Time when posted. + uint ticsRemain, tics; + byte flags; } logmsg_t; typedef struct msglog_s { @@ -73,9 +75,11 @@ typedef struct msglog_s { boolean dontFuckWithMe; logmsg_t msgs[LOG_MAX_MESSAGES]; - uint nextMsg, msgCount; + uint msgCount; // Number of used msg slots. + uint nextMsg; // Index of the next slot to be used in msgs. + uint numVisibleMsgs; // Number of visible messages. - int timer; + int timer; // Auto-hide timer. float yOffset; // Scroll-up offset. } msglog_t; @@ -96,12 +100,6 @@ static msglog_t msgLogs[MAXPLAYERS]; cvar_t msgLogCVars[] = { // Behaviour {"msg-count", 0, CVT_INT, &cfg.msgCount, 0, 8}, - {"msg-echo", 0, CVT_BYTE, &cfg.echoMsg, 0, 1}, -#if __JHEXEN__ - {"msg-hub-override", 0, CVT_BYTE, &cfg.overrideHubMsg, 0, 2}, -#else - {"msg-secret", 0, CVT_BYTE, &cfg.secretMsg, 0, 1}, -#endif {"msg-uptime", CVF_NO_MAX, CVT_INT, &cfg.msgUptime, 35, 0}, // Display @@ -111,9 +109,9 @@ cvar_t msgLogCVars[] = { {"msg-show", 0, CVT_BYTE, &cfg.msgShow, 0, 1}, // Colour defaults - {"msg-color-r", 0, CVT_FLOAT, &cfg.msgColor[0], 0, 1}, - {"msg-color-g", 0, CVT_FLOAT, &cfg.msgColor[1], 0, 1}, - {"msg-color-b", 0, CVT_FLOAT, &cfg.msgColor[2], 0, 1}, + {"msg-color-r", 0, CVT_FLOAT, &cfg.msgColor[CR], 0, 1}, + {"msg-color-g", 0, CVT_FLOAT, &cfg.msgColor[CG], 0, 1}, + {"msg-color-b", 0, CVT_FLOAT, &cfg.msgColor[CB], 0, 1}, {NULL} }; @@ -123,7 +121,7 @@ cvar_t msgLogCVars[] = { * Called during the PreInit of each game during start up. * Register Cvars and CCmds for the opperation/look of the message log. */ -void HUMsg_Register(void) +void Hu_LogRegister(void) { int i; @@ -152,20 +150,26 @@ static void logPush(msglog_t* log, const char* txt, int tics) msg->text = realloc(msg->text, len + 1); snprintf(msg->text, len, "%s", txt); msg->text[len] = '\0'; - msg->time = msg->duration = tics; + msg->ticsRemain = msg->tics = tics; + msg->flags = MF_JUSTADDED; - log->timer = LOG_MSG_TIMEOUT; if(log->nextMsg < LOG_MAX_MESSAGES - 1) log->nextMsg++; else log->nextMsg = 0; - if(log->msgCount < (unsigned) cfg.msgCount) + if(log->msgCount < LOG_MAX_MESSAGES) log->msgCount++; + if(log->numVisibleMsgs < (unsigned) cfg.msgCount) + log->numVisibleMsgs++; + log->notToBeFuckedWith = log->dontFuckWithMe; log->dontFuckWithMe = 0; + // Reset the auto-hide timer. + log->timer = LOG_MSG_TIMEOUT; + log->visible = true; } @@ -179,38 +183,18 @@ static void logPop(msglog_t* log) int oldest; logmsg_t* msg; - if(log->msgCount == 0) + if(log->numVisibleMsgs == 0) return; - oldest = (unsigned) log->nextMsg - log->msgCount; + oldest = (unsigned) log->nextMsg - log->numVisibleMsgs; if(oldest < 0) oldest += LOG_MAX_MESSAGES; msg = &log->msgs[oldest]; - msg->time = 10; + msg->ticsRemain = 10; + msg->flags &= ~MF_JUSTADDED; - log->msgCount--; -} - -/** - * Empties the msglog. - * - * @param log Ptr to the msglog to clear. - */ -static void logEmpty(msglog_t* log) -{ - int i; - - for(i = 0; i < LOG_MAX_MESSAGES; ++i) - { - logmsg_t* msg = &log->msgs[i]; - - if(msg->text) - free(msg->text); - msg->text = NULL; - } - - log->msgCount = 0; + log->numVisibleMsgs--; } /** @@ -227,39 +211,42 @@ static void logTicker(msglog_t* log) if(P_IsPaused()) return; - // Countdown to scroll-up. + // All messags tic away. When lower than lineheight, offset the y origin + // of the message log. When zero, the earliest is pop'd. for(i = 0; i < LOG_MAX_MESSAGES; ++i) { - if(log->msgs[i].time > 0) - log->msgs[i].time--; + logmsg_t* msg = &log->msgs[i]; + + if(msg->ticsRemain > 0) + msg->ticsRemain--; } - if(log->msgCount != 0) + if(log->numVisibleMsgs) { int oldest; logmsg_t* msg; - oldest = (unsigned) log->nextMsg - log->msgCount; + oldest = (unsigned) log->nextMsg - log->numVisibleMsgs; if(oldest < 0) oldest += LOG_MAX_MESSAGES; msg = &log->msgs[oldest]; log->yOffset = 0; - if(msg->time == 0) + if(msg->ticsRemain == 0) { logPop(log); } - else if(msg->time <= LINEHEIGHT_A) + else { - log->yOffset = LINEHEIGHT_A - msg->time; + if(msg->ticsRemain <= LINEHEIGHT_A) + log->yOffset = LINEHEIGHT_A - msg->ticsRemain; } } - // Tick down message counter if a message is up. + // Tic the auto-hide timer. if(log->timer > 0) log->timer--; - if(log->timer == 0) { log->visible = false; @@ -275,117 +262,134 @@ static void logTicker(msglog_t* log) static void logDrawer(msglog_t* log) { uint i, numVisible; - int n, y, lh = LINEHEIGHT_A, x; - int td, msgTics, blinkSpeed; - float col[4]; - logmsg_t* msg; + int n, x, y; // How many messages should we print? switch(cfg.msgAlign) { - case ALIGN_LEFT: x = 0; break; - case ALIGN_CENTER: x = 160; break; - case ALIGN_RIGHT: x = 320; break; - default: x = 0; break; + default: + case ALIGN_LEFT: x = 0; break; + case ALIGN_CENTER: x = SCREENWIDTH/2; break; + case ALIGN_RIGHT: x = SCREENWIDTH; break; } - Draw_BeginZoom(cfg.msgScale, x, 0); - DGL_Translatef(0, -log->yOffset, 0); - // First 'num' messages starting from the first one. - numVisible = MIN_OF(log->msgCount, (unsigned) cfg.msgCount); + numVisible = MIN_OF(log->numVisibleMsgs, (unsigned) cfg.msgCount); n = log->nextMsg - numVisible; if(n < 0) n += LOG_MAX_MESSAGES; y = 0; - for(i = 0; i < numVisible; ++i, y += lh) - { - msg = &log->msgs[n]; - // Set colour and alpha. - memcpy(col, cfg.msgColor, sizeof(cfg.msgColor)); - col[3] = 1; + Draw_BeginZoom(cfg.msgScale, x, 0); + DGL_Translatef(0, -log->yOffset, 0); + + for(i = 0; i < numVisible; ++i, y += LINEHEIGHT_A) + { + logmsg_t* msg = &log->msgs[n]; + float col[4]; - td = cfg.msgUptime - msg->time; - msgTics = msg->duration - msg->time; - blinkSpeed = cfg.msgBlink; + // Default colour and alpha. + col[CR] = cfg.msgColor[CR]; + col[CG] = cfg.msgColor[CG]; + col[CB] = cfg.msgColor[CB]; + col[CA] = 1; - if((td & 2) && blinkSpeed != 0 && msgTics < blinkSpeed) - { - // Flash color. - col[0] = col[1] = col[2] = 1; - } - else if(blinkSpeed != 0 && - msgTics < blinkSpeed + LOG_MSG_FLASHFADETICS && - msgTics >= blinkSpeed) + if(msg->flags & MF_JUSTADDED) { - int c; + uint msgTics, td, blinkSpeed = cfg.msgBlink; + + msgTics = msg->tics - msg->ticsRemain; + td = cfg.msgUptime - msg->ticsRemain; + + if((td & 2) && blinkSpeed != 0 && msgTics < blinkSpeed) + { + // Flash color. + col[CR] = col[CG] = col[CB] = 1; + } + else if(blinkSpeed != 0 && + msgTics < blinkSpeed + LOG_MSG_FLASHFADETICS && + msgTics >= blinkSpeed) + { + int c; - // Fade color to normal. - for(c = 0; c < 3; ++c) - col[c] += ((1.0f - col[c]) / LOG_MSG_FLASHFADETICS) * - (blinkSpeed + LOG_MSG_FLASHFADETICS - msgTics); + // Fade color to normal. + for(c = 0; c < 3; ++c) + col[c] += ((1.0f - col[c]) / LOG_MSG_FLASHFADETICS) * + (blinkSpeed + LOG_MSG_FLASHFADETICS - msgTics); + } } else { // Fade alpha out. - if(i == 0 && msg->time <= LINEHEIGHT_A) - col[3] = msg->time / (float) LINEHEIGHT_A * 0.9f; + if(i == 0 && msg->ticsRemain <= LINEHEIGHT_A) + col[CA] = msg->ticsRemain / (float) LINEHEIGHT_A * .9f; } // Draw using param text. // Messages may use the params to override the way the message is // is displayed, e.g. colour (Hexen's important messages). WI_DrawParamText(x, 1 + y, msg->text, huFontA, - col[0], col[1], col[2], col[3], false, false, + col[CR], col[CG], col[CB], col[CA], false, false, cfg.msgAlign); - if(n < LOG_MAX_MESSAGES - 1) - n++; - else - n = 0; + n = (n < LOG_MAX_MESSAGES - 1)? n + 1 : 0; } Draw_EndZoom(); } /** - * Called by HU_Start(). + * Initialize the message log of the specified player. Typically called after + * map load or when said player enters the world. + * + * @param player Player (local) number whose message log to init. + */ +void Hu_LogStart(int player) +{ + player_t* plr; + msglog_t* log; + + if(player < 0 || player >= MAXPLAYERS) + return; + + plr = &players[player]; + if(!((plr->plr->flags & DDPF_LOCAL) && plr->plr->inGame)) + return; + + log = &msgLogs[player]; + memset(log, 0, sizeof(msglog_t)); +} + +/** + * Called during final shutdown. */ -void HUMsg_Start(void) +void Hu_LogShutdown(void) { - int i, j; + int i; - // Create the message logs for all local players. - //// \todo we only need logs for active local players. for(i = 0; i < MAXPLAYERS; ++i) { msglog_t* log = &msgLogs[i]; - - log->visible = false; - log->dontFuckWithMe = false; - log->notToBeFuckedWith = false; - log->yOffset = 0; // Scroll-up offset. - log->timer = 0; - log->visible = true; - log->nextMsg = log->msgCount = 0; + int j; for(j = 0; j < LOG_MAX_MESSAGES; ++j) { logmsg_t* msg = &log->msgs[j]; + if(msg->text) + free(msg->text); msg->text = NULL; - msg->time = 0; - msg->duration = 0; } + + log->msgCount = log->numVisibleMsgs = 0; } } /** - * Called by HU_ticker(). + * Called TICSPERSEC times a second. */ -void HUMsg_Ticker(void) +void Hu_LogTicker(void) { int i; @@ -395,7 +399,12 @@ void HUMsg_Ticker(void) } } -void HUMsg_Drawer(int player) +/** + * Draw the message log of the specified player. + * + * @param player Player (local) number whose message log to draw. + */ +void Hu_LogDrawer(int player) { if(cfg.msgShow) { @@ -403,29 +412,52 @@ void HUMsg_Drawer(int player) } } -void HUMsg_PlayerMessage(int player, char* message, int tics, - boolean noHide, boolean yellow) +/** + * Post a message to the specified player's log. + * + * @param player Player (local) number whose log to post to. + * @param flags LMF_* flags + * LMF_NOHIDE: + * Always display this message regardless whether the + * player the message log has been hidden. + * LMF_YELLOW: + * Prepend the YELLOW param string to msg. + * @param msg Message text to be posted. + * @param tics Minimum number of tics (from *now*) the message + * should be visible for. + */ +void Hu_LogPost(int player, byte flags, const char* msg, int tics) { #define YELLOW_FORMAT "{r=1; g=0.7; b=0.3;}" - msglog_t* log = &msgLogs[player]; + player_t* plr; + msglog_t* log; + + if(!msg || !msg[0] || !(tics > 0)) + return; + + if(player < 0 || player >= MAXPLAYERS) + return; - if(!message || !tics) + plr = &players[player]; + if(!((plr->plr->flags & DDPF_LOCAL) && plr->plr->inGame)) return; + log = &msgLogs[player]; + if(!log->notToBeFuckedWith || log->dontFuckWithMe) { char* buf; - if(yellow) + if(flags & LMF_YELLOW) { - buf = malloc((strlen(message)+strlen(YELLOW_FORMAT)+1) * sizeof(char)); - sprintf(buf, YELLOW_FORMAT "%s", message); + buf = malloc((strlen(msg)+strlen(YELLOW_FORMAT)+1) * sizeof(char)); + sprintf(buf, YELLOW_FORMAT "%s", msg); } else { - buf = malloc((strlen(message)+1) * sizeof(char)); - sprintf(buf, "%s", message); + buf = malloc((strlen(msg)+1) * sizeof(char)); + sprintf(buf, "%s", msg); } logPush(log, buf, cfg.msgUptime + tics); @@ -436,17 +468,58 @@ void HUMsg_PlayerMessage(int player, char* message, int tics, #undef YELLOW_FORMAT } -void HUMsg_ClearMessages(int player) +/** + * Rewind the message log of the specified player, making the last few + * messages visible again. + * + * @param player Player (local) number whose message log to refresh. + */ +void Hu_LogRefresh(int player) { - logEmpty(&msgLogs[player]); + uint i; + int n; + player_t* plr; + msglog_t* log; + + if(player < 0 || player >= MAXPLAYERS) + return; + + plr = &players[player]; + if(!((plr->plr->flags & DDPF_LOCAL) && plr->plr->inGame)) + return; + + log = &msgLogs[player]; + log->visible = true; + log->numVisibleMsgs = MIN_OF((unsigned) cfg.msgCount, + MIN_OF(log->msgCount, (unsigned) LOG_MAX_MESSAGES)); + + // Reset the auto-hide timer. + log->timer = LOG_MSG_TIMEOUT; + + // Refresh the messages. + n = log->nextMsg - log->numVisibleMsgs; + if(n < 0) + n += LOG_MAX_MESSAGES; + + for(i = 0; i < log->numVisibleMsgs; ++i) + { + logmsg_t* msg = &log->msgs[n]; + + // Change the tics remaining to that at post time plus a small bonus + // so that they don't all disappear at once. + msg->ticsRemain = msg->tics + i * (TICSPERSEC >> 2); + msg->flags &= ~MF_JUSTADDED; + + n = (n < LOG_MAX_MESSAGES - 1)? n + 1 : 0; + } } /** - * Rewind the log buffer, and make the last few messages visible again. + * Empty the message log of the specified player. * - * @param log Ptr to the msglog to refresh. + * @param player Player (local) number whose message log to empty. */ -void HUMsg_Refresh(int player) +void Hu_LogEmpty(int player) { player_t* plr; msglog_t* log; @@ -459,8 +532,9 @@ void HUMsg_Refresh(int player) return; log = &msgLogs[player]; - log->visible = true; - log->timer = LOG_MSG_TIMEOUT; + + while(log->numVisibleMsgs) + logPop(log); } /**\file diff --git a/doomsday/plugins/common/src/hu_stuff.c b/doomsday/plugins/common/src/hu_stuff.c index 8a1245bc8a..44e32241f6 100644 --- a/doomsday/plugins/common/src/hu_stuff.c +++ b/doomsday/plugins/common/src/hu_stuff.c @@ -442,7 +442,7 @@ void HU_Start(int player) return; Chat_Start(); - HUMsg_Start(); // Why here? + Hu_LogStart(player); hud = &hudStates[player]; if(hud->active) @@ -456,7 +456,7 @@ void HU_Drawer(int player) // Don't draw the message log while the map title is up. if(!(cfg.mapTitle && actualMapTime < 6 * 35)) { - HUMsg_Drawer(player); + Hu_LogDrawer(player); } Chat_Drawer(player); @@ -1178,7 +1178,7 @@ void Hu_Ticker(void) { int i; - HUMsg_Ticker(); + Hu_LogTicker(); for(i = 0; i < MAXPLAYERS; ++i) { diff --git a/doomsday/plugins/common/src/p_player.c b/doomsday/plugins/common/src/p_player.c index 55a14f2437..b560541e5b 100644 --- a/doomsday/plugins/common/src/p_player.c +++ b/doomsday/plugins/common/src/p_player.c @@ -714,7 +714,9 @@ void P_PlayerChangeClass(player_t* player, playerclass_t newClass) */ void P_SetMessage(player_t* pl, char *msg, boolean noHide) { - HUMsg_PlayerMessage(pl - players, msg, MESSAGETICS, noHide, false); + byte flags = (noHide? LMF_NOHIDE : 0); + + Hu_LogPost(pl - players, flags, msg, MESSAGETICS); if(pl == &players[CONSOLEPLAYER] && cfg.echoMsg) Con_FPrintf(CBLF_CYAN, "%s\n", msg); @@ -723,7 +725,7 @@ void P_SetMessage(player_t* pl, char *msg, boolean noHide) NetSv_SendMessage(pl - players, msg); } -#if __JHEXEN__ || __JSTRIFE__ +#if __JHEXEN__ /** * Send a yellow message to the given player and maybe echos it to the console. * @@ -734,7 +736,9 @@ void P_SetMessage(player_t* pl, char *msg, boolean noHide) */ void P_SetYellowMessage(player_t* pl, char *msg, boolean noHide) { - HUMsg_PlayerMessage(pl - players, msg, 5 * MESSAGETICS, noHide, true); + byte flags = LMF_YELLOW | (noHide? LMF_NOHIDE : 0); + + Hu_LogPost(pl - players, flags, msg, 5 * MESSAGETICS); if(pl == &players[CONSOLEPLAYER] && cfg.echoMsg) Con_FPrintf(CBLF_CYAN, "%s\n", msg); diff --git a/doomsday/plugins/common/src/p_saveg.c b/doomsday/plugins/common/src/p_saveg.c index 1db31727ff..596c0ab38e 100644 --- a/doomsday/plugins/common/src/p_saveg.c +++ b/doomsday/plugins/common/src/p_saveg.c @@ -5495,7 +5495,7 @@ void SV_MapTeleport(int map, int position) } P_InventorySetReadyItem(i, readyItem[i]); - HUMsg_ClearMessages(i); + Hu_LogEmpty(i); players[i].attacker = NULL; players[i].poisoner = NULL; diff --git a/doomsday/plugins/common/src/p_user.c b/doomsday/plugins/common/src/p_user.c index 60520bfdce..593602e6c3 100644 --- a/doomsday/plugins/common/src/p_user.c +++ b/doomsday/plugins/common/src/p_user.c @@ -1428,7 +1428,7 @@ void P_PlayerThinkHUD(player_t* player) HU_ScoreBoardUnHide(player - players); if(brain->logRefresh) - HUMsg_Refresh(player - players); + Hu_LogRefresh(player - players); } void P_PlayerThinkMap(player_t* player) diff --git a/doomsday/plugins/jdoom/data/conhelp.txt b/doomsday/plugins/jdoom/data/conhelp.txt index e4db476bfb..2f869fe12a 100644 --- a/doomsday/plugins/jdoom/data/conhelp.txt +++ b/doomsday/plugins/jdoom/data/conhelp.txt @@ -300,9 +300,6 @@ desc = 1=Show messages. [msg-echo] desc = 1=Echo all messages to the console. -[msg-secret] -desc = 1=Announce the discovery of secret areas. - [msg-count] desc = Number of HUD messages displayed at the same time. @@ -726,6 +723,9 @@ desc = Scale for player weapon bobbing. [view-bob-weapon-switch-lower] desc = HUD weapon lowered during weapon switching. +[server-game-announce-secret] +desc = 1=Announce the discovery of secret areas. + [server-game-skill] desc = Skill level in multiplayer games. diff --git a/doomsday/plugins/jdoom/src/d_console.c b/doomsday/plugins/jdoom/src/d_console.c index 32a73c270a..81e661b17a 100644 --- a/doomsday/plugins/jdoom/src/d_console.c +++ b/doomsday/plugins/jdoom/src/d_console.c @@ -136,6 +136,7 @@ cvar_t gameCVars[] = { // Misc {"server-game-deathmatch-killmsg", 0, CVT_BYTE, &cfg.killMessages, 0, 1}, + {"server-game-announce-secret", 0, CVT_BYTE, &cfg.secretMsg, 0, 1}, // Player // Player data @@ -194,6 +195,7 @@ cvar_t gameCVars[] = { {"game-corpse-time", CVF_NO_MAX, CVT_INT, &cfg.corpseTime, 0, 0}, // Misc + {"msg-echo", 0, CVT_BYTE, &cfg.echoMsg, 0, 1}, {NULL} }; diff --git a/doomsday/plugins/jdoom/src/d_main.c b/doomsday/plugins/jdoom/src/d_main.c index 80901a8cc5..79b236e5cd 100644 --- a/doomsday/plugins/jdoom/src/d_main.c +++ b/doomsday/plugins/jdoom/src/d_main.c @@ -700,13 +700,9 @@ void G_PostInit(void) void G_Shutdown(void) { - uint i; - Hu_MsgShutdown(); Hu_UnloadData(); - - for(i = 0; i < MAXPLAYERS; ++i) - HUMsg_ClearMessages(i); + Hu_LogShutdown(); P_DestroyIterList(spechit); P_DestroyIterList(linespecials); diff --git a/doomsday/plugins/jdoom64/data/conhelp.txt b/doomsday/plugins/jdoom64/data/conhelp.txt index 403c9e59a3..5782632c72 100644 --- a/doomsday/plugins/jdoom64/data/conhelp.txt +++ b/doomsday/plugins/jdoom64/data/conhelp.txt @@ -296,9 +296,6 @@ desc = 1=Show messages. [msg-echo] desc = 1=Echo all messages to the console. -[msg-secret] -desc = 1=Announce the discovery of secret areas. - [msg-count] desc = Number of HUD messages displayed at the same time. @@ -725,6 +722,9 @@ desc = Scale for player weapon bobbing. [view-bob-weapon-switch-lower] desc = HUD weapon lowered during weapon switching. +[server-game-announce-secret] +desc = 1=Announce the discovery of secret areas. + [server-game-skill] desc = Skill level in multiplayer games. diff --git a/doomsday/plugins/jdoom64/src/d_console.c b/doomsday/plugins/jdoom64/src/d_console.c index 5c4e9c2d5b..04e19fe7fe 100644 --- a/doomsday/plugins/jdoom64/src/d_console.c +++ b/doomsday/plugins/jdoom64/src/d_console.c @@ -136,6 +136,7 @@ cvar_t gameCVars[] = { // Misc {"server-game-deathmatch-killmsg", 0, CVT_BYTE, &cfg.killMessages, 0, 1}, + {"server-game-announce-secret", 0, CVT_BYTE, &cfg.secretMsg, 0, 1}, // Player // Player data @@ -194,6 +195,7 @@ cvar_t gameCVars[] = { {"game-corpse-time", CVF_NO_MAX, CVT_INT, &cfg.corpseTime, 0, 0}, // Misc + {"msg-echo", 0, CVT_BYTE, &cfg.echoMsg, 0, 1}, {NULL} }; diff --git a/doomsday/plugins/jdoom64/src/d_main.c b/doomsday/plugins/jdoom64/src/d_main.c index 043d661cd5..acab46a897 100644 --- a/doomsday/plugins/jdoom64/src/d_main.c +++ b/doomsday/plugins/jdoom64/src/d_main.c @@ -536,13 +536,9 @@ void G_PostInit(void) void G_Shutdown(void) { - uint i; - Hu_MsgShutdown(); Hu_UnloadData(); - - for(i = 0; i < MAXPLAYERS; ++i) - HUMsg_ClearMessages(i); + Hu_LogShutdown(); P_DestroyIterList(spechit); P_DestroyIterList(linespecials); diff --git a/doomsday/plugins/jheretic/data/conhelp.txt b/doomsday/plugins/jheretic/data/conhelp.txt index ea5e3ec3f4..a8bbff77f0 100644 --- a/doomsday/plugins/jheretic/data/conhelp.txt +++ b/doomsday/plugins/jheretic/data/conhelp.txt @@ -306,9 +306,6 @@ desc = 1=Show messages. [msg-echo] desc = 1=Echo all messages to the console. -[msg-secret] -desc = 1=Announce the discovery of secret areas. - [msg-count] desc = Number of HUD messages displayed at the same time. @@ -687,6 +684,9 @@ desc = HUD weapon lowered during weapon switching. [view-ringfilter] desc = Ring effect filter. 1=Brownish, 2=Blue. +[server-game-announce-secret] +desc = 1=Announce the discovery of secret areas. + [server-game-skill] desc = Skill level in multiplayer games. diff --git a/doomsday/plugins/jheretic/src/h_console.c b/doomsday/plugins/jheretic/src/h_console.c index cbe7238ab3..9e9b4a6b1b 100644 --- a/doomsday/plugins/jheretic/src/h_console.c +++ b/doomsday/plugins/jheretic/src/h_console.c @@ -127,6 +127,9 @@ cvar_t gameCVars[] = { {"server-game-coop-nodamage", 0, CVT_BYTE, &cfg.noCoopDamage, 0, 1}, {"server-game-noteamdamage", 0, CVT_BYTE, &cfg.noTeamDamage, 0, 1}, + // Misc + {"server-game-announce-secret", 0, CVT_BYTE, &cfg.secretMsg, 0, 1}, + // Player // Player data {"player-color", 0, CVT_BYTE, &cfg.netColor, 0, 4}, @@ -178,6 +181,7 @@ cvar_t gameCVars[] = { {"game-corpse-time", CVF_NO_MAX, CVT_INT, &cfg.corpseTime, 0, 0}, // Misc + {"msg-echo", 0, CVT_BYTE, &cfg.echoMsg, 0, 1}, {NULL} }; diff --git a/doomsday/plugins/jheretic/src/h_main.c b/doomsday/plugins/jheretic/src/h_main.c index 65f33e7dfa..f021ca1b7a 100644 --- a/doomsday/plugins/jheretic/src/h_main.c +++ b/doomsday/plugins/jheretic/src/h_main.c @@ -580,13 +580,9 @@ void G_PostInit(void) void G_Shutdown(void) { - uint i; - Hu_MsgShutdown(); Hu_UnloadData(); - - for(i = 0; i < MAXPLAYERS; ++i) - HUMsg_ClearMessages(i); + Hu_LogShutdown(); P_DestroyIterList(spechit); P_DestroyIterList(linespecials); diff --git a/doomsday/plugins/jhexen/src/h2_main.c b/doomsday/plugins/jhexen/src/h2_main.c index e749b82c84..2da5b4cde7 100644 --- a/doomsday/plugins/jhexen/src/h2_main.c +++ b/doomsday/plugins/jhexen/src/h2_main.c @@ -618,13 +618,9 @@ static void execOptionDevMaps(char **args, int tag) void G_Shutdown(void) { - uint i; - Hu_MsgShutdown(); Hu_UnloadData(); - - for(i = 0; i < MAXPLAYERS; ++i) - HUMsg_ClearMessages(i); + Hu_LogShutdown(); P_DestroyIterList(spechit); P_DestroyIterList(linespecials); diff --git a/doomsday/plugins/jhexen/src/hconsole.c b/doomsday/plugins/jhexen/src/hconsole.c index b8d2fac2b9..61df9bed41 100644 --- a/doomsday/plugins/jhexen/src/hconsole.c +++ b/doomsday/plugins/jhexen/src/hconsole.c @@ -124,6 +124,9 @@ cvar_t gameCVars[] = { {"server-game-monster-meleeattack-nomaxz", 0, CVT_BYTE, &cfg.netNoMaxZMonsterMeleeAttack, 0, 1}, + // Misc + {"msg-hub-override", 0, CVT_BYTE, &cfg.overrideHubMsg, 0, 2}, + // Player // Player data {"player-color", 0, CVT_BYTE, &cfg.netColor, 0, 8}, @@ -162,6 +165,8 @@ cvar_t gameCVars[] = { // Gameplay {"game-maulator-time", CVF_NO_MAX, CVT_INT, &maulatorSeconds, 1, 0}, +// Misc + {"msg-echo", 0, CVT_BYTE, &cfg.echoMsg, 0, 1}, {NULL} };