mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-02 09:40:35 +00:00
(svn r14658) -Change: allow changing town names when there are no towns in the scenario yet.
This commit is contained in:
parent
c8cade5519
commit
64c973ccc5
@ -134,7 +134,7 @@ static void ShowTownnameDropdown(Window *w, int sel)
|
|||||||
|
|
||||||
DropDownList *list = new DropDownList();
|
DropDownList *list = new DropDownList();
|
||||||
for (TownList::iterator it = townnames.begin(); it != townnames.end(); it++) {
|
for (TownList::iterator it = townnames.begin(); it != townnames.end(); it++) {
|
||||||
list->push_back(new DropDownListStringItem((*it).first, (*it).second, !(_game_mode == GM_MENU || (*it).second == sel)));
|
list->push_back(new DropDownListStringItem((*it).first, (*it).second, !(_game_mode == GM_MENU || GetNumTowns() == 0 || (*it).second == sel)));
|
||||||
}
|
}
|
||||||
|
|
||||||
ShowDropDownList(w, list, sel, GAMEOPT_TOWNNAME_BTN);
|
ShowDropDownList(w, list, sel, GAMEOPT_TOWNNAME_BTN);
|
||||||
@ -283,7 +283,7 @@ struct GameOptionsWindow : Window {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case GAMEOPT_TOWNNAME_BTN: // Town names
|
case GAMEOPT_TOWNNAME_BTN: // Town names
|
||||||
if (_game_mode == GM_MENU) {
|
if (_game_mode == GM_MENU || GetNumTowns() == 0) {
|
||||||
this->opt->game_creation.town_name = index;
|
this->opt->game_creation.town_name = index;
|
||||||
InvalidateWindow(WC_GAME_OPTIONS, 0);
|
InvalidateWindow(WC_GAME_OPTIONS, 0);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user