(replay control bar disappears after showing the preferences dialog)
This commit is contained in:
Jörg Hinrichs 2006-09-03 17:42:45 +00:00
parent 8200878130
commit aef0dfb4b0
4 changed files with 29 additions and 7 deletions

View file

@ -827,6 +827,8 @@ void display::draw(bool update,bool force)
draw_label(video(),screen,*i);
}
create_buttons();
//invalidate the reports so they are redrawn
std::fill(reports_,reports_+sizeof(reports_)/sizeof(*reports_),reports::report());
invalidateGameStatus_ = true;
@ -2068,6 +2070,10 @@ void display::invalidate_animations()
}
void display::invalidate_theme(){
panelsDrawn_ = false;
}
void display::recalculate_minimap()
{
if(minimap_ != NULL) {

View file

@ -237,6 +237,10 @@ public:
//function to invalidate animated terrains which may have changed.
void invalidate_animations();
//function to invalidate controls and panels when changed after
//they have been drawn initially. Useful for dynamic theme modification.
void invalidate_theme();
//function to schedule the minimap for recalculation. Useful if any
//terrain in the map has changed.
void recalculate_minimap();

View file

@ -80,13 +80,7 @@ void replay_controller::init(){
//guarantee the cursor goes back to 'normal' at the end of the level
const cursor::setter cursor_setter(cursor::NORMAL);
LOG_NG << "initializing replay-display... " << (SDL_GetTicks() - ticks_) << "\n";
const config* theme_cfg = get_theme(game_config_, level_["theme"]);
const config* replay_theme_cfg = theme_cfg->child("resolution")->child("replay");
if (NULL != replay_theme_cfg)
gui_->get_theme().modify(replay_theme_cfg);
LOG_NG << "done initializing replay-display... " << (SDL_GetTicks() - ticks_) << "\n";
init_replay_display();
fire_prestart(true);
init_gui();
@ -112,6 +106,16 @@ void replay_controller::init_gui(){
}
}
void replay_controller::init_replay_display(){
LOG_NG << "initializing replay-display... " << (SDL_GetTicks() - ticks_) << "\n";
const config* theme_cfg = get_theme(game_config_, level_["theme"]);
const config* replay_theme_cfg = theme_cfg->child("resolution")->child("replay");
if (NULL != replay_theme_cfg)
gui_->get_theme().modify(replay_theme_cfg);
gui_->invalidate_theme();
LOG_NG << "done initializing replay-display... " << (SDL_GetTicks() - ticks_) << "\n";
}
std::vector<team>& replay_controller::get_teams(){
return teams_;
}
@ -293,6 +297,12 @@ void replay_controller::update_gui(){
(*gui_).draw();
}
void replay_controller::preferences(){
play_controller::preferences();
init_replay_display();
update_gui();
}
bool replay_controller::can_execute_command(hotkey::HOTKEY_COMMAND command) const
{
bool result = play_controller::can_execute_command(command);

View file

@ -49,6 +49,7 @@ public:
const bool is_loading_game();
//event handlers
virtual void preferences();
void play_replay();
void reset_replay();
void stop_replay();
@ -69,6 +70,7 @@ private:
virtual void play_side(const unsigned int team_index, bool save);
void update_teams();
void update_gui();
void init_replay_display();
game_state gamestate_start_;
gamestatus status_start_;