mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-19 12:39:11 +00:00
(svn r15428) -Codechange: consistently use colour instead of having both color and colour.
This commit is contained in:
@@ -60,7 +60,7 @@ static inline uint GetChatMessageCount()
|
||||
|
||||
/**
|
||||
* Add a text message to the 'chat window' to be shown
|
||||
* @param color The colour this message is to be shown in
|
||||
* @param colour The colour this message is to be shown in
|
||||
* @param duration The duration of the chat message in game-days
|
||||
* @param message message itself in printf() style
|
||||
*/
|
||||
@@ -96,7 +96,7 @@ void CDECL NetworkAddChatMessage(TextColour colour, uint8 duration, const char *
|
||||
|
||||
/* The default colour for a message is company colour. Replace this with
|
||||
* white for any additional lines */
|
||||
cmsg->colour = (bufp == buf && colour & IS_PALETTE_COLOR) ? colour : (TextColour)(0x1D - 15) | IS_PALETTE_COLOR;
|
||||
cmsg->colour = (bufp == buf && colour & IS_PALETTE_COLOUR) ? colour : (TextColour)(0x1D - 15) | IS_PALETTE_COLOUR;
|
||||
cmsg->end_date = _date + duration;
|
||||
|
||||
bufp += strlen(bufp) + 1; // jump to 'next line' in the formatted string
|
||||
@@ -232,7 +232,7 @@ void NetworkDrawChatMessage()
|
||||
_screen.height - _chatmsg_box.y - count * NETWORK_CHAT_LINE_HEIGHT - 2,
|
||||
_chatmsg_box.x + _chatmsg_box.width - 1,
|
||||
_screen.height - _chatmsg_box.y - 2,
|
||||
PALETTE_TO_TRANSPARENT, FILLRECT_RECOLOR // black, but with some alpha for background
|
||||
PALETTE_TO_TRANSPARENT, FILLRECT_RECOLOUR // black, but with some alpha for background
|
||||
);
|
||||
|
||||
/* Paint the chat messages starting with the lowest at the bottom */
|
||||
|
@@ -741,7 +741,7 @@ DEF_CLIENT_RECEIVE_COMMAND(PACKET_SERVER_CHAT)
|
||||
}
|
||||
|
||||
if (ci != NULL)
|
||||
NetworkTextMessage(action, (ConsoleColour)GetDrawStringCompanyColor(ci->client_playas), self_send, name, msg, data);
|
||||
NetworkTextMessage(action, (ConsoleColour)GetDrawStringCompanyColour(ci->client_playas), self_send, name, msg, data);
|
||||
return NETWORK_RECV_STATUS_OKAY;
|
||||
}
|
||||
|
||||
@@ -816,10 +816,10 @@ DEF_CLIENT_RECEIVE_COMMAND(PACKET_SERVER_RCON)
|
||||
{
|
||||
char rcon_out[NETWORK_RCONCOMMAND_LENGTH];
|
||||
|
||||
ConsoleColour color_code = (ConsoleColour)p->Recv_uint16();
|
||||
ConsoleColour colour_code = (ConsoleColour)p->Recv_uint16();
|
||||
p->Recv_string(rcon_out, sizeof(rcon_out));
|
||||
|
||||
IConsolePrint(color_code, rcon_out);
|
||||
IConsolePrint(colour_code, rcon_out);
|
||||
|
||||
return NETWORK_RECV_STATUS_OKAY;
|
||||
}
|
||||
|
@@ -917,7 +917,7 @@ struct NetworkStartServerWindow : public QueryStringBaseWindow {
|
||||
if (pos == 0) {
|
||||
DrawString(14, y, STR_4010_GENERATE_RANDOM_NEW_GAME, TC_DARK_GREEN);
|
||||
} else {
|
||||
DoDrawString(item->title, 14, y, _fios_colors[item->type] );
|
||||
DoDrawString(item->title, 14, y, _fios_colours[item->type] );
|
||||
}
|
||||
y += NSSWND_ROWSIZE;
|
||||
|
||||
|
@@ -148,7 +148,7 @@ void NetworkFreeLocalCommandQueue();
|
||||
|
||||
// from network.c
|
||||
void NetworkCloseClient(NetworkClientSocket *cs);
|
||||
void NetworkTextMessage(NetworkAction action, ConsoleColour color, bool self_send, const char *name, const char *str = "", int64 data = 0);
|
||||
void NetworkTextMessage(NetworkAction action, ConsoleColour colour, bool self_send, const char *name, const char *str = "", int64 data = 0);
|
||||
void NetworkGetClientName(char *clientname, size_t size, const NetworkClientSocket *cs);
|
||||
uint NetworkCalculateLag(const NetworkClientSocket *cs);
|
||||
byte NetworkGetCurrentLanguageIndex();
|
||||
|
@@ -572,11 +572,11 @@ DEF_SERVER_SEND_COMMAND(PACKET_SERVER_NEWGAME)
|
||||
cs->Send_Packet(p);
|
||||
}
|
||||
|
||||
DEF_SERVER_SEND_COMMAND_PARAM(PACKET_SERVER_RCON)(NetworkClientSocket *cs, uint16 color, const char *command)
|
||||
DEF_SERVER_SEND_COMMAND_PARAM(PACKET_SERVER_RCON)(NetworkClientSocket *cs, uint16 colour, const char *command)
|
||||
{
|
||||
Packet *p = NetworkSend_Init(PACKET_SERVER_RCON);
|
||||
|
||||
p->Send_uint16(color);
|
||||
p->Send_uint16(colour);
|
||||
p->Send_string(command);
|
||||
cs->Send_Packet(p);
|
||||
}
|
||||
@@ -1044,7 +1044,7 @@ void NetworkServerSendChat(NetworkAction action, DestType desttype, int dest, co
|
||||
ci = NetworkFindClientInfoFromClientID(from_id);
|
||||
/* Display the text locally, and that is it */
|
||||
if (ci != NULL)
|
||||
NetworkTextMessage(action, (ConsoleColour)GetDrawStringCompanyColor(ci->client_playas), false, ci->client_name, msg, data);
|
||||
NetworkTextMessage(action, (ConsoleColour)GetDrawStringCompanyColour(ci->client_playas), false, ci->client_name, msg, data);
|
||||
} else {
|
||||
/* Else find the client to send the message to */
|
||||
FOR_ALL_CLIENT_SOCKETS(cs) {
|
||||
@@ -1061,7 +1061,7 @@ void NetworkServerSendChat(NetworkAction action, DestType desttype, int dest, co
|
||||
ci = NetworkFindClientInfoFromClientID(from_id);
|
||||
ci_to = NetworkFindClientInfoFromClientID((ClientID)dest);
|
||||
if (ci != NULL && ci_to != NULL)
|
||||
NetworkTextMessage(action, (ConsoleColour)GetDrawStringCompanyColor(ci->client_playas), true, ci_to->client_name, msg, data);
|
||||
NetworkTextMessage(action, (ConsoleColour)GetDrawStringCompanyColour(ci->client_playas), true, ci_to->client_name, msg, data);
|
||||
} else {
|
||||
FOR_ALL_CLIENT_SOCKETS(cs) {
|
||||
if (cs->client_id == from_id) {
|
||||
@@ -1089,7 +1089,7 @@ void NetworkServerSendChat(NetworkAction action, DestType desttype, int dest, co
|
||||
ci = NetworkFindClientInfoFromClientID(from_id);
|
||||
ci_own = NetworkFindClientInfoFromClientID(CLIENT_ID_SERVER);
|
||||
if (ci != NULL && ci_own != NULL && ci_own->client_playas == dest) {
|
||||
NetworkTextMessage(action, (ConsoleColour)GetDrawStringCompanyColor(ci->client_playas), false, ci->client_name, msg, data);
|
||||
NetworkTextMessage(action, (ConsoleColour)GetDrawStringCompanyColour(ci->client_playas), false, ci->client_name, msg, data);
|
||||
if (from_id == CLIENT_ID_SERVER) show_local = false;
|
||||
ci_to = ci_own;
|
||||
}
|
||||
@@ -1104,7 +1104,7 @@ void NetworkServerSendChat(NetworkAction action, DestType desttype, int dest, co
|
||||
StringID str = IsValidCompanyID(ci_to->client_playas) ? STR_COMPANY_NAME : STR_NETWORK_SPECTATORS;
|
||||
SetDParam(0, ci_to->client_playas);
|
||||
GetString(name, str, lastof(name));
|
||||
NetworkTextMessage(action, (ConsoleColour)GetDrawStringCompanyColor(ci_own->client_playas), true, name, msg, data);
|
||||
NetworkTextMessage(action, (ConsoleColour)GetDrawStringCompanyColour(ci_own->client_playas), true, name, msg, data);
|
||||
} else {
|
||||
FOR_ALL_CLIENT_SOCKETS(cs) {
|
||||
if (cs->client_id == from_id) {
|
||||
@@ -1124,7 +1124,7 @@ void NetworkServerSendChat(NetworkAction action, DestType desttype, int dest, co
|
||||
}
|
||||
ci = NetworkFindClientInfoFromClientID(from_id);
|
||||
if (ci != NULL)
|
||||
NetworkTextMessage(action, (ConsoleColour)GetDrawStringCompanyColor(ci->client_playas), false, ci->client_name, msg, data);
|
||||
NetworkTextMessage(action, (ConsoleColour)GetDrawStringCompanyColour(ci->client_playas), false, ci->client_name, msg, data);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@@ -12,7 +12,7 @@ DEF_SERVER_SEND_COMMAND_PARAM(PACKET_SERVER_ERROR_QUIT)(NetworkClientSocket *cs,
|
||||
DEF_SERVER_SEND_COMMAND_PARAM(PACKET_SERVER_ERROR)(NetworkClientSocket *cs, NetworkErrorCode error);
|
||||
DEF_SERVER_SEND_COMMAND(PACKET_SERVER_SHUTDOWN);
|
||||
DEF_SERVER_SEND_COMMAND(PACKET_SERVER_NEWGAME);
|
||||
DEF_SERVER_SEND_COMMAND_PARAM(PACKET_SERVER_RCON)(NetworkClientSocket *cs, uint16 color, const char *command);
|
||||
DEF_SERVER_SEND_COMMAND_PARAM(PACKET_SERVER_RCON)(NetworkClientSocket *cs, uint16 colour, const char *command);
|
||||
DEF_SERVER_SEND_COMMAND_PARAM(PACKET_SERVER_MOVE)(NetworkClientSocket *cs, uint16 client_id, CompanyID company_id);
|
||||
|
||||
bool NetworkServer_ReadPackets(NetworkClientSocket *cs);
|
||||
|
Reference in New Issue
Block a user