A GUI theme definition. More...
#include <gui_definition.hpp>
Public Types | |
using | widget_definition_map_t = std::map< std::string, styled_widget_definition_ptr > |
Public Member Functions | |
gui_definition (const config &cfg) | |
Private ctor. More... | |
void | activate () const |
Activates this GUI. More... | |
t_string | description () |
Public Attributes | |
std::map< std::string, widget_definition_map_t > | widget_types |
Map of each widget type, by id, and a sub-map of each of the type's definitions, also by id. More... | |
std::map< std::string, builder_window > | window_types |
Map of all known windows (the builder class builds a window). More... | |
Private Attributes | |
std::string | id_ |
t_string | description_ |
unsigned | popup_show_delay_ |
unsigned | popup_show_time_ |
unsigned | help_show_time_ |
unsigned | double_click_time_ |
unsigned | repeat_button_repeat_time_ |
std::string | sound_button_click_ |
std::string | sound_toggle_button_click_ |
std::string | sound_toggle_panel_click_ |
std::string | sound_slider_adjust_ |
t_string | has_helptip_message_ |
std::vector< game_tip > | tips_ |
A GUI theme definition.
Each theme defines the appearance and layout of widgets and windows. At least one theme (the default) must exist for the game to run. That theme is expected to contain at least one default definition for each widget type and a layout for each window recorded in the static registry. Do note that a widget type may have any number of definitions defined per theme, but a window may only have one layout.
Non-default themes may omit a default widget definition or a window layout, in which case the game will fall back on the default definition (for widgets) or the layout (for windows) specified in the default theme.
Each widget definition and window layout may also define different variations of itself to be used based on the current game resolution.
As of December 2017 only the default theme is provided.
Definition at line 46 of file gui_definition.hpp.
using gui2::gui_definition::widget_definition_map_t = std::map<std::string, styled_widget_definition_ptr> |
Definition at line 52 of file gui_definition.hpp.
|
explicit |
Private ctor.
Use create to initialize a new definition.
Parse widget definitions of each registered type.
Parse each window.
Definition at line 33 of file gui_definition.cpp.
References config::child_range(), DBG_GUI_P, description_, double_click_time_, t_string::empty(), ERR_GUI_P, has_helptip_message_, help_show_time_, id_, config::mandatory_child(), missing_mandatory_wml_key(), popup_show_delay_, popup_show_time_, gui2::registered_widget_types(), gui2::registered_window_types(), repeat_button_repeat_time_, sound_button_click_, sound_slider_adjust_, sound_toggle_button_click_, sound_toggle_panel_click_, VALIDATE, w, widget_types, and window_types.
void gui2::gui_definition::activate | ( | ) | const |
Activates this GUI.
Definition at line 146 of file gui_definition.cpp.
References gui2::settings::double_click_time, double_click_time_, gui2::settings::has_helptip_message, has_helptip_message_, gui2::settings::help_show_time, help_show_time_, gui2::settings::popup_show_delay, popup_show_delay_, gui2::settings::popup_show_time, popup_show_time_, gui2::settings::repeat_button_repeat_time, repeat_button_repeat_time_, gui2::settings::sound_button_click, sound_button_click_, gui2::settings::sound_slider_adjust, sound_slider_adjust_, gui2::settings::sound_toggle_button_click, sound_toggle_button_click_, gui2::settings::sound_toggle_panel_click, sound_toggle_panel_click_, gui2::settings::tips, and tips_.
|
inline |
Definition at line 63 of file gui_definition.hpp.
References description_.
|
private |
Definition at line 70 of file gui_definition.hpp.
Referenced by description(), and gui_definition().
|
private |
Definition at line 75 of file gui_definition.hpp.
Referenced by activate(), and gui_definition().
|
private |
Definition at line 83 of file gui_definition.hpp.
Referenced by activate(), and gui_definition().
|
private |
Definition at line 74 of file gui_definition.hpp.
Referenced by activate(), and gui_definition().
|
private |
Definition at line 68 of file gui_definition.hpp.
Referenced by gui_definition().
|
private |
Definition at line 72 of file gui_definition.hpp.
Referenced by activate(), and gui_definition().
|
private |
Definition at line 73 of file gui_definition.hpp.
Referenced by activate(), and gui_definition().
|
private |
Definition at line 76 of file gui_definition.hpp.
Referenced by activate(), and gui_definition().
|
private |
Definition at line 78 of file gui_definition.hpp.
Referenced by activate(), and gui_definition().
|
private |
Definition at line 81 of file gui_definition.hpp.
Referenced by activate(), and gui_definition().
|
private |
Definition at line 79 of file gui_definition.hpp.
Referenced by activate(), and gui_definition().
|
private |
Definition at line 80 of file gui_definition.hpp.
Referenced by activate(), and gui_definition().
|
private |
Definition at line 85 of file gui_definition.hpp.
Referenced by activate().
std::map<std::string, widget_definition_map_t> gui2::gui_definition::widget_types |
Map of each widget type, by id, and a sub-map of each of the type's definitions, also by id.
Definition at line 55 of file gui_definition.hpp.
Referenced by gui_definition().
std::map<std::string, builder_window> gui2::gui_definition::window_types |
Map of all known windows (the builder class builds a window).
Definition at line 58 of file gui_definition.hpp.
Referenced by gui_definition().