From e3033ee895d8d621ffe2bb115b2293206db0e52f Mon Sep 17 00:00:00 2001 From: alberth Date: Sat, 25 Jul 2009 11:54:53 +0000 Subject: (svn r16953) -Codechange: Use SetStringParameters() for simple parameterized strings. --- src/intro_gui.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/intro_gui.cpp') diff --git a/src/intro_gui.cpp b/src/intro_gui.cpp index 9b2c8511b..36989926a 100644 --- a/src/intro_gui.cpp +++ b/src/intro_gui.cpp @@ -75,12 +75,9 @@ struct SelectGameWindow : public Window { this->DrawWidgets(); } - virtual void DrawWidget(const Rect &r, int widget) const + virtual void SetStringParameters(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); - } + if (widget == SGI_DIFFICULTIES) SetDParam(0, STR_DIFFICULTY_LEVEL_EASY + _settings_newgame.difficulty.diff_level); } virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) @@ -211,7 +208,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), SetFill(1, 0), NWidget(WWT_PUSHTXTBTN, COLOUR_ORANGE, SGI_DIFFICULTIES), SetMinimalSize(158, 12), - SetDataTip(STR_NULL, STR_INTRO_TOOLTIP_DIFFICULTY_OPTIONS), SetPadding(0, 10, 0, 0), SetFill(1, 0), + SetDataTip(STR_INTRO_DIFFICULTY, STR_INTRO_TOOLTIP_DIFFICULTY_OPTIONS), SetPadding(0, 10, 0, 0), SetFill(1, 0), EndContainer(), NWidget(NWID_SPACER), SetMinimalSize(0, 6), -- cgit v1.2.3-70-g09d2