From 30e78752a9526dfa1074b1138ee45b260b1c8cf4 Mon Sep 17 00:00:00 2001 From: rubidium Date: Tue, 14 Dec 2010 15:00:43 +0000 Subject: [PATCH] (svn r21513) -Feature [FS#532]: make the chat message timeout user configurable --- src/network/network.cpp | 4 +--- src/settings_type.h | 1 + src/table/settings.h | 1 + 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/network/network.cpp b/src/network/network.cpp index 4e3fb53b4a..510d92a824 100644 --- a/src/network/network.cpp +++ b/src/network/network.cpp @@ -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 */ diff --git a/src/settings_type.h b/src/settings_type.h index 9fc02a43a3..ae9b1bcd8e 100644 --- a/src/settings_type.h +++ b/src/settings_type.h @@ -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) diff --git a/src/table/settings.h b/src/table/settings.h index f525a0c1a8..b12efcc4c8 100644 --- a/src/table/settings.h +++ b/src/table/settings.h @@ -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),