mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-12 18:40:29 +00:00
(svn r21513) -Feature [FS#532]: make the chat message timeout user configurable
This commit is contained in:
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 */
|
* 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)
|
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;
|
StringID strid;
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case NETWORK_ACTION_SERVER_MESSAGE:
|
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);
|
DEBUG(desync, 1, "msg: %08x; %02x; %s", _date, _date_fract, message);
|
||||||
IConsolePrintF(colour, "%s", 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 */
|
/* Calculate the frame-lag of a client */
|
||||||
|
@ -106,6 +106,7 @@ struct GUISettings {
|
|||||||
#ifdef ENABLE_NETWORK
|
#ifdef ENABLE_NETWORK
|
||||||
uint16 network_chat_box_width; ///< width of the chat box in pixels
|
uint16 network_chat_box_width; ///< width of the chat box in pixels
|
||||||
uint8 network_chat_box_height; ///< height of the chat box in lines
|
uint8 network_chat_box_height; ///< height of the chat box in lines
|
||||||
|
uint16 network_chat_timeout; ///< timeout of chat messages in seconds
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
uint8 developer; ///< print non-fatal warnings in console (>= 1), copy debug output to console (== 2)
|
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
|
#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_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_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.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),
|
SDTC_VAR(network.frame_freq, SLE_UINT8,C|S,NO, 0, 0, 100, 0, STR_NULL, NULL),
|
||||||
|
Loading…
Reference in New Issue
Block a user