(svn r16953) -Codechange: Use SetStringParameters() for simple parameterized strings.

This commit is contained in:
alberth
2009-07-25 11:54:53 +00:00
parent a8e5d36868
commit 42714792dc
5 changed files with 38 additions and 19 deletions

View File

@@ -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),