diff options
author | darkvater <darkvater@openttd.org> | 2005-01-06 18:54:13 +0000 |
---|---|---|
committer | darkvater <darkvater@openttd.org> | 2005-01-06 18:54:13 +0000 |
commit | deabdb666fb3e1c87e8eb2cd40892e2283eb3041 (patch) | |
tree | 5e04f9fe7cc3b83fb2400ed4044e4f954fd19b5c | |
parent | 57aebadb15d539237a0d3c83eb89a41a93d5c2b2 (diff) | |
download | openttd-deabdb666fb3e1c87e8eb2cd40892e2283eb3041.tar.xz |
(svn r1404) -Fix: Company password no longer shares a widget with buying shares
-rw-r--r-- | player_gui.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/player_gui.c b/player_gui.c index c03d6a1bc..74cb7c817 100644 --- a/player_gui.c +++ b/player_gui.c @@ -372,7 +372,9 @@ static const Widget _my_player_company_widgets[] = { { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 180, 269, 158, 169, STR_7009_PRESIDENT_NAME, STR_7032_CHANGE_THE_PRESIDENT_S}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 270, 359, 158, 169, STR_7008_COMPANY_NAME, STR_7033_CHANGE_THE_COMPANY_NAME}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 266, 355, 18, 29, STR_706F_BUILD_HQ, STR_7070_BUILD_COMPANY_HEADQUARTERS}, -{ WWT_EMPTY, RESIZE_NONE, 14, 266, 355, 32, 43, 0x0, STR_NULL}, +{ WWT_EMPTY, RESIZE_NONE, 14, 0, 355, 32, 43, 0x0, STR_NULL}, +{ WWT_EMPTY, RESIZE_NONE, 14, 0, 355, 32, 43, 0x0, STR_NULL}, +{ WWT_EMPTY, RESIZE_NONE, 14, 0, 355, 32, 43, 0x0, STR_NULL}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 266, 355, 138, 149, STR_COMPANY_PASSWORD, STR_COMPANY_PASSWORD_TOOLTIP}, { WIDGETS_END}, }; @@ -402,6 +404,8 @@ static const Widget _my_player_company_bh_widgets[] = { { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 270, 359, 158, 169, STR_7008_COMPANY_NAME, STR_7033_CHANGE_THE_COMPANY_NAME}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 266, 355, 18, 29, STR_7072_VIEW_HQ, STR_7070_BUILD_COMPANY_HEADQUARTERS}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 266, 355, 32, 43, STR_RELOCATE_HQ, STR_RELOCATE_COMPANY_HEADQUARTERS}, +{ WWT_EMPTY, RESIZE_NONE, 14, 0, 355, 32, 43, 0x0, STR_NULL}, +{ WWT_EMPTY, RESIZE_NONE, 14, 0, 355, 32, 43, 0x0, STR_NULL}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 266, 355, 138, 149, STR_COMPANY_PASSWORD, STR_COMPANY_PASSWORD_TOOLTIP}, { WIDGETS_END}, }; @@ -502,7 +506,7 @@ static void PlayerCompanyWndProc(Window *w, WindowEvent *e) if (!IsWindowOfPrototype(w, _other_player_company_widgets)) { AssignWidgetToWindow(w, (p->location_of_house != 0) ? _my_player_company_bh_widgets : _my_player_company_widgets); - if (!_networking) w->hidden_state |= (1 << 9); // hide company-password widget + if (!_networking) w->hidden_state |= (1 << 11); // hide company-password widget } else { if (GetAmountOwnedBy(p, OWNER_SPECTATOR) == 0) dis |= 1 << 9; // Also disable the buy button if 25% is not-owned by someone @@ -589,7 +593,14 @@ static void PlayerCompanyWndProc(Window *w, WindowEvent *e) SetObjectToPlaceWnd(0x2D0, 1, w); SetTileSelectSize(2, 2); break; - case 9: {/* buy 25% or password protect your company */ + case 9: /* buy 25% */ + DoCommandP(0, w->window_number, 0, NULL, CMD_BUY_SHARE_IN_COMPANY | CMD_MSG(STR_707B_CAN_T_BUY_25_SHARE_IN_THIS)); + break; + + case 10: /* sell 25% */ + DoCommandP(0, w->window_number, 0, NULL, CMD_SELL_SHARE_IN_COMPANY | CMD_MSG(STR_707C_CAN_T_SELL_25_SHARE_IN)); + break; + case 11: { /* Password protect company */ #ifdef ENABLE_NETWORK if (!IsWindowOfPrototype(w, _other_player_company_widgets)) { StringID str; @@ -597,17 +608,10 @@ static void PlayerCompanyWndProc(Window *w, WindowEvent *e) str = AllocateName(_network_player_info[_local_player].password, 0); ShowQueryString(str, STR_SET_COMPANY_PASSWORD, sizeof(_network_player_info[_local_player].password), 250, w->window_class, w->window_number); DeleteName(str); - } else + } #endif - DoCommandP(0, w->window_number, 0, NULL, CMD_BUY_SHARE_IN_COMPANY | CMD_MSG(STR_707B_CAN_T_BUY_25_SHARE_IN_THIS)); - - } break; - - case 10: /* sell 25% */ - DoCommandP(0, w->window_number, 0, NULL, CMD_SELL_SHARE_IN_COMPANY | CMD_MSG(STR_707C_CAN_T_SELL_25_SHARE_IN)); - break; + } break; } - break; case WE_MOUSELOOP: /* redraw the window every now and then */ |