#include <loadscreen.hpp>
Public Member Functions | |
tloadscreen (std::function< void()> f) | |
~tloadscreen () | |
void | close () |
Hides the window. More... | |
Public Member Functions inherited from gui2::tdialog | |
tdialog () | |
virtual | ~tdialog () |
bool | show (CVideo &video, const unsigned auto_close_time=0) |
Shows the window. More... | |
int | get_retval () const |
void | set_always_save_fields (const bool always_save_fields) |
void | set_restore (const bool restore) |
Static Public Member Functions | |
static void | display (CVideo &video, std::function< void()> f) |
static bool | displaying () |
static void | progress (const char *stage_name=nullptr) |
Private Member Functions | |
twindow * | build_window (CVideo &video) const |
virtual const std::string & | window_id () const |
The id of the window to build. More... | |
void | timer_callback (twindow &window) |
void | pre_show (twindow &window) |
Inherited from tdialog. More... | |
void | post_show (twindow &window) |
Inherited from tdialog. More... | |
Private Attributes | |
twindow * | window_ |
size_t | timer_id_ |
int | animation_counter_ |
std::function< void()> | work_ |
boost::scoped_ptr< boost::thread > | worker_ |
boost::scoped_ptr< cursor::setter > | cursor_setter_ |
tlabel * | progress_stage_label_ |
tlabel * | animation_label_ |
std::atomic< const char * > | current_stage_ |
std::map< std::string, t_string > | visible_stages_ |
std::vector< t_string > | animation_stages_ |
std::map< std::string, t_string >::const_iterator | current_visible_stage_ |
Static Private Attributes | |
static tloadscreen * | current_load = nullptr |
Additional Inherited Members | |
Protected Member Functions inherited from gui2::tdialog | |
tfield_bool * | register_bool (const std::string &id, const bool mandatory, const std::function< bool()> &callback_load_value=std::function< bool()>(), const std::function< void(const bool)> &callback_save_value=std::function< void(const bool)>(), const std::function< void(twidget &)> &callback_change=std::function< void(twidget &)>()) |
Creates a new boolean field. More... | |
tfield_bool * | register_bool (const std::string &id, const bool mandatory, bool &linked_variable, const std::function< void(twidget &)> &callback_change=std::function< void(twidget &)>()) |
Creates a new boolean field. More... | |
tfield_integer * | register_integer (const std::string &id, const bool mandatory, const std::function< int()> &callback_load_value=std::function< int()>(), const std::function< void(const int)> &callback_save_value=std::function< void(const int)>()) |
Creates a new integer field. More... | |
tfield_integer * | register_integer (const std::string &id, const bool mandatory, int &linked_variable) |
Creates a new integer field. More... | |
tfield_text * | register_text (const std::string &id, const bool mandatory, const std::function< std::string()> &callback_load_value=std::function< std::string()>(), const std::function< void(const std::string &)> &callback_save_value=std::function< void(const std::string &)>(), const bool capture_focus=false) |
Creates a new text field. More... | |
tfield_text * | register_text (const std::string &id, const bool mandatory, std::string &linked_variable, const bool capture_focus=false) |
Creates a new text field. More... | |
tfield_label * | register_label (const std::string &id, const bool mandatory, const std::string &text, const bool use_markup=false) |
Registers a new control as a label. More... | |
tfield_label * | register_image (const std::string &id, const bool mandatory, const std::string &filename) |
Registers a new control as image. More... | |
Definition at line 40 of file loadscreen.hpp.
gui2::tloadscreen::tloadscreen | ( | std::function< void()> | f | ) |
gui2::tloadscreen::~tloadscreen | ( | ) |
Definition at line 175 of file loadscreen.cpp.
References close(), and current_load.
Definition at line 102 of file loadscreen.cpp.
References gui2::build(), and window_id().
void gui2::tloadscreen::close | ( | ) |
Hides the window.
The hiding also destroys the window. It is safe to call the function when the window is not shown.
Definition at line 93 of file loadscreen.cpp.
References gui2::twindow::undraw(), and window_.
Referenced by ~tloadscreen().
Definition at line 181 of file loadscreen.cpp.
References current_load, preferences::disable_loadingscreen_animation(), CVideo::faked(), and tloadscreen().
Referenced by do_gameloop(), play_controller::init(), game_launcher::launch_game(), and game_config_manager::load_game_config_with_loadscreen().
|
inlinestatic |
Definition at line 49 of file loadscreen.hpp.
References current_load.
Referenced by mp::ui::handle_event(), and display::handle_event().
Inherited from tdialog.
Reimplemented from gui2::tdialog.
Definition at line 121 of file loadscreen.cpp.
References cursor_setter_, gui2::remove_timer(), timer_id_, and worker_.
Inherited from tdialog.
Reimplemented from gui2::tdialog.
Definition at line 107 of file loadscreen.cpp.
References gui2::add_timer(), animation_label_, cursor_setter_, progress_stage_label_, timer_callback(), timer_id_, cursor::WAIT, work_, and worker_.
|
static |
Definition at line 128 of file loadscreen.cpp.
References current_load, and current_stage_.
Referenced by unit_type_data::build_all(), do_gameloop(), game_state::init(), play_controller::init(), game_launcher::launch_game(), game_config_manager::load_game_config(), terrain_builder::parse_config(), unit_type_data::set_config(), and game_config_manager::set_unit_data().
Definition at line 145 of file loadscreen.cpp.
References animation_counter_, animation_label_, animation_stages_, gui2::twindow::close(), current_stage_, current_visible_stage_, progress_stage_label_, gui2::tcontrol::set_label(), visible_stages_, work_, worker_, and WRN_LS.
Referenced by pre_show().
|
privatevirtual |
|
private |
Definition at line 63 of file loadscreen.hpp.
Referenced by timer_callback().
|
private |
Definition at line 81 of file loadscreen.hpp.
Referenced by pre_show(), and timer_callback().
|
private |
Definition at line 91 of file loadscreen.hpp.
Referenced by timer_callback().
|
staticprivate |
Definition at line 82 of file loadscreen.hpp.
Referenced by display(), displaying(), progress(), and ~tloadscreen().
|
private |
Definition at line 88 of file loadscreen.hpp.
Referenced by progress(), and timer_callback().
|
private |
Definition at line 92 of file loadscreen.hpp.
Referenced by timer_callback().
|
private |
Definition at line 66 of file loadscreen.hpp.
Referenced by post_show(), and pre_show().
|
private |
Definition at line 80 of file loadscreen.hpp.
Referenced by pre_show(), and timer_callback().
|
private |
Definition at line 62 of file loadscreen.hpp.
Referenced by post_show(), and pre_show().
|
private |
Definition at line 90 of file loadscreen.hpp.
Referenced by timer_callback().
|
private |
Definition at line 61 of file loadscreen.hpp.
Referenced by close().
|
private |
Definition at line 64 of file loadscreen.hpp.
Referenced by pre_show(), and timer_callback().
|
private |
Definition at line 65 of file loadscreen.hpp.
Referenced by post_show(), pre_show(), and timer_callback().