The Battle for Wesnoth  1.15.1+dev
Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
gui2::dialogs::mp_options_helper Class Reference

#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 = std::map< std::string, string_map >
 
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_valueadd_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_enginecreate_engine_
 
tree_viewoptions_tree_
 
styled_widgetno_options_notice_
 
std::map< std::string, type_node_datanode_data_map_
 
std::vector< option_sourcevisible_options_
 
std::map< std::string, configoptions_data_
 

Detailed Description

Definition at line 34 of file mp_options_helper.hpp.

Member Typedef Documentation

◆ data_map

using gui2::dialogs::mp_options_helper::data_map = std::map<std::string, string_map>
private

Definition at line 61 of file mp_options_helper.hpp.

◆ node_vector

Definition at line 85 of file mp_options_helper.hpp.

Constructor & Destructor Documentation

◆ mp_options_helper()

gui2::dialogs::mp_options_helper::mp_options_helper ( window window,
ng::create_engine create_engine 
)

Definition at line 35 of file mp_options_helper.cpp.

References c, preferences::options(), options_data_, and update_all_options().

Member Function Documentation

◆ add_node_and_get_widget()

template<typename T >
std::pair< T *, config::attribute_value > gui2::dialogs::mp_options_helper::add_node_and_get_widget ( tree_view_node option_node,
const std::string &  id,
data_map data,
const config cfg 
)
private

◆ display_custom_options()

void gui2::dialogs::mp_options_helper::display_custom_options ( const std::string &  type,
int  node_position,
const config data 
)
private

◆ get_options_config()

config gui2::dialogs::mp_options_helper::get_options_config ( )

◆ remove_nodes_for_type()

int gui2::dialogs::mp_options_helper::remove_nodes_for_type ( const std::string &  type)
private

◆ reset_options_data()

void gui2::dialogs::mp_options_helper::reset_options_data ( const option_source source,
bool &  handled,
bool &  halt 
)
private

◆ update_all_options()

void gui2::dialogs::mp_options_helper::update_all_options ( )

◆ update_era_options()

void gui2::dialogs::mp_options_helper::update_era_options ( )

◆ update_game_options()

void gui2::dialogs::mp_options_helper::update_game_options ( )

◆ update_mod_options()

void gui2::dialogs::mp_options_helper::update_mod_options ( )

◆ update_options_data_map() [1/3]

template<typename T >
void gui2::dialogs::mp_options_helper::update_options_data_map ( T *  widget,
const option_source source 
)
private

◆ update_options_data_map() [2/3]

void gui2::dialogs::mp_options_helper::update_options_data_map ( toggle_button widget,
const option_source source 
)
private

◆ update_options_data_map() [3/3]

template<>
void gui2::dialogs::mp_options_helper::update_options_data_map ( toggle_button widget,
const option_source source 
)

◆ update_options_data_map_menu_button()

void gui2::dialogs::mp_options_helper::update_options_data_map_menu_button ( menu_button widget,
const option_source source,
const config cfg 
)
private

◆ update_status_label()

void gui2::dialogs::mp_options_helper::update_status_label ( )
private

Member Data Documentation

◆ create_engine_

ng::create_engine& gui2::dialogs::mp_options_helper::create_engine_
private

◆ no_options_notice_

styled_widget& gui2::dialogs::mp_options_helper::no_options_notice_
private

Definition at line 83 of file mp_options_helper.hpp.

Referenced by update_status_label().

◆ node_data_map_

std::map<std::string, type_node_data> gui2::dialogs::mp_options_helper::node_data_map_
private

◆ options_data_

std::map<std::string, config> gui2::dialogs::mp_options_helper::options_data_
private

◆ options_tree_

tree_view& gui2::dialogs::mp_options_helper::options_tree_
private

◆ visible_options_

std::vector<option_source> gui2::dialogs::mp_options_helper::visible_options_
private

The documentation for this class was generated from the following files: