#include <mp_options_helper.hpp>
Classes | |
struct | option_source |
struct | type_node_data |
Public Member Functions | |
mp_options_helper (window &window, ng::create_engine &create_engine) | |
void | update_all_options () |
void | update_game_options () |
void | update_era_options () |
void | update_mod_options () |
config | get_options_config () |
template<> | |
void | update_options_data_map (toggle_button *widget, const option_source &source) |
Private Types | |
using | data_map = widget_data |
using | node_vector = std::vector< tree_view_node * > |
Private Member Functions | |
int | remove_nodes_for_type (const std::string &type) |
template<typename T > | |
std::pair< T *, config::attribute_value > | add_node_and_get_widget (tree_view_node &option_node, const std::string &id, data_map &data, const config &cfg) |
void | display_custom_options (const std::string &type, int node_position, const config &data) |
template<typename T > | |
void | update_options_data_map (T *widget, const option_source &source) |
void | update_options_data_map (toggle_button *widget, const option_source &source) |
void | update_options_data_map_menu_button (menu_button *widget, const option_source &source, const config &cfg) |
void | reset_options_data (const option_source &source, bool &handled, bool &halt) |
void | update_status_label () |
Private Attributes | |
ng::create_engine & | create_engine_ |
tree_view & | options_tree_ |
styled_widget & | no_options_notice_ |
std::map< std::string, type_node_data > | node_data_map_ |
std::vector< option_source > | visible_options_ |
std::map< std::string, config > | options_data_ |
Definition at line 34 of file mp_options_helper.hpp.
|
private |
Definition at line 61 of file mp_options_helper.hpp.
|
private |
Definition at line 85 of file mp_options_helper.hpp.
gui2::dialogs::mp_options_helper::mp_options_helper | ( | window & | window, |
ng::create_engine & | create_engine | ||
) |
Definition at line 34 of file mp_options_helper.cpp.
References _(), prefs::get(), options_data_, and update_all_options().
|
private |
Definition at line 177 of file mp_options_helper.cpp.
References gui2::tree_view_node::add_child(), data, gui2::tree_view_node::find(), gui2::missing_widget(), options_data_, gui2::widget::set_id(), VALIDATE, and visible_options_.
|
private |
Definition at line 198 of file mp_options_helper.cpp.
References gui2::tree_view_node::add_child(), gui2::tree_view::add_node(), config::child_range(), gui2::event::connect_signal_mouse_left_click(), gui2::event::connect_signal_notify_modified(), data, gui2::widget::find_widget(), config::has_child(), i, node_data_map_, options_tree_, reset_options_data(), gui2::menu_button::set_selected(), gui2::slider::set_step_size(), gui2::text_box_base::set_text_changed_callback(), gui2::text_box_base::set_value(), gui2::slider::set_value(), gui2::toggle_button::set_value(), gui2::slider::set_value_range(), gui2::menu_button::set_values(), config_attribute_value::str(), config_attribute_value::to_bool(), config_attribute_value::to_int(), update_options_data_map_menu_button(), and visible_options_.
Referenced by update_era_options(), update_game_options(), and update_mod_options().
config gui2::dialogs::mp_options_helper::get_options_config | ( | ) |
Definition at line 316 of file mp_options_helper.cpp.
References config::add_child(), options_data_, and visible_options_.
|
private |
Definition at line 106 of file mp_options_helper.cpp.
References data, utils::erase_if(), i, gui2::dialogs::mp_options_helper::option_source::level_type, node_data_map_, options_tree_, gui2::tree_view::remove_node(), and visible_options_.
Referenced by update_era_options(), update_game_options(), and update_mod_options().
|
private |
Definition at line 160 of file mp_options_helper.cpp.
References gui2::dialogs::mp_options_helper::option_source::id, gui2::dialogs::mp_options_helper::option_source::level_type, options_data_, update_era_options(), update_game_options(), and update_mod_options().
Referenced by display_custom_options().
void gui2::dialogs::mp_options_helper::update_all_options | ( | ) |
Definition at line 51 of file mp_options_helper.cpp.
References gui2::tree_view::clear(), node_data_map_, options_tree_, update_era_options(), update_game_options(), update_mod_options(), and visible_options_.
Referenced by mp_options_helper().
void gui2::dialogs::mp_options_helper::update_era_options | ( | ) |
Definition at line 82 of file mp_options_helper.cpp.
References create_engine_, ng::create_engine::curent_era_cfg(), display_custom_options(), remove_nodes_for_type(), and update_status_label().
Referenced by reset_options_data(), and update_all_options().
void gui2::dialogs::mp_options_helper::update_game_options | ( | ) |
Definition at line 62 of file mp_options_helper.cpp.
References create_engine_, ng::create_engine::current_level(), ng::level::data(), display_custom_options(), ng::create_engine::is_campaign(), remove_nodes_for_type(), and update_status_label().
Referenced by reset_options_data(), and update_all_options().
void gui2::dialogs::mp_options_helper::update_mod_options | ( | ) |
Definition at line 93 of file mp_options_helper.cpp.
References ng::create_engine::active_mods_data(), create_engine_, display_custom_options(), remove_nodes_for_type(), and update_status_label().
Referenced by reset_options_data(), and update_all_options().
|
private |
Definition at line 144 of file mp_options_helper.cpp.
References gui2::dialogs::mp_options_helper::option_source::id, gui2::widget::id(), and options_data_.
void gui2::dialogs::mp_options_helper::update_options_data_map | ( | toggle_button * | widget, |
const option_source & | source | ||
) |
Definition at line 150 of file mp_options_helper.cpp.
References gui2::dialogs::mp_options_helper::option_source::id, gui2::widget::id(), and options_data_.
|
private |
|
private |
Definition at line 155 of file mp_options_helper.cpp.
References config::child_range(), gui2::dialogs::mp_options_helper::option_source::id, gui2::widget::id(), and options_data_.
Referenced by display_custom_options().
|
private |
Definition at line 137 of file mp_options_helper.cpp.
References gui2::tree_view::empty(), gui2::widget::invisible, no_options_notice_, options_tree_, gui2::widget::set_visible(), and gui2::widget::visible.
Referenced by update_era_options(), update_game_options(), and update_mod_options().
|
private |
Definition at line 80 of file mp_options_helper.hpp.
Referenced by update_era_options(), update_game_options(), and update_mod_options().
|
private |
Definition at line 83 of file mp_options_helper.hpp.
Referenced by update_status_label().
|
private |
Definition at line 99 of file mp_options_helper.hpp.
Referenced by display_custom_options(), remove_nodes_for_type(), and update_all_options().
|
private |
Definition at line 102 of file mp_options_helper.hpp.
Referenced by add_node_and_get_widget(), get_options_config(), mp_options_helper(), reset_options_data(), update_options_data_map(), and update_options_data_map_menu_button().
|
private |
Definition at line 82 of file mp_options_helper.hpp.
Referenced by display_custom_options(), remove_nodes_for_type(), update_all_options(), and update_status_label().
|
private |
Definition at line 101 of file mp_options_helper.hpp.
Referenced by add_node_and_get_widget(), display_custom_options(), get_options_config(), remove_nodes_for_type(), and update_all_options().