Merge pull request #3555 from jostephd/objectives-prestart-for-master
Fwdport b7cb36a711
This commit is contained in:
commit
63d06f8a38
3 changed files with 11 additions and 4 deletions
|
@ -138,10 +138,7 @@ void menu_handler::objectives()
|
|||
return;
|
||||
}
|
||||
|
||||
config cfg;
|
||||
cfg["side"] = gui_->viewing_side();
|
||||
gamestate().lua_kernel_->run_wml_action("show_objectives", vconfig(cfg),
|
||||
game_events::queued_event("_from_interface", "", map_location(), map_location(), config()));
|
||||
pc_.refresh_objectives();
|
||||
pc_.show_objectives();
|
||||
}
|
||||
|
||||
|
|
|
@ -388,6 +388,13 @@ void play_controller::fire_prestart()
|
|||
gamestate().gamedata_.get_variable("turn_number") = static_cast<int>(turn());
|
||||
}
|
||||
|
||||
void play_controller::refresh_objectives() const
|
||||
{
|
||||
const config cfg("side", gui_->viewing_side());
|
||||
gamestate().lua_kernel_->run_wml_action("show_objectives", vconfig(cfg),
|
||||
game_events::queued_event("_from_interface", "", map_location(), map_location(), config()));
|
||||
}
|
||||
|
||||
void play_controller::fire_start()
|
||||
{
|
||||
gamestate().gamedata_.set_phase(game_data::START);
|
||||
|
@ -396,6 +403,7 @@ void play_controller::fire_start()
|
|||
// start event may modify start turn with WML, reflect any changes.
|
||||
gamestate().gamedata_.get_variable("turn_number") = static_cast<int>(turn());
|
||||
|
||||
refresh_objectives();
|
||||
check_objectives();
|
||||
|
||||
// prestart and start events may modify the initial gold amount, reflect any changes.
|
||||
|
|
|
@ -361,6 +361,8 @@ public:
|
|||
return false;
|
||||
}
|
||||
|
||||
/// Reevaluate [show_if] conditions and build a new objectives string.
|
||||
void refresh_objectives() const;
|
||||
void show_objectives() const;
|
||||
|
||||
struct scoped_savegame_snapshot
|
||||
|
|
Loading…
Add table
Reference in a new issue