(svn r14658) -Change: allow changing town names when there are no towns in the scenario yet.
authorrubidium
Fri, 05 Dec 2008 22:46:39 +0000
changeset 10407 419a41009c38
parent 10406 a929a9e55ce9
child 10408 64f14ac71cc6
(svn r14658) -Change: allow changing town names when there are no towns in the scenario yet.
src/settings_gui.cpp
--- a/src/settings_gui.cpp	Fri Dec 05 18:45:05 2008 +0000
+++ b/src/settings_gui.cpp	Fri Dec 05 22:46:39 2008 +0000
@@ -134,7 +134,7 @@
 
 	DropDownList *list = new DropDownList();
 	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);
@@ -283,7 +283,7 @@
 				break;
 
 			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;
 					InvalidateWindow(WC_GAME_OPTIONS, 0);
 				}