(svn r21513) -Feature [FS#532]: make the chat message timeout user configurable

replace/41b28d7194a279bdc17475d4fbe2ea6ec885a466
rubidium 14 years ago
parent e68efb9e71
commit b149fcd127

@ -165,8 +165,6 @@ bool NetworkCompanyIsPassworded(CompanyID company_id)
* If 'self_send' is true, this is the client who is sending the message */
void NetworkTextMessage(NetworkAction action, ConsoleColour colour, bool self_send, const char *name, const char *str, int64 data)
{
const int duration = 20; // Seconds the messages stay visible
StringID strid;
switch (action) {
case NETWORK_ACTION_SERVER_MESSAGE:
@ -212,7 +210,7 @@ void NetworkTextMessage(NetworkAction action, ConsoleColour colour, bool self_se
DEBUG(desync, 1, "msg: %08x; %02x; %s", _date, _date_fract, message);
IConsolePrintF(colour, "%s", message);
NetworkAddChatMessage((TextColour)colour, duration, "%s", message);
NetworkAddChatMessage((TextColour)colour, _settings_client.gui.network_chat_timeout, "%s", message);
}
/* Calculate the frame-lag of a client */

@ -106,6 +106,7 @@ struct GUISettings {
#ifdef ENABLE_NETWORK
uint16 network_chat_box_width; ///< width of the chat box in pixels
uint8 network_chat_box_height; ///< height of the chat box in lines
uint16 network_chat_timeout; ///< timeout of chat messages in seconds
#endif
uint8 developer; ///< print non-fatal warnings in console (>= 1), copy debug output to console (== 2)

@ -629,6 +629,7 @@ const SettingDesc _settings[] = {
#ifdef ENABLE_NETWORK
SDTC_VAR(gui.network_chat_box_width, SLE_UINT16, S, 0, 620, 200, 65535, 0, STR_NULL, NULL),
SDTC_VAR(gui.network_chat_box_height, SLE_UINT8, S, 0, 25, 5, 255, 0, STR_NULL, NULL),
SDTC_VAR(gui.network_chat_timeout, SLE_UINT16, S, 0, 20, 1, 65535, 0, STR_NULL, NULL),
SDTC_VAR(network.sync_freq, SLE_UINT16,C|S,NO, 100, 0, 100, 0, STR_NULL, NULL),
SDTC_VAR(network.frame_freq, SLE_UINT8,C|S,NO, 0, 0, 100, 0, STR_NULL, NULL),

Loading…
Cancel
Save