17 #define GETTEXT_DOMAIN "wesnoth-lib"
72 void disable_widget_on_toggle(window& window, widget&
w,
const std::string&
id)
74 find_widget<W>(&window,
id,
false).set_active(
dynamic_cast<selectable_item&
>(
w).get_value_bool());
78 void disable_widget_on_toggle_inverted(window& window, widget&
w,
const std::string&
id)
80 find_widget<W>(&window,
id,
false).set_active(!
dynamic_cast<selectable_item&
>(
w).get_value_bool());
85 int index_in_pager_range(
const int first,
const stacked_widget& pager)
87 return std::clamp<int>(first, 0, pager.get_layer_count() - 1);
91 template<
bool(*fptr)(
bool)>
92 void sound_toggle_on_change(window& window,
const std::string& id_to_toggle, widget&
w)
94 std::invoke(fptr,
dynamic_cast<selectable_item&
>(
w).get_value_bool());
97 disable_widget_on_toggle<slider>(window,
w, id_to_toggle);
101 template<
void(*fptr)(
int)>
102 void volume_setter_on_change(widget&
w)
104 std::invoke(fptr,
dynamic_cast<integer_selector&
>(
w).get_value());
119 , last_selected_item_(0)
120 , accl_speeds_({0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2, 3, 4, 8, 16})
122 , visible_categories_()
125 initialize_callbacks();
134 for(
const point& res : resolutions_) {
138 const int div = std::gcd(res.x, res.y);
139 const int x_ratio = res.x / div;
140 const int y_ratio = res.y / div;
142 if(x_ratio <= 10 || y_ratio <= 10) {
143 option[
"details"] =
formatter() <<
"<span color='#777777'>(" << x_ratio <<
':' << y_ratio <<
")</span>";
146 options.push_back(std::move(option));
149 const unsigned current_res = std::distance(resolutions_.begin(), std::find(
160 std::size_t current_theme = 0;
161 for(std::size_t
i = 0;
i < themes_.size(); ++
i) {
162 options.emplace_back(
"label", themes_[
i].name,
"tooltip", themes_[
i].description);
176 std::string
image =
"friend.png";
177 std::string descriptor =
_(
"friend");
181 image =
"ignore.png";
182 descriptor =
_(
"ignored");
186 notes =
" <small>(" + entry.
get_notes() +
")</small>";
189 item[
"use_markup"] =
"true";
197 item[
"label"] =
"<small>" + descriptor +
"</small>";
198 data.emplace(
"friend_status",
item);
208 if(sel < 0 || sel >= num_friends) {
212 std::map<std::string, acquaintance>::const_iterator who =
get_acquaintances().begin();
213 std::advance(who, sel);
215 textbox.
set_value(who->second.get_nick() +
" " + who->second.get_notes());
226 find_widget<button>(
this,
"remove",
false).set_active(!list_empty);
228 find_widget<label>(
this,
"no_friends_notice",
false).set_visible(
234 std::string username = textbox.
text();
235 if(username.empty()) {
242 std::size_t pos = username.find_first_of(
' ');
243 if(pos != std::string::npos) {
244 reason = username.substr(pos + 1);
245 username = username.substr(0, pos);
257 listbox& list = find_widget<listbox>(
this,
"friends_list",
false);
266 list.
add_row(get_friends_list_row_data(*entry));
271 if(find_widget<label>(row_grid,
"friend_name",
false).get_label() == entry->get_nick()) {
273 list.
add_row(get_friends_list_row_data(*entry),
i);
280 update_friends_list_controls(list);
287 std::map<std::string, acquaintance>::const_iterator who =
get_acquaintances().begin();
288 std::advance(who, selected_row);
290 const std::string to_remove = !textbox.
text().empty() ? textbox.
text() : who->second.get_nick();
292 if(to_remove.empty()) {
304 listbox& list = find_widget<listbox>(
this,
"friends_list",
false);
307 update_friends_list_controls(list);
310 template<
bool(*toggle_getter)(),
bool(*toggle_setter)(
bool),
int(*vol_getter)(),
void(*vol_setter)(
int)>
313 const std::string toggle_widget_id =
"sound_toggle_" + id_suffix;
314 const std::string volume_widget_id =
"sound_volume_" + id_suffix;
321 register_bool(toggle_widget_id,
true, toggle_getter, std::bind(toggle_setter, std::placeholders::_1),
322 std::bind(sound_toggle_on_change<toggle_setter>, std::ref(*
this), volume_widget_id, std::placeholders::_1),
true);
327 register_integer(volume_widget_id,
true, vol_getter, vol_setter);
331 std::bind(volume_setter_on_change<vol_setter>, std::placeholders::_1));
337 slider& ps_slider = find_widget<slider>(
this,
"pixel_scale_slider",
false);
342 find_widget<toggle_button>(
this,
"auto_pixel_scale",
false);
350 disp->queue_rerender();
368 register_integer(
"scroll_speed",
true,
374 const auto accl_load = [
this]()->
int {
375 return std::distance(accl_speeds_.begin(), std::find(accl_speeds_.begin(), accl_speeds_.end(),
turbo_speed()));
378 const auto accl_save = [
this](
int i) {
382 register_integer(
"turbo_slider",
true,
383 accl_load, accl_save);
386 find_widget<slider>(
this,
"turbo_slider",
false).set_value_labels(
387 [
this](
int pos,
int )->
t_string {
return lexical_cast<std::string>(accl_speeds_[pos]); }
391 register_bool(
"skip_ai_moves",
true,
395 register_bool(
"disable_auto_moves",
true,
399 register_bool(
"show_turn_dialog",
true,
403 register_bool(
"whiteboard_on_start",
true,
407 register_bool(
"whiteboard_hide_allies",
true,
411 register_bool(
"interrupt_move_when_ally_sighted",
true,
415 register_bool(
"save_replays",
true,
419 register_bool(
"delete_saves",
true,
423 register_integer(
"max_saves_slider",
true,
428 std::bind(&gui2::dialogs::game_cache_options::display<>));
436 find_widget<toggle_button>(
this,
"fullscreen",
false);
445 menu_button& res_list = find_widget<menu_button>(
this,
"resolution_set",
false);
450 set_resolution_list(res_list);
458 register_integer(
"pixel_scale_slider",
true,
462 find_widget<slider>(
this,
"pixel_scale_slider",
false);
467 register_bool(
"auto_pixel_scale",
true,
469 [&](
widget&
w) { disable_widget_on_toggle_inverted<slider>(*
this,
w,
"pixel_scale_slider"); },
true);
472 find_widget<toggle_button>(
this,
"auto_pixel_scale",
false);
477 register_bool(
"show_floating_labels",
true,
481 register_bool(
"show_ellipses",
true,
485 register_bool(
"show_grid",
true,
490 [&](
widget&
w) { disable_widget_on_toggle<toggle_button>(*
this,
w,
"animate_water"); },
true);
493 register_bool(
"animate_water",
true,
497 register_bool(
"animate_units_standing",
true,
502 [&](
widget&
w) { disable_widget_on_toggle<slider>(*
this,
w,
"idle_anim_frequency"); });
504 register_integer(
"idle_anim_frequency",
true,
512 register_bool(
"fps_limiter",
true,
532 initialize_sound_option_group<sound_on, set_sound, sound_volume, set_sound_volume>(
"sfx");
535 initialize_sound_option_group<music_on, set_music, music_volume, set_music_volume>(
"music");
537 register_bool(
"sound_toggle_stop_music_in_background",
true,
541 initialize_sound_option_group<turn_bell, set_turn_bell, bell_volume, set_bell_volume>(
"bell");
544 initialize_sound_option_group<UI_sound_on, set_UI_sound, UI_volume, set_UI_volume>(
"uisfx");
551 register_integer(
"chat_lines",
true,
555 register_bool(
"chat_timestamps",
true,
559 register_bool(
"remember_password",
true,
563 register_bool(
"lobby_whisper_friends_only",
true,
567 lobby_joins_group.add_member(find_widget<toggle_button>(
this,
"lobby_joins_none",
false,
true), lobby_joins::show_none);
568 lobby_joins_group.add_member(find_widget<toggle_button>(
this,
"lobby_joins_friends",
false,
true), lobby_joins::show_friends);
569 lobby_joins_group.add_member(find_widget<toggle_button>(
this,
"lobby_joins_all",
false,
true), lobby_joins::show_all);
573 lobby_joins_group.set_callback_on_value_change([&](
widget&,
const lobby_joins val) {
578 listbox& friends_list = find_widget<listbox>(
this,
"friends_list",
false);
580 friends_list.
clear();
583 friends_list.
add_row(get_friends_list_row_data(entry.second));
586 update_friends_list_controls(friends_list);
588 text_box& textbox = find_widget<text_box>(
this,
"friend_name_box",
false);
591 find_widget<button>(
this,
"add_friend",
false), std::bind(
597 find_widget<button>(
this,
"add_ignored",
false), std::bind(
603 find_widget<button>(
this,
"remove",
false), std::bind(
606 std::ref(friends_list),
612 std::ref(friends_list),
617 find_widget<button>(
this,
"mp_alerts",
false),
618 std::bind(&gui2::dialogs::mp_alerts_options::display<>));
622 find_widget<button>(
this,
"mp_wesnothd",
false), std::bind(
630 listbox& advanced = find_widget<listbox>(
this,
"advanced_prefs",
false);
634 for(
const auto& option : adv_preferences_) {
635 const std::string& pref_name = option.field;
637 row_data[
"pref_name"][
"label"] = option.name;
640 grid& details_grid = find_widget<grid>(main_grid,
"prefs_setter_grid",
false);
644 toggle_button& toggle_box = find_widget<toggle_button>(main_grid,
"value_toggle",
false);
647 if(!option.description.empty()) {
648 find_widget<styled_widget>(main_grid,
"description",
false).set_label(option.description);
651 switch(option.type) {
656 toggle_box.
set_value(
get(pref_name, option.cfg[
"default"].to_bool()));
664 gui2::bind_status_label<toggle_button>(
665 main_grid,
"value_toggle", default_status_value_getter<toggle_button>,
"value");
671 auto setter_widget = build_single_widget_instance<slider>(
config {
"definition",
"minimal"});
672 setter_widget->set_id(
"setter");
674 setter_widget->set_value_range(option.cfg[
"min"].to_int(), option.cfg[
"max"].to_int());
675 setter_widget->set_step_size(option.cfg[
"step"].to_int(1));
677 details_grid.
swap_child(
"setter", std::move(setter_widget),
true);
679 slider& slide = find_widget<slider>(&details_grid,
"setter",
false);
681 slide.
set_value(lexical_cast_default<int>(
get(pref_name), option.cfg[
"default"].to_int()));
689 gui2::bind_status_label<slider>(main_grid,
"setter", default_status_value_getter<slider>,
"value");
695 std::vector<config> menu_data;
696 std::vector<std::string> option_ids;
700 menu_item[
"label"] = choice[
"name"];
701 if(choice.has_attribute(
"description")) {
702 menu_item[
"details"] = std::string(
"<span color='#777'>") + choice[
"description"] +
"</span>";
704 menu_data.push_back(menu_item);
705 option_ids.push_back(choice[
"id"]);
709 int selected = std::distance(option_ids.begin(), std::find(option_ids.begin(), option_ids.end(),
710 get(pref_name, option.cfg[
"default"].str())
714 if(selected < 0 || selected >=
static_cast<int>(option_ids.size())) {
718 auto setter_widget = build_single_widget_instance<menu_button>();
719 setter_widget->set_id(
"setter");
721 details_grid.
swap_child(
"setter", std::move(setter_widget),
true);
723 menu_button& menu = find_widget<menu_button>(&details_grid,
"setter",
false);
731 std::bind([=](
widget&
w) {
set(pref_name, option_ids[
dynamic_cast<menu_button&
>(
w).get_value()]); }, std::placeholders::_1));
733 gui2::bind_status_label<menu_button>(main_grid,
"setter", default_status_value_getter<menu_button>,
"value");
741 auto value_widget = build_single_widget_instance<image>();
742 value_widget->set_label(
"icons/arrows/arrows_blank_right_25.png~CROP(3,3,18,18)");
744 main_grid->
swap_child(
"value", std::move(value_widget),
true);
754 std::ref(advanced)));
756 on_advanced_prefs_list_select(advanced);
762 multimenu_button& hotkey_menu = find_widget<multimenu_button>(
this,
"hotkey_category_menu",
false);
768 text_box& filter = find_widget<text_box>(
this,
"filter",
false);
772 hotkey_list.register_translatable_sorting_option(0, [
this](
const int i) {
return visible_hotkeys_[
i]->description.str(); });
782 hotkey_list.set_active_sorting_option({0, sort_order::type::ascending},
true);
785 find_widget<button>(
this,
"btn_add_hotkey",
false), std::bind(
791 find_widget<button>(
this,
"btn_clear_hotkey",
false), std::bind(
797 find_widget<button>(
this,
"btn_reset_hotkeys",
false), std::bind(
806 t_string& row_icon = row_data[
"img_icon"][
"label"];
807 t_string& row_action = row_data[
"lbl_desc"][
"label"];
808 t_string& row_hotkey = row_data[
"lbl_hotkey"][
"label"];
810 t_string& row_is_g = row_data[
"lbl_is_game"][
"label"];
811 t_string& row_is_e = row_data[
"lbl_is_editor"][
"label"];
812 t_string& row_is_m = row_data[
"lbl_is_mainmenu"][
"label"];
817 visible_hotkeys_.clear();
818 visible_categories_.clear();
825 const std::string gh =
"<span color='#0f0'>" +
_(
"game_hotkeys^G") +
"</span>";
826 const std::string eh =
"<span color='#0f0'>" +
_(
"editor_hotkeys^E") +
"</span>";
827 const std::string mh =
"<span color='#0f0'>" +
_(
"mainmenu_hotkeys^M") +
"</span>";
830 if(hotkey_item.hidden) {
834 visible_hotkeys_.push_back(&hotkey_item);
835 visible_categories_.insert(hotkey_item.category);
838 row_icon =
"icons/action/" + hotkey_item.id +
"_25.png~CROP(3,3,18,18)";
843 row_action = hotkey_item.description;
857 std::vector<config> filter_ops;
862 find_widget<multimenu_button>(
this,
"hotkey_category_menu",
false).set_values(filter_ops);
884 if(newhk.get() ==
nullptr) {
889 if(!hk->is_disabled() && newhk->bindings_equal(hk)) {
894 if(oldhk && oldhk->get_command() == hotkey_item.
id) {
898 if(oldhk && oldhk->get_command() !=
"null") {
899 const std::string text =
VGETTEXT(
"“<b>$hotkey_sequence|</b>” is in use by “<b>$old_hotkey_action|</b>”.\nDo you wish to reassign it to “<b>$new_hotkey_action|</b>”?", {
900 {
"hotkey_sequence", oldhk->get_name()},
928 hotkey_list.set_active_sorting_option({0, sort_order::type::ascending},
true);
946 const multimenu_button& hotkey_menu = find_widget<const multimenu_button>(
this,
"hotkey_category_menu",
false);
947 const text_box& name_filter = find_widget<const text_box>(
this,
"filter",
false);
950 boost::dynamic_bitset<> res(visible_hotkeys_.size());
952 std::string text = name_filter.
get_value();
955 if(toggle_states.none()) {
956 toggle_states = ~toggle_states;
959 for(std::size_t
h = 0;
h < visible_hotkeys_.size(); ++
h) {
964 const std::string description = visible_hotkeys_[
h]->description.str();
976 unsigned cat_index = 0;
980 if(visible_hotkeys_[
h]->category == cat) {
987 if(cat_index < toggle_states.size() && found) {
988 res[
h] = toggle_states[cat_index];
994 find_widget<listbox>(
this,
"list_hotkeys",
false).set_row_shown(res);
1000 const auto& pref = adv_preferences_[selected_row];
1003 if(pref.field ==
"logging") {
1004 gui2::dialogs::log_settings::display();
1005 }
else if(pref.field ==
"orb_color") {
1006 gui2::dialogs::select_orb_colors::display();
1008 WRN_GUI_L <<
"Invalid or unimplemented custom advanced prefs option: " << pref.field;
1014 const bool has_description = !pref.description.empty();
1017 find_widget<widget>(list.
get_row_grid(selected_row),
"prefs_setter_grid",
false)
1021 if(last_selected_item_ != selected_row) {
1022 find_widget<widget>(list.
get_row_grid(last_selected_item_),
"prefs_setter_grid",
false)
1025 last_selected_item_ = selected_row;
1040 set_always_save_fields(
true);
1050 gui2::bind_status_label<slider>(&
window,
"max_saves_slider");
1051 gui2::bind_status_label<slider>(&
window,
"turbo_slider");
1052 gui2::bind_status_label<slider>(&
window,
"pixel_scale_slider");
1058 listbox& selector = find_widget<listbox>(&
window,
"selector",
false);
1069 "The preferences pager and its selector listbox do not have the same number of items.");
1071 const int main_index = index_in_pager_range(initial_index_.first, pager);
1077 listbox* tab_selector = find_widget<listbox>(
1083 if(tab_pager && tab_selector) {
1084 const int ii =
static_cast<int>(
i);
1085 const int tab_index = index_in_pager_range(initial_index_.second, *tab_pager);
1086 const int to_select = (ii == main_index ? tab_index : 0);
1089 initialize_tabs(*tab_selector);
1103 find_widget<stacked_widget>(
this, pager_id,
false).select_layer(page);
1109 const bool ison = find_widget<toggle_button>(
this,
"fullscreen",
false).get_value_bool();
1112 menu_button& res_list = find_widget<menu_button>(
this,
"resolution_set",
false);
1114 set_resolution_list(res_list);
1120 menu_button& res_list = find_widget<menu_button>(
this,
"resolution_set",
false);
1123 set_resolution_list(res_list);
1131 const auto selection =
theme_list.get_value();
1132 const auto&
theme = themes_.at(selection);
1144 const int selected_row =
1145 std::max(0, find_widget<listbox>(
this,
"selector",
false).get_selected_row());
1146 set_visible_page(
static_cast<unsigned int>(selected_row),
"pager");
1151 const int selected_row =
1152 std::max(0, find_widget<listbox>(
this,
"tab_selector",
false).get_selected_row());
1153 set_visible_page(
static_cast<unsigned int>(selected_row),
"tab_pager");
A config object defines a single node in a WML file, with access to child nodes.
child_itors child_range(config_key_type key)
Sort-of-Singleton that many classes, both GUI and non-GUI, use to access the game data.
void set_theme(const std::string &new_theme)
static display * get_singleton()
Returns the display object if a display object exists.
hotkey::hotkey_ptr get_new_binding() const
@ yes_no_buttons
Shows a yes and no button.
Abstract base class for all modal dialogs.
bool show(const unsigned auto_close_time=0)
Shows the window.
void set_visible_page(unsigned int page, const std::string &pager_id)
void set_theme_list(menu_button &theme_list)
void remove_hotkey_callback(listbox &hotkeys)
void initialize_tabs(listbox &selector)
virtual void post_show(window &) override
Actions to be taken after the window has been shown.
void set_resolution_list(menu_button &res_list)
void on_advanced_prefs_list_select(listbox &tree)
virtual void pre_show(window &window) override
Actions to be taken before showing the window.
void default_hotkey_callback()
void on_page_select()
Callback for selection changes.
void on_friends_list_select(listbox &list, text_box &textbox)
void hotkey_filter_callback()
void add_friend_list_entry(const bool is_friend, text_box &textbox)
void handle_theme_select()
widget_data get_friends_list_row_data(const preferences::acquaintance &entry)
void update_friends_list_controls(listbox &list)
void handle_res_select()
Special callback functions.
void fullscreen_toggle_callback()
listbox & setup_hotkey_list()
void remove_friend_list_entry(listbox &friends_list, text_box &textbox)
void initialize_sound_option_group(const std::string &id_suffix)
void add_hotkey_callback(listbox &hotkeys)
void initialize_callbacks()
Initializers.
Dialog for selecting a GUI theme.
std::unique_ptr< widget > swap_child(const std::string &id, std::unique_ptr< widget > w, const bool recurse, widget *new_parent=nullptr)
Exchanges a child in the grid.
grid & add_row(const widget_item &item, const int index=-1)
When an item in the list is selected by the user we need to update the state.
const grid * get_row_grid(const unsigned row) const
Returns the grid of the wanted row.
bool select_row(const unsigned row, const bool select=true)
Selects a row.
void remove_row(const unsigned row, unsigned count=1)
Removes a row in the listbox.
void clear()
Removes all the rows in the listbox, clearing it.
int get_selected_row() const
Returns the first selected row.
unsigned get_item_count() const
Returns the number of items in the listbox.
bool get_value_bool() const
A slider is a control that can select a value by moving a grip on a groove.
virtual void set_value(int value) override
Inherited from integer_selector.
virtual int get_value() const override
Inherited from integer_selector.
std::string get_value() const
const std::string & text() const
virtual void set_value(const std::string &text)
The set_value is virtual for the password_box class.
void set_text_changed_callback(std::function< void(text_box_base *textbox, const std::string text)> cb)
Set the text_changed callback.
Class for a single line text area.
base class of top level items, the only item which needs to store the final canvases to draw on.
void keyboard_capture(widget *widget)
const std::string & get_status() const
const std::string & get_nick() const
const std::string & get_notes() const
static std::vector< theme_info > get_basic_theme_info(bool include_hidden=false)
Returns minimal info about saved themes, optionally including hidden ones.
Declarations for File-IO.
static std::string _(const char *str)
New lexcical_cast header.
void set(CURSOR_TYPE type)
Use the default parameter to reset cursors.
void raise_resize_event()
static bool file_exists(const bfs::path &fpath)
const std::string unicode_multiplication_sign
REGISTER_DIALOG(editor_edit_unit)
void connect_signal_mouse_left_release(dispatcher &dispatcher, const signal &signal)
Connects a signal handler for a left mouse button release.
void connect_signal_notify_modified(dispatcher &dispatcher, const signal_notification &signal)
Connects a signal handler for getting a notification upon modification.
void connect_signal_mouse_left_click(dispatcher &dispatcher, const signal &signal)
Connects a signal handler for a left mouse button click.
std::map< std::string, widget_item > widget_data
void show_transient_error_message(const std::string &message, const std::string &image, const bool message_use_markup)
Shows a transient error message to the user.
std::map< std::string, t_string > widget_item
void show_transient_message(const std::string &title, const std::string &message, const std::string &image, const bool message_use_markup, const bool title_use_markup)
Shows a transient message to the user.
void show_message(const std::string &title, const std::string &msg, const std::string &button_caption, const bool auto_close, const bool message_use_markup, const bool title_use_markup)
Shows a message to the user.
@ OK
Dialog was closed with the OK button.
std::pair< std::string, unsigned > item
const hotkey_list & get_hotkeys()
Returns the list of hotkeys.
std::string get_names(const std::string &id)
Returns a comma-separated string of hotkey names.
void save_hotkeys(config &cfg)
Save the non-default hotkeys to the config.
std::shared_ptr< class hotkey_base > hotkey_ptr
void clear_hotkeys(const std::string &command)
Unset the command bindings for all hotkeys matching the command.
const std::map< std::string_view, hotkey::hotkey_command > & get_hotkey_commands()
returns a container that contains all currently active hotkey_commands.
std::vector< hotkey::hotkey_ptr > hotkey_list
void add_hotkey(hotkey_ptr item)
Add a hotkey to the list of hotkeys.
t_string get_translatable_category_name(HOTKEY_CATEGORY category)
Gets the display name for a given hotkey category.
const hotkey_command & get_hotkey_command(const std::string &command)
returns the hotkey_command with the given name
Functions to load and save images from/to disk.
Modify, read and display user preferences.
void set_show_side_colors(bool value)
void set_scroll_speed(const int new_speed)
void set_skip_ai_moves(bool value)
bool stop_music_in_background()
bool show_floating_labels()
void set_turbo(bool ison)
lobby_joins get_lobby_joins()
void set_idle_anim(const bool ison)
void set_remember_password(bool remember)
void _set_lobby_joins(lobby_joins show)
void set_hide_whiteboard(bool value)
void set_turbo_speed(const double speed)
void set_draw_delay(int value)
bool interrupt_when_ally_sighted()
bool whisper_friends_only()
void set_idle_anim_rate(const int rate)
static std::map< PREFERENCE_VIEW, std::pair< int, int > > pef_view_map
Map containing page mappings that can be used to set the initially displayed page of the dialog.
void set_stop_music_in_background(bool ison)
void set_animate_water(bool value)
void set_vsync(bool ison)
bool show_standing_animations()
void set_chat_lines(int lines)
void set_pixel_scale(const int scale)
void set_delete_saves(bool value)
void set_interrupt_when_ally_sighted(bool value)
void set_chat_timestamping(bool value)
void set_disable_auto_moves(bool value)
bool disable_auto_moves()
void set_auto_pixel_scale(bool choice)
void set_turn_dialog(bool ison)
void set_theme(const std::string &theme)
bool remove_acquaintance(const std::string &nick)
void set_show_floating_labels(bool value)
std::pair< preferences::acquaintance *, bool > add_acquaintance(const std::string &nick, const std::string &mode, const std::string ¬es)
void set_save_replays(bool value)
void set_autosavemax(int value)
void set_show_standing_animations(bool value)
void set_animate_map(bool value)
bool enable_whiteboard_mode_on_start()
void set_enable_whiteboard_mode_on_start(bool value)
void set_whisper_friends_only(bool v)
const advanced_pref_list & get_advanced_preferences()
Gets a list of the available advanced preferences.
const std::map< std::string, acquaintance > & get_acquaintances()
bool is_friend(const std::string &nick)
void show_wesnothd_server_search()
bool ci_search(const std::string &s1, const std::string &s2)
std::vector< std::string > split(const config_attribute_value &val)
std::vector< point > get_available_resolutions(const bool include_current)
Returns the list of available screen resolutions.
point current_resolution()
The current window size in desktop coordinates.
void set_fullscreen(bool fullscreen)
Set the fullscreen state.
bool set_resolution(const point &resolution)
Set the window resolution.
void toggle_fullscreen()
Toggle fullscreen mode.
void update_buffers(bool autoupdate)
Update buffers to match current resolution and pixel scale settings.
Stores all information related to functions that can be bound to hotkeys.
std::string id
The unique ID.
Definitions related to theme-support.
#define VALIDATE(cond, message)
The macro to use for the validation of WML.