mirror of https://github.com/OpenTTD/OpenTTD
(svn r26629) -Fix [FS#6012]: If the video driver fails to supply a list of resolutions, display an error message.
parent
f0dcaaf194
commit
06b210ff42
|
@ -969,6 +969,7 @@ STR_GAME_OPTIONS_BASE_MUSIC_TOOLTIP :{BLACK}Select t
|
||||||
STR_GAME_OPTIONS_BASE_MUSIC_STATUS :{RED}{NUM} corrupted file{P "" s}
|
STR_GAME_OPTIONS_BASE_MUSIC_STATUS :{RED}{NUM} corrupted file{P "" s}
|
||||||
STR_GAME_OPTIONS_BASE_MUSIC_DESCRIPTION_TOOLTIP :{BLACK}Additional information about the base music set
|
STR_GAME_OPTIONS_BASE_MUSIC_DESCRIPTION_TOOLTIP :{BLACK}Additional information about the base music set
|
||||||
|
|
||||||
|
STR_ERROR_RESOLUTION_LIST_FAILED :{WHITE}Failed to retrieve a list of supported resolutions
|
||||||
STR_ERROR_FULLSCREEN_FAILED :{WHITE}Fullscreen mode failed
|
STR_ERROR_FULLSCREEN_FAILED :{WHITE}Fullscreen mode failed
|
||||||
|
|
||||||
# Custom currency window
|
# Custom currency window
|
||||||
|
|
|
@ -268,6 +268,8 @@ struct GameOptionsWindow : Window {
|
||||||
}
|
}
|
||||||
|
|
||||||
case WID_GO_RESOLUTION_DROPDOWN: // Setup resolution dropdown
|
case WID_GO_RESOLUTION_DROPDOWN: // Setup resolution dropdown
|
||||||
|
if (_num_resolutions == 0) break;
|
||||||
|
|
||||||
list = new DropDownList();
|
list = new DropDownList();
|
||||||
*selected_index = GetCurRes();
|
*selected_index = GetCurRes();
|
||||||
for (int i = 0; i < _num_resolutions; i++) {
|
for (int i = 0; i < _num_resolutions; i++) {
|
||||||
|
@ -433,6 +435,8 @@ struct GameOptionsWindow : Window {
|
||||||
DropDownList *list = this->BuildDropDownList(widget, &selected);
|
DropDownList *list = this->BuildDropDownList(widget, &selected);
|
||||||
if (list != NULL) {
|
if (list != NULL) {
|
||||||
ShowDropDownList(this, list, selected, widget);
|
ShowDropDownList(this, list, selected, widget);
|
||||||
|
} else {
|
||||||
|
if (widget == WID_GO_RESOLUTION_DROPDOWN) ShowErrorMessage(STR_ERROR_RESOLUTION_LIST_FAILED, INVALID_STRING_ID, WL_ERROR);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -116,6 +116,8 @@ struct DropdownWindow : Window {
|
||||||
DropdownWindow(Window *parent, const DropDownList *list, int selected, int button, bool instant_close, const Point &position, const Dimension &size, Colours wi_colour, bool scroll)
|
DropdownWindow(Window *parent, const DropDownList *list, int selected, int button, bool instant_close, const Point &position, const Dimension &size, Colours wi_colour, bool scroll)
|
||||||
: Window(&_dropdown_desc)
|
: Window(&_dropdown_desc)
|
||||||
{
|
{
|
||||||
|
assert(list->Length() > 0);
|
||||||
|
|
||||||
this->position = position;
|
this->position = position;
|
||||||
|
|
||||||
this->CreateNestedTree();
|
this->CreateNestedTree();
|
||||||
|
|
Loading…
Reference in New Issue