summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-12-14 15:00:43 +0000
committerrubidium <rubidium@openttd.org>2010-12-14 15:00:43 +0000
commitb149fcd1271405844bd15e353a25657cbed85be3 (patch)
tree14892b5b421b5db45d0006fd6325b4836cb12ac9
parente68efb9e719a028f14da9965d4e3795252b2cbad (diff)
downloadopenttd-b149fcd1271405844bd15e353a25657cbed85be3.tar.xz
(svn r21513) -Feature [FS#532]: make the chat message timeout user configurable
-rw-r--r--src/network/network.cpp4
-rw-r--r--src/settings_type.h1
-rw-r--r--src/table/settings.h1
3 files changed, 3 insertions, 3 deletions
diff --git a/src/network/network.cpp b/src/network/network.cpp
index 4e3fb53b4..510d92a82 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 9fc02a43a..ae9b1bcd8 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 f525a0c1a..b12efcc4c 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),