diff options
author | alberth <alberth@openttd.org> | 2009-06-28 22:23:26 +0000 |
---|---|---|
committer | alberth <alberth@openttd.org> | 2009-06-28 22:23:26 +0000 |
commit | baab325b54dbc7723be876415a65f8a5365d32d0 (patch) | |
tree | e2e1f3219c3dd41e9baf2202a2226f6ab5cc38e8 /src/intro_gui.cpp | |
parent | d5a42ee82574aa77c73e2c4b2ff1ecc20323cc38 (diff) | |
download | openttd-baab325b54dbc7723be876415a65f8a5365d32d0.tar.xz |
(svn r16689) -Codechange: Allow for rendering of parameterized text of nested widgets in Window::DrawWidget, adapt intro and town directory windows.
Diffstat (limited to 'src/intro_gui.cpp')
-rw-r--r-- | src/intro_gui.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/intro_gui.cpp b/src/intro_gui.cpp index 662442ad8..35de114e3 100644 --- a/src/intro_gui.cpp +++ b/src/intro_gui.cpp @@ -72,10 +72,17 @@ struct SelectGameWindow : public Window { virtual void OnPaint() { - SetDParam(0, STR_DIFFICULTY_LEVEL_EASY + _settings_newgame.difficulty.diff_level); this->DrawWidgets(); } + virtual void DrawWidget(const Rect &r, int widget) const + { + if (widget == SGI_DIFFICULTIES) { + SetDParam(0, STR_DIFFICULTY_LEVEL_EASY + _settings_newgame.difficulty.diff_level); + DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + WD_FRAMERECT_TOP, STR_INTRO_DIFFICULTY, TC_FROMSTRING, SA_CENTER); + } + } + virtual void OnClick(Point pt, int widget) { #ifdef ENABLE_NETWORK @@ -189,7 +196,7 @@ static const NWidgetPart _nested_select_game_widgets[] = { NWidget(WWT_PUSHTXTBTN, COLOUR_ORANGE, SGI_OPTIONS), SetMinimalSize(158, 12), SetDataTip(STR_INTRO_GAME_OPTIONS, STR_INTRO_TOOLTIP_GAME_OPTIONS), SetPadding(0, 0, 0, 10), NWidget(WWT_PUSHTXTBTN, COLOUR_ORANGE, SGI_DIFFICULTIES), SetMinimalSize(158, 12), - SetDataTip(STR_INTRO_DIFFICULTY, STR_INTRO_TOOLTIP_DIFFICULTY_OPTIONS), SetPadding(0, 10, 0, 0), + SetDataTip(STR_NULL, STR_INTRO_TOOLTIP_DIFFICULTY_OPTIONS), SetPadding(0, 10, 0, 0), EndContainer(), NWidget(NWID_SPACER), SetMinimalSize(0, 6), |