Always display the "None" item in the choice of starting position dialog.

2 main reasons:

* Hint for new users of the presence of this item 

* Enter is always a quick escape and a quick eraser

Maybe later grayish when unneeded or show the currently used item
This commit is contained in:
Ali El Gariani 2007-05-01 00:44:57 +00:00
parent d82e35125a
commit a3cbc481fa

View File

@ -546,13 +546,10 @@ void map_editor::edit_save_as() {
void map_editor::perform_set_starting_pos() { void map_editor::perform_set_starting_pos() {
std::vector<std::string> players; std::vector<std::string> players;
const int current_side = starting_side_at(map_, selected_hex_);
// use the "none" item only when a start side is already here std::stringstream none_str;
if (current_side != -1) { none_str << _("None");
std::stringstream none_str; players.push_back(none_str.str());
none_str << _("None");
players.push_back(none_str.str());
}
for (int i = 0; i < num_players; i++) { for (int i = 0; i < num_players; i++) {
std::stringstream str; std::stringstream str;
@ -563,11 +560,13 @@ void map_editor::perform_set_starting_pos() {
_("Which player should start here?"), _("Which player should start here?"),
gui::OK_CANCEL, &players); gui::OK_CANCEL, &players);
if (current_side != -1 && res==0) { if (res > 0) {
set_starting_position(current_side, gamemap::location()); set_starting_position(res, selected_hex_);
} else if (res >= 0) { } else if (res==0) {
// We must take care of the possible presence of the "None" item const int current_side = starting_side_at(map_, selected_hex_);
set_starting_position(current_side != -1 ? res : res+1 , selected_hex_); if (current_side != -1) {
set_starting_position(current_side, gamemap::location());
}
} }
} }