15#define GETTEXT_DOMAIN "wesnoth-lib"
34std::string get_orb_widget_prefix(
const std::string& base_id)
36 return "orb_" + base_id +
"_";
45 , show_unmoved_(
prefs::get().show_unmoved_orb())
46 , show_partial_(
prefs::get().show_partial_orb())
47 , show_disengaged_(
prefs::get().show_disengaged_orb())
48 , show_moved_(
prefs::get().show_moved_orb())
49 , show_ally_(
prefs::get().show_ally_orb())
50 , two_color_ally_(
prefs::get().show_status_on_ally_orb())
51 , show_enemy_(
prefs::get().show_enemy_orb())
63 connect_signal_mouse_left_click(
90 const std::string prefix = get_orb_widget_prefix(base_id);
91 toggle_button& toggle = find_widget<toggle_button>(prefix +
"show");
107 const std::string prefix = get_orb_widget_prefix(base_id);
108 grid& selection = find_widget<grid>(prefix +
"selection");
112 const std::string&
id =
button->
id();
124 const std::string prefix = get_orb_widget_prefix(base_id);
125 toggle_button& toggle = find_widget<toggle_button>(prefix +
"two_color");
133 const std::string prefix = get_orb_widget_prefix(base_id);
135 toggle_button& toggle = find_widget<toggle_button>(prefix +
"show");
142 groups_[base_id].set_member_states(initial);
149 const std::string prefix = get_orb_widget_prefix(base_id);
151 toggle_button& toggle = find_widget<toggle_button>(prefix +
"two_color");
Abstract base class for all modal dialogs.
void setup_orb_toggle(const std::string &base_id, bool &shown)
The display function.
void reset_orb_group(const std::string &base_id, bool shown, const std::string &initial)
virtual void post_show() override
Actions to be taken after the window has been shown.
virtual void pre_show() override
Actions to be taken before showing the window.
void setup_orb_group(const std::string &base_id, bool &shown, const std::string &initial)
Sets up the checkbox and row of color buttons for the one-color options, including connecting the cal...
void setup_orb_group_two_color(const std::string &base_id, bool &shown, bool &two_color, const std::string &initial)
Sets up two checkboxes and a row of color buttons.
void toggle_orb_callback(bool &storage)
void reset_orb_group_two_color(const std::string &base_id, bool shown, bool two_color, const std::string &initial)
std::map< std::string, group< std::string > > groups_
void reset_orb_callback()
void reset_orb_toggle(const std::string &base_id, bool shown)
Change the UI's ticked/unticked state.
void add_member(selectable_item *w, const T &value)
Adds a widget/value pair to the group map.
void set_member_states(const T &value)
Sets the toggle values for all widgets besides the one associated with the specified value to false.
bool at_end() const
Has the iterator reached the end?
void set_value_bool(bool value, bool fire_event=false)
void set_allied_color(const std::string &color_id)
void set_enemy_color(const std::string &color_id)
void set_unmoved_color(const std::string &color_id)
void set_partial_color(const std::string &color_id)
void set_moved_color(const std::string &color_id)
Contains the base iterator class for the gui2 widgets.
#define REGISTER_DIALOG(window_id)
Wrapper for REGISTER_DIALOG2.
std::string partial_orb_color
std::string moved_orb_color
std::string unmoved_orb_color
std::string ally_orb_color
std::string enemy_orb_color
bool show_status_on_ally_orb
@ OK
Dialog was closed with the OK button.