diff options
author | frosch <frosch@openttd.org> | 2017-01-14 18:30:26 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2017-01-14 18:30:26 +0000 |
commit | 7b553d255ee5a5e5be3e4c1c8a0d56504cfdc418 (patch) | |
tree | 8cb6fcf4083fcf3e98864fbb40f7e323706f90d7 /src/intro_gui.cpp | |
parent | 08b4255b677259e3e3f9039b903bd5a62a909da6 (diff) | |
download | openttd-7b553d255ee5a5e5be3e4c1c8a0d56504cfdc418.tar.xz |
(svn r27732) -Change: Turn the message about 'missing baseset sprites' from a popup into a static message that only shows in non-release versions, just like the 'missing translations' message.
Diffstat (limited to 'src/intro_gui.cpp')
-rw-r--r-- | src/intro_gui.cpp | 48 |
1 files changed, 35 insertions, 13 deletions
diff --git a/src/intro_gui.cpp b/src/intro_gui.cpp index a09a59a10..3659b033c 100644 --- a/src/intro_gui.cpp +++ b/src/intro_gui.cpp @@ -60,13 +60,21 @@ struct SelectGameWindow : public Window { virtual void OnInit() { - bool missing = _current_language->missing >= _settings_client.gui.missing_strings_threshold && !IsReleasedVersion(); - this->GetWidget<NWidgetStacked>(WID_SGI_TRANSLATION_SELECTION)->SetDisplayedPlane(missing ? 0 : SZSP_NONE); + bool missing_sprites = _missing_extra_graphics > 0 && !IsReleasedVersion(); + this->GetWidget<NWidgetStacked>(WID_SGI_BASESET_SELECTION)->SetDisplayedPlane(missing_sprites ? 0 : SZSP_NONE); + + bool missing_lang = _current_language->missing >= _settings_client.gui.missing_strings_threshold && !IsReleasedVersion(); + this->GetWidget<NWidgetStacked>(WID_SGI_TRANSLATION_SELECTION)->SetDisplayedPlane(missing_lang ? 0 : SZSP_NONE); } virtual void DrawWidget(const Rect &r, int widget) const { switch (widget) { + case WID_SGI_BASESET: + SetDParam(0, _missing_extra_graphics); + DrawStringMultiLine(r.left, r.right, r.top, r.bottom, STR_INTRO_BASESET, TC_FROMSTRING, SA_CENTER); + break; + case WID_SGI_TRANSLATION: SetDParam(0, _current_language->missing); DrawStringMultiLine(r.left, r.right, r.top, r.bottom, STR_INTRO_TRANSLATION, TC_FROMSTRING, SA_CENTER); @@ -76,20 +84,29 @@ struct SelectGameWindow : public Window { virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { + StringID str = 0; switch (widget) { - case WID_SGI_TRANSLATION: { + case WID_SGI_BASESET: + SetDParam(0, _missing_extra_graphics); + str = STR_INTRO_BASESET; + break; + + case WID_SGI_TRANSLATION: SetDParam(0, _current_language->missing); - int height = GetStringHeight(STR_INTRO_TRANSLATION, size->width); - if (height > 3 * FONT_HEIGHT_NORMAL) { - /* Don't let the window become too high. */ - Dimension textdim = GetStringBoundingBox(STR_INTRO_TRANSLATION); - textdim.height *= 3; - textdim.width -= textdim.width / 2; - *size = maxdim(*size, textdim); - } else { - size->height = height + padding.height; - } + str = STR_INTRO_TRANSLATION; break; + } + + if (str != 0) { + int height = GetStringHeight(str, size->width); + if (height > 3 * FONT_HEIGHT_NORMAL) { + /* Don't let the window become too high. */ + Dimension textdim = GetStringBoundingBox(str); + textdim.height *= 3; + textdim.width -= textdim.width / 2; + *size = maxdim(*size, textdim); + } else { + size->height = height + padding.height; } } } @@ -199,6 +216,11 @@ static const NWidgetPart _nested_select_game_widgets[] = { EndContainer(), NWidget(NWID_SPACER), SetMinimalSize(0, 7), + NWidget(NWID_SELECTION, INVALID_COLOUR, WID_SGI_BASESET_SELECTION), + NWidget(NWID_VERTICAL), + NWidget(WWT_EMPTY, COLOUR_ORANGE, WID_SGI_BASESET), SetMinimalSize(316, 12), SetFill(1, 0), SetPadding(0, 10, 7, 10), + EndContainer(), + EndContainer(), NWidget(NWID_SELECTION, INVALID_COLOUR, WID_SGI_TRANSLATION_SELECTION), NWidget(NWID_VERTICAL), NWidget(WWT_EMPTY, COLOUR_ORANGE, WID_SGI_TRANSLATION), SetMinimalSize(316, 12), SetFill(1, 0), SetPadding(0, 10, 7, 10), |