Skip to content

Commit

Permalink
Call set_button_state() from playsingle_controller::init_gui()
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
irydacea committed Jun 13, 2014
1 parent d1a4a52 commit 8e3cfc8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions changelog
Expand Up @@ -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].
Expand Down
3 changes: 3 additions & 0 deletions players_changelog
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/playsingle_controller.cpp
Expand Up @@ -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();
}
Expand Down

0 comments on commit 8e3cfc8

Please sign in to comment.