237 InvalidateWindow(WC_GAME_OPTIONS,0); |
237 InvalidateWindow(WC_GAME_OPTIONS,0); |
238 } |
238 } |
239 return 0; |
239 return 0; |
240 } |
240 } |
241 |
241 |
242 static const Widget _game_options_widgets[] = { |
242 static const OldWidget _game_options_widgets[] = { |
243 { WWT_CLOSEBOX, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, |
243 { WWT_CLOSEBOX, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, |
244 { WWT_CAPTION, RESIZE_NONE, 14, 11, 369, 0, 13, STR_00B1_GAME_OPTIONS, STR_018C_WINDOW_TITLE_DRAG_THIS}, |
244 { WWT_CAPTION, RESIZE_NONE, 14, 11, 369, 0, 13, STR_00B1_GAME_OPTIONS, STR_018C_WINDOW_TITLE_DRAG_THIS}, |
245 { WWT_PANEL, RESIZE_NONE, 14, 0, 369, 14, 238, 0x0, STR_NULL}, |
245 { WWT_PANEL, RESIZE_NONE, 14, 0, 369, 14, 238, 0x0, STR_NULL}, |
246 { WWT_FRAME, RESIZE_NONE, 14, 10, 179, 20, 55, STR_02E0_CURRENCY_UNITS, STR_NULL}, |
246 { WWT_FRAME, RESIZE_NONE, 14, 10, 179, 20, 55, STR_02E0_CURRENCY_UNITS, STR_NULL}, |
247 { WWT_INSET, RESIZE_NONE, 14, 20, 169, 34, 45, STR_02E1, STR_02E2_CURRENCY_UNITS_SELECTION}, |
247 { WWT_INSET, RESIZE_NONE, 14, 20, 169, 34, 45, STR_02E1, STR_02E2_CURRENCY_UNITS_SELECTION}, |
379 // Temporary holding place of values in the difficulty window until 'Save' is clicked |
379 // Temporary holding place of values in the difficulty window until 'Save' is clicked |
380 static GameOptions _opt_mod_temp; |
380 static GameOptions _opt_mod_temp; |
381 // 0x383E = (1 << 13) | (1 << 12) | (1 << 11) | (1 << 5) | (1 << 4) | (1 << 3) | (1 << 2) | (1 << 1) |
381 // 0x383E = (1 << 13) | (1 << 12) | (1 << 11) | (1 << 5) | (1 << 4) | (1 << 3) | (1 << 2) | (1 << 1) |
382 #define DIFF_INGAME_DISABLED_BUTTONS 0x383E |
382 #define DIFF_INGAME_DISABLED_BUTTONS 0x383E |
383 |
383 |
384 static void GameDifficultyWndProc(Window *w, WindowEvent *e) |
384 static void GameDifficultyWndProc(BaseWindow *w, WindowEvent *e) |
385 { |
385 { |
386 switch (e->event) { |
386 switch (e->event) { |
387 case WE_CREATE: // Setup disabled buttons when creating window |
387 case WE_CREATE: // Setup disabled buttons when creating window |
388 /* disable all other difficulty buttons during gameplay except for 'custom' */ |
388 /* disable all other difficulty buttons during gameplay except for 'custom' */ |
389 w->SetWidgetDisabledState( 3, _game_mode == GM_NORMAL); |
389 w->SetWidgetDisabledState( 3, _game_mode == GM_NORMAL); |
525 } |
525 } |
526 } |
526 } |
527 |
527 |
528 #undef DIFF_INGAME_DISABLED_BUTTONS |
528 #undef DIFF_INGAME_DISABLED_BUTTONS |
529 |
529 |
530 static const Widget _game_difficulty_widgets[] = { |
530 static const OldWidget _game_difficulty_widgets[] = { |
531 { WWT_CLOSEBOX, RESIZE_NONE, 10, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, |
531 { WWT_CLOSEBOX, RESIZE_NONE, 10, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, |
532 { WWT_CAPTION, RESIZE_NONE, 10, 11, 369, 0, 13, STR_6800_DIFFICULTY_LEVEL, STR_018C_WINDOW_TITLE_DRAG_THIS}, |
532 { WWT_CAPTION, RESIZE_NONE, 10, 11, 369, 0, 13, STR_6800_DIFFICULTY_LEVEL, STR_018C_WINDOW_TITLE_DRAG_THIS}, |
533 { WWT_PANEL, RESIZE_NONE, 10, 0, 369, 14, 29, 0x0, STR_NULL}, |
533 { WWT_PANEL, RESIZE_NONE, 10, 0, 369, 14, 29, 0x0, STR_NULL}, |
534 { WWT_PUSHTXTBTN, RESIZE_NONE, 3, 10, 96, 16, 27, STR_6801_EASY, STR_NULL}, |
534 { WWT_PUSHTXTBTN, RESIZE_NONE, 3, 10, 96, 16, 27, STR_6801_EASY, STR_NULL}, |
535 { WWT_PUSHTXTBTN, RESIZE_NONE, 3, 97, 183, 16, 27, STR_6802_MEDIUM, STR_NULL}, |
535 { WWT_PUSHTXTBTN, RESIZE_NONE, 3, 97, 183, 16, 27, STR_6802_MEDIUM, STR_NULL}, |
555 { |
555 { |
556 DeleteWindowById(WC_GAME_OPTIONS, 0); |
556 DeleteWindowById(WC_GAME_OPTIONS, 0); |
557 /* Copy current settings (ingame or in intro) to temporary holding place |
557 /* Copy current settings (ingame or in intro) to temporary holding place |
558 * change that when setting stuff, copy back on clicking 'OK' */ |
558 * change that when setting stuff, copy back on clicking 'OK' */ |
559 _opt_mod_temp = *_opt_ptr; |
559 _opt_mod_temp = *_opt_ptr; |
560 AllocateWindowDesc(&_game_difficulty_desc); |
560 BaseWindow::Allocate(&_game_difficulty_desc); |
561 } |
561 } |
562 |
562 |
563 static const char *_patches_ui[] = { |
563 static const char *_patches_ui[] = { |
564 "vehicle_speed", |
564 "vehicle_speed", |
565 "status_long_date", |
565 "status_long_date", |
679 }; |
679 }; |
680 |
680 |
681 /** The main patches window. Shows a number of categories on top and |
681 /** The main patches window. Shows a number of categories on top and |
682 * a selection of patches in that category. |
682 * a selection of patches in that category. |
683 * Uses WP(w, def_d) macro - data_1, data_2, data_3 */ |
683 * Uses WP(w, def_d) macro - data_1, data_2, data_3 */ |
684 static void PatchesSelectionWndProc(Window *w, WindowEvent *e) |
684 static void PatchesSelectionWndProc(BaseWindow *w, WindowEvent *e) |
685 { |
685 { |
686 static Patches *patches_ptr; |
686 static Patches *patches_ptr; |
687 |
687 |
688 switch (e->event) { |
688 switch (e->event) { |
689 case WE_CREATE: { |
689 case WE_CREATE: { |
889 DeleteWindowById(WC_QUERY_STRING, 0); |
889 DeleteWindowById(WC_QUERY_STRING, 0); |
890 break; |
890 break; |
891 } |
891 } |
892 } |
892 } |
893 |
893 |
894 static const Widget _patches_selection_widgets[] = { |
894 static const OldWidget _patches_selection_widgets[] = { |
895 { WWT_CLOSEBOX, RESIZE_NONE, 10, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, |
895 { WWT_CLOSEBOX, RESIZE_NONE, 10, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, |
896 { WWT_CAPTION, RESIZE_NONE, 10, 11, 369, 0, 13, STR_CONFIG_PATCHES_CAPTION, STR_018C_WINDOW_TITLE_DRAG_THIS}, |
896 { WWT_CAPTION, RESIZE_NONE, 10, 11, 369, 0, 13, STR_CONFIG_PATCHES_CAPTION, STR_018C_WINDOW_TITLE_DRAG_THIS}, |
897 { WWT_PANEL, RESIZE_NONE, 10, 0, 369, 14, 41, 0x0, STR_NULL}, |
897 { WWT_PANEL, RESIZE_NONE, 10, 0, 369, 14, 41, 0x0, STR_NULL}, |
898 { WWT_PANEL, RESIZE_NONE, 10, 0, 369, 42, 370, 0x0, STR_NULL}, |
898 { WWT_PANEL, RESIZE_NONE, 10, 0, 369, 42, 370, 0x0, STR_NULL}, |
899 |
899 |
1117 MarkWholeScreenDirty(); |
1117 MarkWholeScreenDirty(); |
1118 break; |
1118 break; |
1119 } |
1119 } |
1120 } |
1120 } |
1121 |
1121 |
1122 static const Widget _cust_currency_widgets[] = { |
1122 static const OldWidget _cust_currency_widgets[] = { |
1123 { WWT_CLOSEBOX, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, |
1123 { WWT_CLOSEBOX, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, |
1124 { WWT_CAPTION, RESIZE_NONE, 14, 11, 229, 0, 13, STR_CURRENCY_WINDOW, STR_018C_WINDOW_TITLE_DRAG_THIS}, |
1124 { WWT_CAPTION, RESIZE_NONE, 14, 11, 229, 0, 13, STR_CURRENCY_WINDOW, STR_018C_WINDOW_TITLE_DRAG_THIS}, |
1125 { WWT_PANEL, RESIZE_NONE, 14, 0, 229, 14, 119, 0x0, STR_NULL}, |
1125 { WWT_PANEL, RESIZE_NONE, 14, 0, 229, 14, 119, 0x0, STR_NULL}, |
1126 { WIDGETS_END}, |
1126 { WIDGETS_END}, |
1127 }; |
1127 }; |