170 switch (e->we.click.widget) { |
170 switch (e->we.click.widget) { |
171 case 2: {/* toggle size */ |
171 case 2: {/* toggle size */ |
172 byte mode = (byte)WP(w,def_d).data_1; |
172 byte mode = (byte)WP(w,def_d).data_1; |
173 bool stickied = !!(w->flags4 & WF_STICKY); |
173 bool stickied = !!(w->flags4 & WF_STICKY); |
174 PlayerID player = (PlayerID)w->window_number; |
174 PlayerID player = (PlayerID)w->window_number; |
175 DeleteWindow(w); |
175 w->Close(); |
176 DoShowPlayerFinances(player, !HASBIT(mode, 0), stickied); |
176 DoShowPlayerFinances(player, !HASBIT(mode, 0), stickied); |
177 } break; |
177 } break; |
178 |
178 |
179 case 6: /* increase loan */ |
179 case 6: /* increase loan */ |
180 DoCommandP(0, 0, _ctrl_pressed, NULL, CMD_INCREASE_LOAN | CMD_MSG(STR_702C_CAN_T_BORROW_ANY_MORE_MONEY)); |
180 DoCommandP(0, 0, _ctrl_pressed, NULL, CMD_INCREASE_LOAN | CMD_MSG(STR_702C_CAN_T_BORROW_ANY_MORE_MONEY)); |
516 DrawPlayerFace(WP(w,facesel_d).face, p->player_color, 2, 16); |
516 DrawPlayerFace(WP(w,facesel_d).face, p->player_color, 2, 16); |
517 } break; |
517 } break; |
518 |
518 |
519 case WE_CLICK: |
519 case WE_CLICK: |
520 switch (e->we.click.widget) { |
520 switch (e->we.click.widget) { |
521 case 3: DeleteWindow(w); break; |
521 case 3: w->Close(); break; |
522 case 4: /* ok click */ |
522 case 4: /* ok click */ |
523 DoCommandP(0, 0, WP(w,facesel_d).face, NULL, CMD_SET_PLAYER_FACE); |
523 DoCommandP(0, 0, WP(w,facesel_d).face, NULL, CMD_SET_PLAYER_FACE); |
524 DeleteWindow(w); |
524 w->Close(); |
525 break; |
525 break; |
526 case 5: /* male click */ |
526 case 5: /* male click */ |
527 case 6: /* female click */ |
527 case 6: /* female click */ |
528 RaiseWindowWidget(w, WP(w, facesel_d).gender + 5); |
528 RaiseWindowWidget(w, WP(w, facesel_d).gender + 5); |
529 WP(w, facesel_d).gender = e->we.click.widget - 5; |
529 WP(w, facesel_d).gender = e->we.click.widget - 5; |
530 LowerWindowWidget(w, WP(w, facesel_d).gender + 5); |
530 LowerWindowWidget(w, WP(w, facesel_d).gender + 5); |
531 SetWindowDirty(w); |
531 w->SetDirty(); |
532 break; |
532 break; |
533 case 7: |
533 case 7: |
534 WP(w,facesel_d).face = (WP(w,facesel_d).gender << 31) + GB(InteractiveRandom(), 0, 31); |
534 WP(w,facesel_d).face = (WP(w,facesel_d).gender << 31) + GB(InteractiveRandom(), 0, 31); |
535 SetWindowDirty(w); |
535 w->SetDirty(); |
536 break; |
536 break; |
537 } |
537 } |
538 break; |
538 break; |
539 } |
539 } |
540 } |
540 } |
820 } |
820 } |
821 break; |
821 break; |
822 |
822 |
823 case WE_MOUSELOOP: |
823 case WE_MOUSELOOP: |
824 /* redraw the window every now and then */ |
824 /* redraw the window every now and then */ |
825 if ((++w->vscroll.pos & 0x1F) == 0) SetWindowDirty(w); |
825 if ((++w->vscroll.pos & 0x1F) == 0) w->SetDirty(); |
826 break; |
826 break; |
827 |
827 |
828 case WE_PLACE_OBJ: |
828 case WE_PLACE_OBJ: |
829 if (DoCommandP(e->we.place.tile, 0, 0, NULL, CMD_BUILD_COMPANY_HQ | CMD_AUTO | CMD_NO_WATER | CMD_MSG(STR_7071_CAN_T_BUILD_COMPANY_HEADQUARTERS))) |
829 if (DoCommandP(e->we.place.tile, 0, 0, NULL, CMD_BUILD_COMPANY_HQ | CMD_AUTO | CMD_NO_WATER | CMD_MSG(STR_7071_CAN_T_BUILD_COMPANY_HEADQUARTERS))) |
830 ResetObjectToPlace(); |
830 ResetObjectToPlace(); |
831 w->widget[PCW_WIDGET_BUILD_VIEW_HQ].type = WWT_PUSHTXTBTN; // this button can now behave as a normal push button |
831 w->widget[PCW_WIDGET_BUILD_VIEW_HQ].type = WWT_PUSHTXTBTN; // this button can now behave as a normal push button |
832 RaiseWindowButtons(w); |
832 w->RaiseButtons(); |
833 break; |
833 break; |
834 |
834 |
835 case WE_ABORT_PLACE_OBJ: |
835 case WE_ABORT_PLACE_OBJ: |
836 RaiseWindowButtons(w); |
836 w->RaiseButtons(); |
837 break; |
837 break; |
838 |
838 |
839 case WE_DESTROY: |
839 case WE_DESTROY: |
840 DeleteWindowById(WC_PLAYER_FACE, w->window_number); |
840 DeleteWindowById(WC_PLAYER_FACE, w->window_number); |
841 break; |
841 break; |
993 SetDParam(2, EndGameGetPerformanceTitleFromValue(p->old_economy[0].performance_history)); |
993 SetDParam(2, EndGameGetPerformanceTitleFromValue(p->old_economy[0].performance_history)); |
994 DrawStringMultiCenter(x + (640 / 2), y + 157, STR_021B_ACHIEVES_STATUS, 640); |
994 DrawStringMultiCenter(x + (640 / 2), y + 157, STR_021B_ACHIEVES_STATUS, 640); |
995 } |
995 } |
996 } break; |
996 } break; |
997 case WE_CLICK: /* Close the window (and show the highscore window) */ |
997 case WE_CLICK: /* Close the window (and show the highscore window) */ |
998 DeleteWindow(w); |
998 w->Close(); |
999 break; |
999 break; |
1000 case WE_DESTROY: /* Show the highscore window when this one is closed */ |
1000 case WE_DESTROY: /* Show the highscore window when this one is closed */ |
1001 if (!_networking) DoCommandP(0, 0, 0, NULL, CMD_PAUSE); // unpause |
1001 if (!_networking) DoCommandP(0, 0, 0, NULL, CMD_PAUSE); // unpause |
1002 ShowHighscoreTable(w->window_number, WP(w, highscore_d).rank); |
1002 ShowHighscoreTable(w->window_number, WP(w, highscore_d).rank); |
1003 break; |
1003 break; |