diff options
author | rubidium <rubidium@openttd.org> | 2009-01-23 23:56:56 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-01-23 23:56:56 +0000 |
commit | bf45d44c3cda7dac3803a357651a9e9d7bf78da7 (patch) | |
tree | 4891041b23d185cf14561a1feac26d342dce106c /src | |
parent | 0909d9f4c4e57af715aa9e150ff328123decb8b9 (diff) | |
download | openttd-bf45d44c3cda7dac3803a357651a9e9d7bf78da7.tar.xz |
(svn r15247) -Change: show a lock near the password/join button in the company window whenever the company is password protected
Diffstat (limited to 'src')
-rw-r--r-- | src/company_gui.cpp | 8 | ||||
-rw-r--r-- | src/network/network_client.cpp | 1 | ||||
-rw-r--r-- | src/network/network_server.cpp | 2 |
3 files changed, 10 insertions, 1 deletions
diff --git a/src/company_gui.cpp b/src/company_gui.cpp index 1e65834bd..9f9339f05 100644 --- a/src/company_gui.cpp +++ b/src/company_gui.cpp @@ -1071,7 +1071,7 @@ static const Widget _company_widgets[] = { { WWT_PUSHTXTBTN, RESIZE_NONE, COLOUR_GREY, 0, 179, 158, 169, STR_7077_BUY_25_SHARE_IN_COMPANY, STR_7079_BUY_25_SHARE_IN_THIS_COMPANY}, { WWT_PUSHTXTBTN, RESIZE_NONE, COLOUR_GREY, 180, 359, 158, 169, STR_7078_SELL_25_SHARE_IN_COMPANY, STR_707A_SELL_25_SHARE_IN_THIS_COMPANY}, { WWT_PUSHTXTBTN, RESIZE_NONE, COLOUR_GREY, 266, 355, 138, 149, STR_COMPANY_PASSWORD, STR_COMPANY_PASSWORD_TOOLTIP}, -{ WWT_PUSHTXTBTN, RESIZE_NONE, COLOUR_GREY, 266, 355, 46, 57, STR_COMPANY_JOIN, STR_COMPANY_JOIN_TIP}, +{ WWT_PUSHTXTBTN, RESIZE_NONE, COLOUR_GREY, 266, 355, 138, 149, STR_COMPANY_JOIN, STR_COMPANY_JOIN_TIP}, { WIDGETS_END}, }; @@ -1217,6 +1217,12 @@ struct CompanyWindow : Window this->DrawWidgets(); +#ifdef ENABLE_NETWORK + if (_networking && NetworkCompanyIsPassworded(c->index)) { + DrawSprite(SPR_LOCK, PAL_NONE, this->widget[CW_WIDGET_COMPANY_JOIN].left - 10, this->widget[CW_WIDGET_COMPANY_JOIN].top + 2); + } +#endif /* ENABLE_NETWORK */ + /* Company manager's face */ DrawCompanyManagerFace(c->face, c->colour, 2, 16); diff --git a/src/network/network_client.cpp b/src/network/network_client.cpp index 28be67608..59a0b3922 100644 --- a/src/network/network_client.cpp +++ b/src/network/network_client.cpp @@ -872,6 +872,7 @@ DEF_CLIENT_RECEIVE_COMMAND(PACKET_SERVER_CONFIG_UPDATE) DEF_CLIENT_RECEIVE_COMMAND(PACKET_SERVER_COMPANY_UPDATE) { _network_company_passworded = p->Recv_uint16(); + InvalidateWindowClasses(WC_COMPANY); return NETWORK_RECV_STATUS_OKAY; } diff --git a/src/network/network_server.cpp b/src/network/network_server.cpp index 647358ecf..f33714f0b 100644 --- a/src/network/network_server.cpp +++ b/src/network/network_server.cpp @@ -28,6 +28,7 @@ #include "../company_func.h" #include "../company_gui.h" #include "../settings_type.h" +#include "../window_func.h" #include "table/strings.h" @@ -1720,6 +1721,7 @@ void NetworkServerUpdateCompanyPassworded(CompanyID company_id, bool passworded) if (NetworkCompanyIsPassworded(company_id) == passworded) return; SB(_network_company_passworded, company_id, 1, !!passworded); + InvalidateWindowClasses(WC_COMPANY); NetworkClientSocket *cs; FOR_ALL_CLIENT_SOCKETS(cs) { |