17 #define GETTEXT_DOMAIN "wesnoth-lib"
74 void disable_widget_on_toggle(window& window, widget&
w,
const std::string&
id)
76 find_widget<W>(&window,
id,
false).set_active(
dynamic_cast<selectable_item&
>(
w).get_value_bool());
80 void disable_widget_on_toggle_inverted(window& window, widget&
w,
const std::string&
id)
82 find_widget<W>(&window,
id,
false).set_active(!
dynamic_cast<selectable_item&
>(
w).get_value_bool());
87 int index_in_pager_range(
const int first,
const stacked_widget& pager)
89 return std::clamp<int>(first, 0, pager.get_layer_count() - 1);
93 template<
bool(*fptr)(
bool)>
94 void sound_toggle_on_change(window& window,
const std::string& id_to_toggle, widget&
w)
96 std::invoke(fptr,
dynamic_cast<selectable_item&
>(
w).get_value_bool());
99 disable_widget_on_toggle<slider>(window,
w, id_to_toggle);
103 template<
void(*fptr)(
int)>
104 void volume_setter_on_change(widget&
w)
106 std::invoke(fptr,
dynamic_cast<integer_selector&
>(
w).get_value());
121 , last_selected_item_(0)
122 , accl_speeds_({0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2, 3, 4, 8, 16})
124 , visible_categories_()
127 initialize_callbacks();
136 for(
const point& res : resolutions_) {
140 const int div = std::gcd(res.x, res.y);
141 const int x_ratio = res.x / div;
142 const int y_ratio = res.y / div;
144 if(x_ratio <= 10 || y_ratio <= 10) {
145 option[
"details"] =
formatter() <<
"<span color='#777777'>(" << x_ratio <<
':' << y_ratio <<
")</span>";
148 options.push_back(std::move(option));
151 const unsigned current_res = std::distance(resolutions_.begin(), std::find(
162 for(
const auto&
theme : themes_) {
166 const unsigned current_theme = std::distance(themes_.begin(),
167 std::find_if(themes_.begin(), themes_.end(), [](
const auto&
theme) {
168 return theme.id == preferences::theme();
179 std::string
image =
"friend.png";
180 std::string descriptor =
_(
"friend");
184 image =
"ignore.png";
185 descriptor =
_(
"ignored");
189 notes =
" <small>(" + entry.
get_notes() +
")</small>";
192 item[
"use_markup"] =
"true";
200 item[
"label"] =
"<small>" + descriptor +
"</small>";
201 data.emplace(
"friend_status",
item);
211 if(sel < 0 || sel >= num_friends) {
215 std::map<std::string, acquaintance>::const_iterator who =
get_acquaintances().begin();
216 std::advance(who, sel);
218 textbox.
set_value(who->second.get_nick() +
" " + who->second.get_notes());
229 find_widget<button>(
this,
"remove",
false).set_active(!list_empty);
231 find_widget<label>(
this,
"no_friends_notice",
false).set_visible(
237 std::string username = textbox.
text();
238 if(username.empty()) {
245 std::size_t pos = username.find_first_of(
' ');
246 if(pos != std::string::npos) {
247 reason = username.substr(pos + 1);
248 username = username.substr(0, pos);
260 listbox& list = find_widget<listbox>(
this,
"friends_list",
false);
269 list.
add_row(get_friends_list_row_data(*entry));
274 if(find_widget<label>(row_grid,
"friend_name",
false).get_label() == entry->get_nick()) {
276 list.
add_row(get_friends_list_row_data(*entry),
i);
283 update_friends_list_controls(list);
290 std::map<std::string, acquaintance>::const_iterator who =
get_acquaintances().begin();
291 std::advance(who, selected_row);
293 const std::string to_remove = !textbox.
text().empty() ? textbox.
text() : who->second.get_nick();
295 if(to_remove.empty()) {
307 listbox& list = find_widget<listbox>(
this,
"friends_list",
false);
310 update_friends_list_controls(list);
313 template<
bool(*toggle_getter)(),
bool(*toggle_setter)(
bool),
int(*vol_getter)(),
void(*vol_setter)(
int)>
316 const std::string toggle_widget_id =
"sound_toggle_" + id_suffix;
317 const std::string volume_widget_id =
"sound_volume_" + id_suffix;
324 register_bool(toggle_widget_id,
true, toggle_getter, std::bind(toggle_setter, std::placeholders::_1),
325 std::bind(sound_toggle_on_change<toggle_setter>, std::ref(*
this), volume_widget_id, std::placeholders::_1),
true);
330 register_integer(volume_widget_id,
true, vol_getter, vol_setter);
334 std::bind(volume_setter_on_change<vol_setter>, std::placeholders::_1));
340 slider& ps_slider = find_widget<slider>(
this,
"pixel_scale_slider",
false);
345 find_widget<toggle_button>(
this,
"auto_pixel_scale",
false);
353 disp->queue_rerender();
371 register_integer(
"scroll_speed",
true,
377 const auto accl_load = [
this]()->
int {
378 return std::distance(accl_speeds_.begin(), std::find(accl_speeds_.begin(), accl_speeds_.end(),
turbo_speed()));
381 const auto accl_save = [
this](
int i) {
385 register_integer(
"turbo_slider",
true,
386 accl_load, accl_save);
389 find_widget<slider>(
this,
"turbo_slider",
false).set_value_labels(
390 [
this](
int pos,
int )->
t_string {
return lexical_cast<std::string>(accl_speeds_[pos]); }
394 register_bool(
"skip_ai_moves",
true,
398 register_bool(
"disable_auto_moves",
true,
402 register_bool(
"show_turn_dialog",
true,
406 register_bool(
"whiteboard_on_start",
true,
410 register_bool(
"whiteboard_hide_allies",
true,
414 register_bool(
"interrupt_move_when_ally_sighted",
true,
418 register_bool(
"save_replays",
true,
422 register_bool(
"delete_saves",
true,
426 register_integer(
"max_saves_slider",
true,
431 std::bind(&gui2::dialogs::game_cache_options::display<>));
439 find_widget<toggle_button>(
this,
"fullscreen",
false);
448 menu_button& res_list = find_widget<menu_button>(
this,
"resolution_set",
false);
453 set_resolution_list(res_list);
461 register_integer(
"pixel_scale_slider",
true,
465 find_widget<slider>(
this,
"pixel_scale_slider",
false);
470 register_bool(
"auto_pixel_scale",
true,
472 [&](
widget&
w) { disable_widget_on_toggle_inverted<slider>(*
this,
w,
"pixel_scale_slider"); },
true);
475 find_widget<toggle_button>(
this,
"auto_pixel_scale",
false);
480 register_bool(
"show_floating_labels",
true,
484 register_bool(
"show_ellipses",
true,
488 register_bool(
"show_grid",
true,
493 [&](
widget&
w) { disable_widget_on_toggle<toggle_button>(*
this,
w,
"animate_water"); },
true);
496 register_bool(
"animate_water",
true,
500 register_bool(
"animate_units_standing",
true,
505 [&](
widget&
w) { disable_widget_on_toggle<slider>(*
this,
w,
"idle_anim_frequency"); });
507 register_integer(
"idle_anim_frequency",
true,
515 register_bool(
"fps_limiter",
true,
535 initialize_sound_option_group<sound_on, set_sound, sound_volume, set_sound_volume>(
"sfx");
538 initialize_sound_option_group<music_on, set_music, music_volume, set_music_volume>(
"music");
540 register_bool(
"sound_toggle_stop_music_in_background",
true,
544 initialize_sound_option_group<turn_bell, set_turn_bell, bell_volume, set_bell_volume>(
"bell");
547 initialize_sound_option_group<UI_sound_on, set_UI_sound, UI_volume, set_UI_volume>(
"uisfx");
554 register_integer(
"chat_lines",
true,
558 register_bool(
"chat_timestamps",
true,
562 register_bool(
"remember_password",
true,
566 register_bool(
"lobby_whisper_friends_only",
true,
570 lobby_joins_group.add_member(find_widget<toggle_button>(
this,
"lobby_joins_none",
false,
true), lobby_joins::show_none);
571 lobby_joins_group.add_member(find_widget<toggle_button>(
this,
"lobby_joins_friends",
false,
true), lobby_joins::show_friends);
572 lobby_joins_group.add_member(find_widget<toggle_button>(
this,
"lobby_joins_all",
false,
true), lobby_joins::show_all);
576 lobby_joins_group.set_callback_on_value_change([&](
widget&,
const lobby_joins val) {
581 listbox& friends_list = find_widget<listbox>(
this,
"friends_list",
false);
583 friends_list.
clear();
586 friends_list.
add_row(get_friends_list_row_data(entry.second));
589 update_friends_list_controls(friends_list);
591 text_box& textbox = find_widget<text_box>(
this,
"friend_name_box",
false);
594 find_widget<button>(
this,
"add_friend",
false), std::bind(
600 find_widget<button>(
this,
"add_ignored",
false), std::bind(
606 find_widget<button>(
this,
"remove",
false), std::bind(
609 std::ref(friends_list),
615 std::ref(friends_list),
620 find_widget<button>(
this,
"mp_alerts",
false),
621 std::bind(&gui2::dialogs::mp_alerts_options::display<>));
625 find_widget<button>(
this,
"mp_wesnothd",
false), std::bind(
633 listbox& advanced = find_widget<listbox>(
this,
"advanced_prefs",
false);
637 for(
const auto& option : adv_preferences_) {
638 const std::string& pref_name = option.field;
640 row_data[
"pref_name"][
"label"] = option.name;
643 grid& details_grid = find_widget<grid>(main_grid,
"prefs_setter_grid",
false);
647 toggle_button& toggle_box = find_widget<toggle_button>(main_grid,
"value_toggle",
false);
650 if(!option.description.empty()) {
651 find_widget<styled_widget>(main_grid,
"description",
false).set_label(option.description);
654 switch(option.type) {
659 toggle_box.
set_value(
get(pref_name, option.cfg[
"default"].to_bool()));
667 gui2::bind_status_label<toggle_button>(
668 main_grid,
"value_toggle", default_status_value_getter<toggle_button>,
"value");
674 auto setter_widget = build_single_widget_instance<slider>(
config {
"definition",
"minimal"});
675 setter_widget->set_id(
"setter");
677 setter_widget->set_value_range(option.cfg[
"min"].to_int(), option.cfg[
"max"].to_int());
678 setter_widget->set_step_size(option.cfg[
"step"].to_int(1));
680 details_grid.
swap_child(
"setter", std::move(setter_widget),
true);
682 slider& slide = find_widget<slider>(&details_grid,
"setter",
false);
684 slide.
set_value(lexical_cast_default<int>(
get(pref_name), option.cfg[
"default"].to_int()));
692 gui2::bind_status_label<slider>(main_grid,
"setter", default_status_value_getter<slider>,
"value");
698 std::vector<config> menu_data;
699 std::vector<std::string> option_ids;
703 menu_item[
"label"] = choice[
"name"];
704 if(choice.has_attribute(
"description")) {
705 menu_item[
"details"] = std::string(
"<span color='#777'>") + choice[
"description"] +
"</span>";
707 menu_data.push_back(menu_item);
708 option_ids.push_back(choice[
"id"]);
712 int selected = std::distance(option_ids.begin(), std::find(option_ids.begin(), option_ids.end(),
713 get(pref_name, option.cfg[
"default"].str())
717 if(selected < 0 || selected >=
static_cast<int>(option_ids.size())) {
721 auto setter_widget = build_single_widget_instance<menu_button>();
722 setter_widget->set_id(
"setter");
724 details_grid.
swap_child(
"setter", std::move(setter_widget),
true);
726 menu_button& menu = find_widget<menu_button>(&details_grid,
"setter",
false);
734 std::bind([=](
widget&
w) {
set(pref_name, option_ids[
dynamic_cast<menu_button&
>(
w).get_value()]); }, std::placeholders::_1));
736 gui2::bind_status_label<menu_button>(main_grid,
"setter", default_status_value_getter<menu_button>,
"value");
744 auto value_widget = build_single_widget_instance<image>();
745 value_widget->set_label(
"icons/arrows/arrows_blank_right_25.png~CROP(3,3,18,18)");
747 main_grid->
swap_child(
"value", std::move(value_widget),
true);
757 std::ref(advanced)));
759 on_advanced_prefs_list_select(advanced);
765 multimenu_button& hotkey_menu = find_widget<multimenu_button>(
this,
"hotkey_category_menu",
false);
771 text_box& filter = find_widget<text_box>(
this,
"filter",
false);
775 hotkey_list.register_translatable_sorting_option(0, [
this](
const int i) {
return visible_hotkeys_[
i]->description.str(); });
785 hotkey_list.set_active_sorting_option({0, sort_order::type::ascending},
true);
788 find_widget<button>(
this,
"btn_add_hotkey",
false), std::bind(
794 find_widget<button>(
this,
"btn_clear_hotkey",
false), std::bind(
800 find_widget<button>(
this,
"btn_reset_hotkeys",
false), std::bind(
809 t_string& row_icon = row_data[
"img_icon"][
"label"];
810 t_string& row_action = row_data[
"lbl_desc"][
"label"];
811 t_string& row_hotkey = row_data[
"lbl_hotkey"][
"label"];
813 t_string& row_is_g = row_data[
"lbl_is_game"][
"label"];
814 t_string& row_is_e = row_data[
"lbl_is_editor"][
"label"];
815 t_string& row_is_m = row_data[
"lbl_is_mainmenu"][
"label"];
820 visible_hotkeys_.clear();
821 visible_categories_.clear();
828 const std::string gh =
"<span color='#0f0'>" +
_(
"game_hotkeys^G") +
"</span>";
829 const std::string eh =
"<span color='#0f0'>" +
_(
"editor_hotkeys^E") +
"</span>";
830 const std::string mh =
"<span color='#0f0'>" +
_(
"mainmenu_hotkeys^M") +
"</span>";
833 if(hotkey_item.hidden) {
837 visible_hotkeys_.push_back(&hotkey_item);
838 visible_categories_.insert(hotkey_item.category);
841 row_icon =
"icons/action/" + hotkey_item.id +
"_25.png~CROP(3,3,18,18)";
846 row_action = hotkey_item.description;
860 std::vector<config> filter_ops;
865 find_widget<multimenu_button>(
this,
"hotkey_category_menu",
false).set_values(filter_ops);
887 if(newhk.get() ==
nullptr) {
892 if(!hk->is_disabled() && newhk->bindings_equal(hk)) {
897 if(oldhk && oldhk->get_command() == hotkey_item.
id) {
901 if(oldhk && oldhk->get_command() !=
"null") {
902 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>”?", {
903 {
"hotkey_sequence", oldhk->get_name()},
931 hotkey_list.set_active_sorting_option({0, sort_order::type::ascending},
true);
949 const multimenu_button& hotkey_menu = find_widget<const multimenu_button>(
this,
"hotkey_category_menu",
false);
950 const text_box& name_filter = find_widget<const text_box>(
this,
"filter",
false);
953 boost::dynamic_bitset<> res(visible_hotkeys_.size());
955 std::string text = name_filter.
get_value();
958 if(toggle_states.none()) {
959 toggle_states = ~toggle_states;
962 for(std::size_t
h = 0;
h < visible_hotkeys_.size(); ++
h) {
967 const std::string description = visible_hotkeys_[
h]->description.str();
979 unsigned cat_index = 0;
983 if(visible_hotkeys_[
h]->category == cat) {
990 if(cat_index < toggle_states.size() && found) {
991 res[
h] = toggle_states[cat_index];
997 find_widget<listbox>(
this,
"list_hotkeys",
false).set_row_shown(res);
1003 const auto& pref = adv_preferences_[selected_row];
1006 if(pref.field ==
"logging") {
1007 gui2::dialogs::log_settings::display();
1008 }
else if(pref.field ==
"orb_color") {
1009 gui2::dialogs::select_orb_colors::display();
1011 WRN_GUI_L <<
"Invalid or unimplemented custom advanced prefs option: " << pref.field;
1017 const bool has_description = !pref.description.empty();
1020 find_widget<widget>(list.
get_row_grid(selected_row),
"prefs_setter_grid",
false)
1024 if(last_selected_item_ != selected_row) {
1025 find_widget<widget>(list.
get_row_grid(last_selected_item_),
"prefs_setter_grid",
false)
1028 last_selected_item_ = selected_row;
1043 set_always_save_fields(
true);
1053 gui2::bind_status_label<slider>(&
window,
"max_saves_slider");
1054 gui2::bind_status_label<slider>(&
window,
"turbo_slider");
1055 gui2::bind_status_label<slider>(&
window,
"pixel_scale_slider");
1061 listbox& selector = find_widget<listbox>(&
window,
"selector",
false);
1072 "The preferences pager and its selector listbox do not have the same number of items.");
1074 const int main_index = index_in_pager_range(initial_index_.first, pager);
1080 listbox* tab_selector = find_widget<listbox>(
1086 if(tab_pager && tab_selector) {
1087 const int ii =
static_cast<int>(
i);
1088 const int tab_index = index_in_pager_range(initial_index_.second, *tab_pager);
1089 const int to_select = (ii == main_index ? tab_index : 0);
1092 initialize_tabs(*tab_selector);
1106 find_widget<stacked_widget>(
this, pager_id,
false).select_layer(page);
1112 const bool ison = find_widget<toggle_button>(
this,
"fullscreen",
false).get_value_bool();
1115 menu_button& res_list = find_widget<menu_button>(
this,
"resolution_set",
false);
1117 set_resolution_list(res_list);
1123 menu_button& res_list = find_widget<menu_button>(
this,
"resolution_set",
false);
1126 set_resolution_list(res_list);
1134 const auto selection =
theme_list.get_value();
1135 const auto&
theme = themes_.at(selection);
1147 const int selected_row =
1148 std::max(0, find_widget<listbox>(
this,
"selector",
false).get_selected_row());
1149 set_visible_page(
static_cast<unsigned int>(selected_row),
"pager");
1154 const int selected_row =
1155 std::max(0, find_widget<listbox>(
this,
"tab_selector",
false).get_selected_row());
1156 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.
#define REGISTER_DIALOG(window_id)
Wrapper for REGISTER_DIALOG2.
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
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.
This file contains the settings handling of the widget library.
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.