summaryrefslogtreecommitdiff
path: root/src/intro_gui.cpp
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2009-06-04 14:34:38 +0000
committeralberth <alberth@openttd.org>2009-06-04 14:34:38 +0000
commit19ccf6912c237c1bfb1c82197cdeadd9c7fdeef6 (patch)
tree2652930f24bfcd1e9ff8dd62fcf4c9b6bc165b6e /src/intro_gui.cpp
parentb144a5451cb451d91bacafd80cab04640d1c1af1 (diff)
downloadopenttd-19ccf6912c237c1bfb1c82197cdeadd9c7fdeef6.tar.xz
(svn r16517) -Codechange: Switched intro-screen and town directory window to nested widget trees.
Diffstat (limited to 'src/intro_gui.cpp')
-rw-r--r--src/intro_gui.cpp34
1 files changed, 3 insertions, 31 deletions
diff --git a/src/intro_gui.cpp b/src/intro_gui.cpp
index 95564d56a..6b1ff57f7 100644
--- a/src/intro_gui.cpp
+++ b/src/intro_gui.cpp
@@ -25,34 +25,6 @@
#include "table/strings.h"
#include "table/sprites.h"
-static const Widget _select_game_widgets[] = {
-{ WWT_CAPTION, RESIZE_NONE, COLOUR_BROWN, 0, 335, 0, 13, STR_INTRO_CAPTION, STR_NULL},
-{ WWT_PANEL, RESIZE_NONE, COLOUR_BROWN, 0, 335, 14, 212, 0x0, STR_NULL},
-{ WWT_PUSHTXTBTN, RESIZE_NONE, COLOUR_ORANGE, 10, 167, 22, 33, STR_INTRO_NEW_GAME, STR_INTRO_TOOLTIP_NEW_GAME},
-{ WWT_PUSHTXTBTN, RESIZE_NONE, COLOUR_ORANGE, 168, 325, 22, 33, STR_INTRO_LOAD_GAME, STR_INTRO_TOOLTIP_LOAD_GAME},
-{ WWT_PUSHTXTBTN, RESIZE_NONE, COLOUR_ORANGE, 10, 167, 40, 51, STR_INTRO_PLAY_SCENARIO, STR_INTRO_TOOLTIP_PLAY_SCENARIO},
-{ WWT_PUSHTXTBTN, RESIZE_NONE, COLOUR_ORANGE, 168, 325, 40, 51, STR_INTRO_PLAY_HEIGHTMAP, STR_INTRO_PLAY_HEIGHTMAP_TOOLTIP},
-{ WWT_PUSHTXTBTN, RESIZE_NONE, COLOUR_ORANGE, 10, 167, 58, 69, STR_INTRO_SCENARIO_EDITOR, STR_INTRO_TOOLTIP_SCENARIO_EDITOR},
-{ WWT_PUSHTXTBTN, RESIZE_NONE, COLOUR_ORANGE, 168, 325, 58, 69, STR_INTRO_MULTIPLAYER, STR_INTRO_TOOLTIP_MULTIPLAYER},
-
-{ WWT_IMGBTN_2, RESIZE_NONE, COLOUR_ORANGE, 10, 86, 77, 131, SPR_SELECT_TEMPERATE, STR_INTRO_TOOLTIP_TEMPERATE},
-{ WWT_IMGBTN_2, RESIZE_NONE, COLOUR_ORANGE, 90, 166, 77, 131, SPR_SELECT_SUB_ARCTIC, STR_INTRO_TOOLTIP_SUB_ARCTIC_LANDSCAPE},
-{ WWT_IMGBTN_2, RESIZE_NONE, COLOUR_ORANGE, 170, 246, 77, 131, SPR_SELECT_SUB_TROPICAL, STR_INTRO_TOOLTIP_SUB_TROPICAL_LANDSCAPE},
-{ WWT_IMGBTN_2, RESIZE_NONE, COLOUR_ORANGE, 250, 326, 77, 131, SPR_SELECT_TOYLAND, STR_INTRO_TOOLTIP_TOYLAND_LANDSCAPE},
-
-{ WWT_PUSHTXTBTN, RESIZE_NONE, COLOUR_ORANGE, 10, 167, 139, 150, STR_INTRO_GAME_OPTIONS, STR_INTRO_TOOLTIP_GAME_OPTIONS},
-{ WWT_PUSHTXTBTN, RESIZE_NONE, COLOUR_ORANGE, 168, 325, 139, 150, STR_INTRO_DIFFICULTY, STR_INTRO_TOOLTIP_DIFFICULTY_OPTIONS},
-{ WWT_PUSHTXTBTN, RESIZE_NONE, COLOUR_ORANGE, 10, 167, 157, 168, STR_CONFIG_SETTING, STR_CONFIG_SETTING_TIP},
-{ WWT_PUSHTXTBTN, RESIZE_NONE, COLOUR_ORANGE, 168, 325, 157, 168, STR_NEWGRF_SETTINGS_BUTTON, STR_NEWGRF_SETTINGS_BUTTON_TIP},
-
-{ WWT_PUSHTXTBTN, RESIZE_NONE, COLOUR_ORANGE, 10, 167, 175, 186, STR_CONTENT_INTRO_BUTTON, STR_CONTENT_INTRO_BUTTON_TIP},
-{ WWT_PUSHTXTBTN, RESIZE_NONE, COLOUR_ORANGE, 168, 325, 175, 186, STR_AI_SETTINGS_BUTTON, STR_AI_SETTINGS_BUTTON_TIP},
-
-{ WWT_PUSHTXTBTN, RESIZE_NONE, COLOUR_ORANGE, 104, 231, 193, 204, STR_INTRO_QUIT, STR_INTRO_TOOLTIP_QUIT},
-
-{ WIDGETS_END},
-};
-
static inline void SetNewLandscapeType(byte landscape)
{
_settings_newgame.game_creation.landscape = landscape;
@@ -83,10 +55,10 @@ enum SelectGameIntroWidgets {
struct SelectGameWindow : public Window {
- SelectGameWindow(const WindowDesc *desc) : Window(desc)
+ SelectGameWindow(const WindowDesc *desc) : Window()
{
+ this->InitNested(desc);
this->LowerWidget(_settings_newgame.game_creation.landscape + SGI_TEMPERATE_LANDSCAPE);
- this->FindWindowPlacementAndResize(desc);
}
virtual void OnPaint()
@@ -265,7 +237,7 @@ static const WindowDesc _select_game_desc(
WDP_CENTER, WDP_CENTER, 336, 213, 336, 213,
WC_SELECT_GAME, WC_NONE,
WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
- _select_game_widgets,
+ NULL,
_nested_select_game_widgets, lengthof(_nested_select_game_widgets)
);