allow to use team labels also for 1-player-teams (bug #9747)

This commit is contained in:
uso 2007-12-03 01:07:55 +00:00
parent 90a32e5e7d
commit cd61435bf3
4 changed files with 9 additions and 10 deletions

View file

@ -7,6 +7,7 @@ Version 1.3.12+svn:
* Allow ThemeWML to display the race.
* User interface
* Display the race in the unit preview panel.
* allow to use team labels also for 1-player-teams (bug #9747)
* changing the langugage now sets the version number in the title
properly.

View file

@ -7,6 +7,7 @@ Version 1.3.12+svn:
* Updated translations: Chinese, Italian.
* User interface
* Display the race in the unit preview panel.
* Allow to use team labels also for 1-player-teams (bug #9747).
Version 1.3.12:
* campaigns

View file

@ -1653,14 +1653,13 @@ private:
gui::dialog d(*gui_, _("Place Label"), "", gui::OK_CANCEL);
const terrain_label* old_label = gui_->labels().get_label(mousehandler.get_last_hex());
if (old_label) {
d.set_textbox(_("Label:"), old_label->text(), map_labels::get_max_chars());
d.set_textbox(_("Label: "), old_label->text(), map_labels::get_max_chars());
team_only = !old_label->team_name().empty();
} else {
d.set_textbox(_("Label:"), "", map_labels::get_max_chars());
}
if (has_team() || (old_label && team_only)) {
d.add_option(_("Team only"), team_only, gui::dialog::BUTTON_CHECKBOX_LEFT);
d.set_textbox(_("Label: "), "", map_labels::get_max_chars());
}
d.add_option(_("Team only"), team_only, gui::dialog::BUTTON_CHECKBOX_LEFT);
if(!d.show()) {
std::string team_name;
SDL_Color colour = font::LABEL_COLOUR;
@ -1668,10 +1667,9 @@ private:
last_team_id << gamemap::MAX_PLAYERS;
std::map<std::string, color_range>::iterator gp = game_config::team_rgb_range.find(last_team_id.str());
if ((has_team() || (old_label && team_only)) && d.option_checked()) {
if (d.option_checked()) {
team_name = gui_->labels().team_name();
}
else {
} else {
colour = int_to_color(team::get_side_rgb(gui_->viewing_team()+1));
}
const terrain_label *res = gui_->labels().set_label(mousehandler.get_last_hex(), d.textbox_text(), team_name, colour);

View file

@ -718,9 +718,8 @@ bool playsingle_controller::can_execute_command(hotkey::HOTKEY_COMMAND command,
return !events::commands_disabled && game_config::debug && map_.on_board(mouse_handler_.get_last_hex());
case hotkey::HOTKEY_LABEL_TEAM_TERRAIN:
res = menu_handler_.has_team();
case hotkey::HOTKEY_LABEL_TERRAIN:
res = res && !events::commands_disabled && map_.on_board(mouse_handler_.get_last_hex())
res = !events::commands_disabled && map_.on_board(mouse_handler_.get_last_hex())
&& !gui_->shrouded(mouse_handler_.get_last_hex())
&& !is_observer();
break;