summaryrefslogtreecommitdiff
path: root/src/settings_gui.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2014-06-05 17:14:16 +0000
committerfrosch <frosch@openttd.org>2014-06-05 17:14:16 +0000
commit06b210ff4252ff981247bd5db4c4a2228cc9a61f (patch)
tree77da52ac171d89a67d9906c47d58528570f7fae8 /src/settings_gui.cpp
parentf0dcaaf19473fda58fee7c616b9940f42c16ff21 (diff)
downloadopenttd-06b210ff4252ff981247bd5db4c4a2228cc9a61f.tar.xz
(svn r26629) -Fix [FS#6012]: If the video driver fails to supply a list of resolutions, display an error message.
Diffstat (limited to 'src/settings_gui.cpp')
-rw-r--r--src/settings_gui.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp
index 5cac72223..ccc8ff8e6 100644
--- a/src/settings_gui.cpp
+++ b/src/settings_gui.cpp
@@ -268,6 +268,8 @@ struct GameOptionsWindow : Window {
}
case WID_GO_RESOLUTION_DROPDOWN: // Setup resolution dropdown
+ if (_num_resolutions == 0) break;
+
list = new DropDownList();
*selected_index = GetCurRes();
for (int i = 0; i < _num_resolutions; i++) {
@@ -433,6 +435,8 @@ struct GameOptionsWindow : Window {
DropDownList *list = this->BuildDropDownList(widget, &selected);
if (list != NULL) {
ShowDropDownList(this, list, selected, widget);
+ } else {
+ if (widget == WID_GO_RESOLUTION_DROPDOWN) ShowErrorMessage(STR_ERROR_RESOLUTION_LIST_FAILED, INVALID_STRING_ID, WL_ERROR);
}
break;
}