3 /** @file intro_gui.cpp */ |
3 /** @file intro_gui.cpp */ |
4 |
4 |
5 #include "stdafx.h" |
5 #include "stdafx.h" |
6 #include "openttd.h" |
6 #include "openttd.h" |
7 #include "table/strings.h" |
7 #include "table/strings.h" |
8 #include "strings.h" |
|
9 #include "table/sprites.h" |
8 #include "table/sprites.h" |
10 #include "functions.h" |
|
11 #include "window.h" |
|
12 #include "gui.h" |
9 #include "gui.h" |
13 #include "gfx.h" |
10 #include "window_gui.h" |
|
11 #include "textbuf_gui.h" |
14 #include "player.h" |
12 #include "player.h" |
15 #include "network/network.h" |
13 #include "network/network.h" |
16 #include "variables.h" |
14 #include "variables.h" |
17 #include "settings.h" |
|
18 #include "heightmap.h" |
15 #include "heightmap.h" |
19 #include "genworld.h" |
16 #include "genworld.h" |
20 #include "network/network_gui.h" |
17 #include "network/network_gui.h" |
21 #include "newgrf.h" |
18 #include "newgrf.h" |
|
19 #include "strings_func.h" |
|
20 #include "window_func.h" |
|
21 #include "fios.h" |
|
22 #include "gfx_func.h" |
22 |
23 |
23 static const Widget _select_game_widgets[] = { |
24 static const Widget _select_game_widgets[] = { |
24 { WWT_CAPTION, RESIZE_NONE, 13, 0, 335, 0, 13, STR_0307_OPENTTD, STR_NULL}, |
25 { WWT_CAPTION, RESIZE_NONE, 13, 0, 335, 0, 13, STR_0307_OPENTTD, STR_NULL}, |
25 { WWT_PANEL, RESIZE_NONE, 13, 0, 335, 14, 194, 0x0, STR_NULL}, |
26 { WWT_PANEL, RESIZE_NONE, 13, 0, 335, 14, 194, 0x0, STR_NULL}, |
26 { WWT_PUSHTXTBTN, RESIZE_NONE, 12, 10, 167, 22, 33, STR_0140_NEW_GAME, STR_02FB_START_A_NEW_GAME}, |
27 { WWT_PUSHTXTBTN, RESIZE_NONE, 12, 10, 167, 22, 33, STR_0140_NEW_GAME, STR_02FB_START_A_NEW_GAME}, |
51 } |
52 } |
52 |
53 |
53 static void SelectGameWndProc(Window *w, WindowEvent *e) |
54 static void SelectGameWndProc(Window *w, WindowEvent *e) |
54 { |
55 { |
55 switch (e->event) { |
56 switch (e->event) { |
56 case WE_CREATE: LowerWindowWidget(w, _opt_newgame.landscape + 8); break; |
57 case WE_CREATE: w->LowerWidget(_opt_newgame.landscape + 8); break; |
57 |
58 |
58 case WE_PAINT: |
59 case WE_PAINT: |
59 SetWindowWidgetLoweredState(w, 8, _opt_newgame.landscape == LT_TEMPERATE); |
60 w->SetWidgetLoweredState(8, _opt_newgame.landscape == LT_TEMPERATE); |
60 SetWindowWidgetLoweredState(w, 9, _opt_newgame.landscape == LT_ARCTIC); |
61 w->SetWidgetLoweredState(9, _opt_newgame.landscape == LT_ARCTIC); |
61 SetWindowWidgetLoweredState(w, 10, _opt_newgame.landscape == LT_TROPIC); |
62 w->SetWidgetLoweredState(10, _opt_newgame.landscape == LT_TROPIC); |
62 SetWindowWidgetLoweredState(w, 11, _opt_newgame.landscape == LT_TOYLAND); |
63 w->SetWidgetLoweredState(11, _opt_newgame.landscape == LT_TOYLAND); |
63 SetDParam(0, STR_6801_EASY + _opt_newgame.diff_level); |
64 SetDParam(0, STR_6801_EASY + _opt_newgame.diff_level); |
64 DrawWindowWidgets(w); |
65 DrawWindowWidgets(w); |
65 break; |
66 break; |
66 |
67 |
67 case WE_CLICK: |
68 case WE_CLICK: |
83 } else { |
84 } else { |
84 ShowNetworkGameWindow(); |
85 ShowNetworkGameWindow(); |
85 } |
86 } |
86 break; |
87 break; |
87 case 8: case 9: case 10: case 11: |
88 case 8: case 9: case 10: case 11: |
88 RaiseWindowWidget(w, _opt_newgame.landscape + 8); |
89 w->RaiseWidget(_opt_newgame.landscape + 8); |
89 SetNewLandscapeType(e->we.click.widget - 8); |
90 SetNewLandscapeType(e->we.click.widget - 8); |
90 break; |
91 break; |
91 case 12: ShowGameOptions(); break; |
92 case 12: ShowGameOptions(); break; |
92 case 13: ShowGameDifficulty(); break; |
93 case 13: ShowGameDifficulty(); break; |
93 case 14: ShowPatchesSelection(); break; |
94 case 14: ShowPatchesSelection(); break; |