summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2015-08-09 10:21:06 +0000
committerfrosch <frosch@openttd.org>2015-08-09 10:21:06 +0000
commit0982762c2278a3c89297d4f763f2b65e4a22c908 (patch)
tree7cddc0c798cdb3ecafa415d46e288c18afa63af3
parentdca5aa73ed7db45ab07a3fe5b0c6aa9f447c9499 (diff)
downloadopenttd-0982762c2278a3c89297d4f763f2b65e4a22c908.tar.xz
(svn r27365) -Fix: Center settings filter warning also vertically, and also in case of multiple lines.
-rw-r--r--src/settings_gui.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp
index f1af4804e..19949671f 100644
--- a/src/settings_gui.cpp
+++ b/src/settings_gui.cpp
@@ -1883,13 +1883,13 @@ struct GameSettingsWindow : Window {
if (this->warn_missing != WHR_NONE) {
const int left = panel->pos_x;
const int right = left + panel->current_x - 1;
- const int top = panel->pos_y;
+ const int top = panel->pos_y + WD_FRAMETEXT_TOP + (SETTING_HEIGHT - FONT_HEIGHT_NORMAL) * this->warn_lines / 2;
SetDParam(0, _game_settings_restrict_dropdown[this->filter.min_cat]);
if (this->warn_lines == 1) {
/* If the warning fits at one line, center it. */
- DrawString(left + WD_FRAMETEXT_LEFT, right - WD_FRAMETEXT_RIGHT, top + WD_FRAMETEXT_TOP, warn_str, TC_FROMSTRING, SA_HOR_CENTER);
+ DrawString(left + WD_FRAMETEXT_LEFT, right - WD_FRAMETEXT_RIGHT, top, warn_str, TC_FROMSTRING, SA_HOR_CENTER);
} else {
- DrawStringMultiLine(left + WD_FRAMERECT_LEFT, right - WD_FRAMERECT_RIGHT, top + WD_FRAMERECT_TOP, INT32_MAX, warn_str);
+ DrawStringMultiLine(left + WD_FRAMERECT_LEFT, right - WD_FRAMERECT_RIGHT, top, INT32_MAX, warn_str, TC_FROMSTRING, SA_HOR_CENTER);
}
}
}