diff options
author | Patric Stout <truebrain@openttd.org> | 2021-01-05 18:06:48 +0100 |
---|---|---|
committer | Patric Stout <github@truebrain.nl> | 2021-01-05 21:56:24 +0100 |
commit | 62cdadb58207b28dfdf1ab4ceb46278c2561f079 (patch) | |
tree | d6e8308cf106daf372ad673d87169f075d3c3a86 /src/network/network_gui.cpp | |
parent | d6e15d4943936a89d275354ee59d0e3b7c6a2018 (diff) | |
download | openttd-62cdadb58207b28dfdf1ab4ceb46278c2561f079.tar.xz |
Change: move "give money" from client-list to company window
This is a much better location for this button, as you send
money from one company to another company, not from player
to player.
This is based on work done by JGRPP in:
https://github.com/JGRennison/OpenTTD-patches/commit/f82054339124cc6b89c5f4f9dac2d9da62f0108b
and surrounding commits, which took the work from estys:
https://www.tt-forums.net/viewtopic.php?p=1183311#p1183311
We did modify it to fix several bugs and clean up the code while
here anyway.
The callback was removed, as it meant a modified client could
prevent anyone from seeing money was transfered. The message
is now generated in the command itself, making that impossible.
Diffstat (limited to 'src/network/network_gui.cpp')
-rw-r--r-- | src/network/network_gui.cpp | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp index cd57e9af9..13e6fbe8f 100644 --- a/src/network/network_gui.cpp +++ b/src/network/network_gui.cpp @@ -1632,8 +1632,7 @@ NetworkCompanyInfo *GetLobbyCompanyInfo(CompanyID company) } /* The window below gives information about the connected clients - * and also makes able to give money to them, kick them (if server) - * and stuff like that. */ + * and also makes able to kick them (if server) and stuff like that. */ extern void DrawCompanyIcon(CompanyID cid, int x, int y); @@ -1665,11 +1664,6 @@ static void ClientList_Ban(const NetworkClientInfo *ci) NetworkServerKickOrBanIP(ci->client_id, true, nullptr); } -static void ClientList_GiveMoney(const NetworkClientInfo *ci) -{ - ShowNetworkGiveMoneyWindow(ci->client_playas); -} - static void ClientList_SpeakToClient(const NetworkClientInfo *ci) { ShowNetworkChatQueryWindow(DESTTYPE_CLIENT, ci->client_id); @@ -1726,13 +1720,6 @@ struct NetworkClientListPopupWindow : Window { } this->AddAction(STR_NETWORK_CLIENTLIST_SPEAK_TO_ALL, &ClientList_SpeakToAll); - if (_network_own_client_id != ci->client_id) { - /* We are no spectator and the company we want to give money to is no spectator and money gifts are allowed. */ - if (Company::IsValidID(_local_company) && Company::IsValidID(ci->client_playas) && _settings_game.economy.give_money) { - this->AddAction(STR_NETWORK_CLIENTLIST_GIVE_MONEY, &ClientList_GiveMoney); - } - } - /* A server can kick clients (but not himself). */ if (_network_server && _network_own_client_id != ci->client_id) { this->AddAction(STR_NETWORK_CLIENTLIST_KICK, &ClientList_Kick); |