Unable undrawing of dialogs used in the title-screen

This sets the restore_ flag to true for the obvious dialogs I've found
that are used on the title-screen.

Also, make GUI1 dialogs mark all buttons dirty on a DRAW_ALL_EVENT to
ensure the buttons get redrawn.
This commit is contained in:
Andreas Löf 2016-02-26 16:24:37 +13:00
parent b576e1ae90
commit cc760cb33f
5 changed files with 9 additions and 0 deletions

View file

@ -58,6 +58,7 @@ taddon_connect::taddon_connect(std::string& host_name,
display*)
: allow_remove_(allow_remove)
{
set_restore(true);
register_text("host_name", false, host_name, true);
}

View file

@ -79,6 +79,8 @@ tcampaign_difficulty::tcampaign_difficulty(
, campaign_id_(campaign["id"])
, selected_difficulty_()
{
set_restore(true);
// Populate local config with difficulty children
difficulties_.append_children(campaign, "difficulty");

View file

@ -30,6 +30,7 @@ public:
choice_(-1),
deterministic_(false)
{
set_restore(true);
}
/***** ***** ***** setters / getters for members ***** ****** *****/

View file

@ -73,6 +73,7 @@ tnetwork_transmission::tnetwork_transmission(
, subtitle_(subtitle)
{
register_label("title", true, title, false);
set_restore(true);
}
void tnetwork_transmission::set_subtitle(const std::string& subtitle)

View file

@ -168,6 +168,10 @@ void dialog_frame::handle_event(const SDL_Event& event) {
if (event.type == DRAW_ALL_EVENT) {
set_dirty();
for(std::vector<button *>::iterator it = buttons_->begin(); it != buttons_->end(); ++it) {
(*it)->set_dirty(true);
}
}
if (event.type == DRAW_EVENT || event.type == DRAW_ALL_EVENT) {