Changed delayed shroud updates and scenarion objectives...

...to change and show settings for viewing team. (help in bug #13313)

I don't know if this should be backported to stable also. Current
behavior could be considered as bug so maybe yes.
This commit is contained in:
Pauli Nieminen 2009-04-16 14:23:58 +00:00
parent 746646e802
commit 0cf1def5ac
3 changed files with 14 additions and 9 deletions

View File

@ -79,6 +79,8 @@ Version 1.7.0-svn:
special
* Fix missing faction column when waiting that the host start the game,
plus some other unwanted changes there (bug #13243)
* Make delayed shroud updates and scenarion objectives to change and
show information for viewing team. (help in bug #13313)
* Making the game return to the add-on install dialog just before
installing one, and with its entry selected
* Implemented FR #13321: added "unit advances=N" command to debug console

View File

@ -271,7 +271,7 @@ void play_controller::place_sides_in_preferred_locations(gamemap& map, const con
}
void play_controller::objectives(){
menu_handler_.objectives(player_number_);
menu_handler_.objectives(gui_->viewing_team()+1);
}
void play_controller::show_statistics(){
@ -722,9 +722,9 @@ void play_controller::slice_before_scroll() {
}
void play_controller::slice_end() {
if(!browse_ && current_team().objectives_changed()) {
dialogs::show_objectives(*gui_, level_, current_team().objectives());
current_team().reset_objectives_changed();
if(!browse_ && teams_[gui_->viewing_team()].objectives_changed()) {
dialogs::show_objectives(*gui_, level_, teams_[gui_->viewing_team()].objectives());
teams_[gui_->viewing_team()].reset_objectives_changed();
}
}
@ -951,7 +951,7 @@ hotkey::ACTION_STATE play_controller::get_action_state(hotkey::HOTKEY_COMMAND co
{
switch(command) {
case hotkey::HOTKEY_DELAY_SHROUD:
return current_team().auto_shroud_updates() ? hotkey::ACTION_OFF : hotkey::ACTION_ON;
return teams_[gui_->viewing_team()].auto_shroud_updates() ? hotkey::ACTION_OFF : hotkey::ACTION_ON;
default:
return hotkey::ACTION_STATELESS;
}

View File

@ -108,11 +108,11 @@ void playsingle_controller::recall(){
}
void playsingle_controller::toggle_shroud_updates(){
menu_handler_.toggle_shroud_updates(player_number_);
menu_handler_.toggle_shroud_updates(gui_->viewing_team()+1);
}
void playsingle_controller::update_shroud_now(){
menu_handler_.update_shroud_now(player_number_);
menu_handler_.update_shroud_now(gui_->viewing_team()+1);
}
void playsingle_controller::end_turn(){
@ -875,10 +875,13 @@ bool playsingle_controller::can_execute_command(hotkey::HOTKEY_COMMAND command,
return (!browse_ || linger_) && !events::commands_disabled;
case hotkey::HOTKEY_DELAY_SHROUD:
return !linger_ && (current_team().uses_fog() || current_team().uses_shroud())
return !linger_ && (teams_[gui_->viewing_team()].uses_fog() || teams_[gui_->viewing_team()].uses_shroud())
&& !events::commands_disabled;
case hotkey::HOTKEY_UPDATE_SHROUD:
return !linger_ && !events::commands_disabled && current_team().auto_shroud_updates() == false;
return !linger_
&& player_number_-1 == gui_->viewing_team()
&& !events::commands_disabled
&& teams_[gui_->viewing_team()].auto_shroud_updates() == false;
// Commands we can only do if in debug mode
case hotkey::HOTKEY_CREATE_UNIT: