195 bool stickied = !!(w->flags4 & WF_STICKY); |
195 bool stickied = !!(w->flags4 & WF_STICKY); |
196 int oldtop = w->top; ///< current top position of the window before closing it |
196 int oldtop = w->top; ///< current top position of the window before closing it |
197 int oldleft = w->left; ///< current left position of the window before closing it |
197 int oldleft = w->left; ///< current left position of the window before closing it |
198 PlayerID player = (PlayerID)w->window_number; |
198 PlayerID player = (PlayerID)w->window_number; |
199 |
199 |
200 DeleteWindow(w); |
200 delete w; |
201 /* Open up the (toggled size) Finance window at the same position as the previous */ |
201 /* Open up the (toggled size) Finance window at the same position as the previous */ |
202 DoShowPlayerFinances(player, !HasBit(mode, 0), stickied, oldtop, oldleft); |
202 DoShowPlayerFinances(player, !HasBit(mode, 0), stickied, oldtop, oldleft); |
203 } |
203 } |
204 break; |
204 break; |
205 |
205 |
869 case PFW_WIDGET_TOGGLE_LARGE_SMALL_BUTTON: { |
869 case PFW_WIDGET_TOGGLE_LARGE_SMALL_BUTTON: { |
870 int oldtop = w->top; ///< current top position of the window before closing it |
870 int oldtop = w->top; ///< current top position of the window before closing it |
871 int oldleft = w->left; ///< current top position of the window before closing it |
871 int oldleft = w->left; ///< current top position of the window before closing it |
872 |
872 |
873 DoCommandP(0, 0, *pf, NULL, CMD_SET_PLAYER_FACE); |
873 DoCommandP(0, 0, *pf, NULL, CMD_SET_PLAYER_FACE); |
874 DeleteWindow(w); |
874 delete w; |
875 /* Open up the (toggled size) Face selection window at the same position as the previous */ |
875 /* Open up the (toggled size) Face selection window at the same position as the previous */ |
876 DoSelectPlayerFace((PlayerID)w->window_number, !WP(w, facesel_d).advanced, oldtop, oldleft); |
876 DoSelectPlayerFace((PlayerID)w->window_number, !WP(w, facesel_d).advanced, oldtop, oldleft); |
877 } break; |
877 } break; |
878 |
878 |
879 /* Cancel button */ |
879 /* Cancel button */ |
880 case PFW_WIDGET_CANCEL: |
880 case PFW_WIDGET_CANCEL: |
881 DeleteWindow(w); |
881 delete w; |
882 break; |
882 break; |
883 |
883 |
884 /* OK button */ |
884 /* OK button */ |
885 case PFW_WIDGET_ACCEPT: |
885 case PFW_WIDGET_ACCEPT: |
886 DoCommandP(0, 0, *pf, NULL, CMD_SET_PLAYER_FACE); |
886 DoCommandP(0, 0, *pf, NULL, CMD_SET_PLAYER_FACE); |
887 DeleteWindow(w); |
887 delete w; |
888 break; |
888 break; |
889 |
889 |
890 /* Load button */ |
890 /* Load button */ |
891 case PFW_WIDGET_LOAD: |
891 case PFW_WIDGET_LOAD: |
892 *pf = _player_face; |
892 *pf = _player_face; |
1462 DrawStringMultiCenter(x + (640 / 2), y + 157, STR_021B_ACHIEVES_STATUS, 640); |
1462 DrawStringMultiCenter(x + (640 / 2), y + 157, STR_021B_ACHIEVES_STATUS, 640); |
1463 } |
1463 } |
1464 } break; |
1464 } break; |
1465 |
1465 |
1466 case WE_CLICK: /* Close the window (and show the highscore window) */ |
1466 case WE_CLICK: /* Close the window (and show the highscore window) */ |
1467 DeleteWindow(w); |
1467 delete w; |
1468 break; |
1468 break; |
1469 |
1469 |
1470 case WE_DESTROY: /* Show the highscore window when this one is closed */ |
1470 case WE_DESTROY: /* Show the highscore window when this one is closed */ |
1471 if (!_networking) DoCommandP(0, 0, 0, NULL, CMD_PAUSE); // unpause |
1471 if (!_networking) DoCommandP(0, 0, 0, NULL, CMD_PAUSE); // unpause |
1472 ShowHighscoreTable(w->window_number, WP(w, highscore_d).rank); |
1472 ShowHighscoreTable(w->window_number, WP(w, highscore_d).rank); |