From 8e3cfc8a2b30c4e0ea36308aa7dcb6480bc15d76 Mon Sep 17 00:00:00 2001 From: "Ignacio R. Morelle" Date: Fri, 13 Jun 2014 19:24:00 -0400 Subject: [PATCH] Call set_button_state() from playsingle_controller::init_gui() Fixes the minimap buttons sans the minimap unit/village drawing pair being in an indeterminate overlay-less (blank) state for the duration of the initial 'start' WML event in scenarios, unless they are interacted with first. set_button_state() has to be called after play_controller::init_gui() finishes because that method calls game_display::begin() game first, which in turn instantiates the theme UI GUI1 buttons. Notice that set_button_state() is also called when the End Turn button is enabled (e.g. after 'start' is finished). The reason I'm not calling this from play_controller::init_gui() directly is that I am concerned about possible interactions with the replay_controller, which currently seems to do even sloppier work of the GUI before the end of the 'start' event. I might move this call there if that issue is sorted out, since it'll be needed for the replay_controller anyway. --- changelog | 3 +++ players_changelog | 3 +++ src/playsingle_controller.cpp | 1 + 3 files changed, 7 insertions(+) diff --git a/changelog b/changelog index f63cb8823f5a..3ff203ea0fff 100644 --- a/changelog +++ b/changelog @@ -68,6 +68,9 @@ Version 1.13.0-dev: * Fixed the WML load error dialog not displaying an add-on name instead of falling back to its directory name if the add-on contains an outdated _info.cfg file lacking an [info]title= value. + * Fixed most of the minimap buttons and the End Turn button appearing + without contents or in the wrong state during WML start events until they + are interacted with or control is given to the player for the first time. * WML engine: * Added customizable recall costs for unit types and individual units, using the new recall_cost attribute in [unit_type] and [unit]. diff --git a/players_changelog b/players_changelog index 1290cce3f6cc..faf4fd8a1510 100644 --- a/players_changelog +++ b/players_changelog @@ -19,6 +19,9 @@ Version 1.13.0-dev: * Classic Theme which restores the 1.10 UI. * Made orb and minmap colors configurable by the game preferences. * Added a button to copy the in-game Chat Log dialog contents to clipboard. + * Fixed most of the minimap buttons and the End Turn button appearing + without contents or in the wrong state during WML start events until they + are interacted with or control is given to the player for the first time. * Miscellaneous and bug fixes: * Fixed halos glitching through locations that become shrouded after the diff --git a/src/playsingle_controller.cpp b/src/playsingle_controller.cpp index 757e99d0ed0a..c81289f3dceb 100644 --- a/src/playsingle_controller.cpp +++ b/src/playsingle_controller.cpp @@ -105,6 +105,7 @@ void playsingle_controller::init_gui(){ gui_->scroll_to_tile(gameboard_.map().starting_position(1), game_display::WARP); update_locker lock_display(gui_->video(),recorder.is_skipping()); + set_button_state(*gui_); events::raise_draw_event(); gui_->draw(); }