15 #ifndef MP_OPTIONS_HPP_INCLUDED
16 #define MP_OPTIONS_HPP_INCLUDED
23 #include "widgets/label.hpp"
24 #include "widgets/button.hpp"
26 #include "widgets/slider.hpp"
virtual void layout(int &xpos, int &ypos, int w, int border_size, gui::scrollpane *pane)=0
void set_value(const config::attribute_value &)
void restore_defaults(const std::string &component)
title_display(CVideo &video, const std::string &label)
void set_value(const config::attribute_value &val)
entry_display(CVideo &video, const config &cfg)
CVideo & video_
The screen to display the dialog on.
virtual void process_event()
gui::scrollpane * pane_
The scrollarea to put the widgets on.
virtual void hide_children(bool hide)
std::string era_
The id of the selected era.
void hide_children(bool hide=true)
void layout(int &xpos, int &ypos, int w, int border_size, gui::scrollpane *pane)
void set_scenario(const std::string &id)
Sets the selected scenario.
std::vector< std::string > modifications_
The ids of the selected modifications.
config options_info_
Stores needed info about each element and their configuration options.
void layout(int &xpos, int &ypos, int w, int border_size, gui::scrollpane *pane)
GLuint const GLfloat * val
config values_
Stores the selected values for each option.
void set_modifications(const std::vector< std::string > &ids)
Sets the activated modifications.
void init_info(const config &cfg, const std::string &key)
Adds the necessary information about the specified component to options_info_.
reset_display(CVideo &video, const std::string &comp, manager &m)
std::string scenario_
The id of the selected [multiplayer] or [campaign].
Definitions for the interface to Wesnoth Markup Language (WML).
Variant for storing WML attributes.
config::attribute_value get_value() const
GLboolean GLenum GLenum GLvoid * values
bool is_active(const std::string &id) const
This module controls the multiplayer lobby.
config::attribute_value get_default_value(const std::string &id) const
Retrieves the default value for a certain option.
void layout(int &xpos, int &ypos, int w, int border_size, gui::scrollpane *pane)
void hide_children(bool hide)
config::attribute_value get_value() const
const config & get_component_cfg(const std::string &id) const
virtual void hide_children(bool hide)=0
virtual void hide_children(bool hide)
std::map< std::string, option_display * > widgets_
GLubyte GLubyte GLubyte GLubyte w
config & get_value_cfg(const std::string &id)
Returns the node which holds the selected value of an option.
virtual ~option_display()
void set_era(const std::string &id)
Sets the selected era.
void extract_values(const std::string &key, const std::string &id)
Writes all the values for the options of a certain component from a specified window into values_...
void layout(int &xpos, int &ypos, int w, int border_size, gui::scrollpane *pane)
slider_display(CVideo &video, const config &cfg)
void set_value(const config::attribute_value &)
checkbox_display(CVideo &video, const config &cfg)
std::vector< std::string > values_
virtual void hide_children(bool hide)
config::attribute_value get_value() const
const std::string label_text_
std::vector< option_display * > widgets_ordered_
void layout(int &xpos, int &ypos, int w, int border_size, gui::scrollpane *pane)
manager(const config &gamecfg, CVideo &video, gui::scrollpane *pane, const config &initial_value)
Constructor.
config::any_child get_option_parent(const std::string &id) const
Finds the parent node of an options.
void layout(int &xpos, int &ypos, int w, int border_size, gui::scrollpane *pane)
combo_display(CVideo &video, const config &cfg)
config::attribute_value get_value() const
virtual config::attribute_value get_value() const =0
config::attribute_value get_stored_value(const std::string &id) const
Retrieves the saved value for a certain option, or the default, if there's no such.
void set_value(const config::attribute_value &val)
void set_value(const config::attribute_value &val)
virtual void hide_children(bool hide)
const config & get_option_info_cfg(const std::string &id) const
Returns the information about an option.
void set_campaign(const std::string &id)
Sets the selected campaign.
config::attribute_value get_value() const
config::attribute_value get_value() const
const config & get_value_cfg_or_empty(const std::string &id) const
Returns the node which holds the selected value of an option.
const config & get_values()
Returns the the values for each option.
void hide_children(bool hide)
A config object defines a single node in a WML file, with access to child nodes.
virtual void set_value(const config::attribute_value &val)=0
static bool is_valid_option(const std::string &key, const config &option)
Decides whether a config is a sane option node or not.
GLsizei const GLcharARB ** string
void layout_widgets(int startx, int starty, int w)
void set_values(const config &values)
Set the current values the options.
void set_value(const config::attribute_value &val)