17 #define GETTEXT_DOMAIN "wesnoth-lib"
69 void disable_widget_on_toggle(window& window, widget&
w,
const std::string&
id)
71 find_widget<W>(&window,
id,
false).set_active(
dynamic_cast<selectable_item&
>(
w).get_value_bool());
75 void disable_widget_on_toggle_inverted(window& window, widget&
w,
const std::string&
id)
77 find_widget<W>(&window,
id,
false).set_active(!
dynamic_cast<selectable_item&
>(
w).get_value_bool());
82 int index_in_pager_range(
const int first,
const stacked_widget& pager)
84 return std::clamp<int>(first, 0, pager.get_layer_count() - 1);
88 template<
bool(*fptr)(
bool)>
89 void sound_toggle_on_change(window& window,
const std::string& id_to_toggle, widget&
w)
91 std::invoke(fptr,
dynamic_cast<selectable_item&
>(
w).get_value_bool());
94 disable_widget_on_toggle<slider>(window,
w, id_to_toggle);
98 template<
void(*fptr)(
int)>
99 void volume_setter_on_change(widget&
w)
101 std::invoke(fptr,
dynamic_cast<integer_selector&
>(
w).get_value());
113 , last_selected_item_(0)
114 , current_gui_theme_(0)
115 , accl_speeds_({0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2, 3, 4, 8, 16})
117 , visible_categories_()
118 , initial_index_(pef_view_map[initial_view])
120 initialize_callbacks();
128 std::vector<config> options;
133 const int div = std::gcd(res.x, res.y);
134 const int x_ratio = res.x / div;
135 const int y_ratio = res.y / div;
137 if(x_ratio <= 10 || y_ratio <= 10) {
138 option[
"details"] =
formatter() <<
"<span color='#777777'>(" << x_ratio <<
':' << y_ratio <<
")</span>";
141 options.push_back(std::move(option));
144 const unsigned current_res = std::distance(
resolutions_.begin(), std::find(
154 std::vector<config> options;
155 std::size_t current_theme = 0;
156 for(std::size_t
i = 0;
i <
themes_.size(); ++
i) {
157 options.emplace_back(
"label",
themes_[
i].name,
"tooltip",
themes_[
i].description);
163 theme_list.set_values(options, current_theme);
168 std::string current_gui_theme_name =
prefs::get().gui2_theme();
170 std::vector<config> options;
171 bool theme_found =
false;
175 options.emplace_back(
"label",
gui.second.description());
176 if (current_gui_theme_name ==
gui.first) {
194 std::string
image =
"friend.png";
195 std::string descriptor =
_(
"friend");
199 image =
"ignore.png";
200 descriptor =
_(
"ignored");
204 notes =
" <small>(" + entry.
get_notes() +
")</small>";
207 item[
"use_markup"] =
"true";
215 item[
"label"] =
"<small>" + descriptor +
"</small>";
216 data.emplace(
"friend_status",
item);
226 if(sel < 0 || sel >= num_friends) {
231 std::advance(who, sel);
233 textbox.
set_value(who->second.get_nick() +
" " + who->second.get_notes());
244 find_widget<button>(
this,
"remove",
false).set_active(!list_empty);
246 find_widget<label>(
this,
"no_friends_notice",
false).set_visible(
252 std::string username = textbox.
text();
253 if(username.empty()) {
260 std::size_t pos = username.find_first_of(
' ');
261 if(pos != std::string::npos) {
262 reason = username.substr(pos + 1);
263 username = username.substr(0, pos);
275 listbox& list = find_widget<listbox>(
this,
"friends_list",
false);
289 if(find_widget<label>(row_grid,
"friend_name",
false).
get_label() == entry->get_nick()) {
306 std::advance(who, selected_row);
308 const std::string to_remove = !textbox.
text().empty() ? textbox.
text() : who->second.get_nick();
310 if(to_remove.empty()) {
315 if(!
prefs::get().remove_acquaintance(to_remove)) {
322 listbox& list = find_widget<listbox>(
this,
"friends_list",
false);
331 slider& ps_slider = find_widget<slider>(
this,
"pixel_scale_slider",
false);
336 find_widget<toggle_button>(
this,
"auto_pixel_scale",
false);
344 disp->queue_rerender();
351 template<
bool(*toggle_getter)(),
bool(*toggle_setter)(
bool),
int(*vol_getter)(),
void(*vol_setter)(
int)>
354 const std::string toggle_widget_id =
"sound_toggle_" + id_suffix;
355 const std::string volume_widget_id =
"sound_volume_" + id_suffix;
362 register_bool(toggle_widget_id,
true, toggle_getter, std::bind(toggle_setter, std::placeholders::_1),
363 std::bind(sound_toggle_on_change<toggle_setter>, std::ref(*
this), volume_widget_id, std::placeholders::_1),
true);
372 std::bind(volume_setter_on_change<vol_setter>, std::placeholders::_1));
418 const auto accl_load = [
this]()->
int {
422 const auto accl_save = [
this](
int i) {
427 accl_load, accl_save);
430 find_widget<slider>(
this,
"turbo_slider",
false).set_value_labels(
437 [](
bool v) {
prefs::get().set_skip_ai_moves(v);});
441 []() {
return prefs::get().disable_auto_moves();},
442 [](
bool v) {
prefs::get().set_disable_auto_moves(v);});
447 [](
bool v) {
prefs::get().set_turn_dialog(v);});
451 []() {
return prefs::get().enable_planning_mode_on_start();},
452 [](
bool v) {
prefs::get().set_enable_planning_mode_on_start(v);});
456 []() {
return prefs::get().hide_whiteboard();},
457 [](
bool v) {
prefs::get().set_hide_whiteboard(v);});
461 []() {
return prefs::get().ally_sighted_interrupts();},
462 [](
bool v) {
prefs::get().set_ally_sighted_interrupts(v);});
467 [](
bool v) {
prefs::get().set_save_replays(v);});
472 [](
bool v) {
prefs::get().set_delete_saves(v);});
477 [](
int v) {
prefs::get().set_auto_save_max(v);});
481 std::bind(&gui2::dialogs::game_cache_options::display<>));
489 find_widget<toggle_button>(
this,
"fullscreen",
false);
498 menu_button& res_list = find_widget<menu_button>(
this,
"resolution_set",
false);
516 find_widget<slider>(
this,
"pixel_scale_slider",
false);
522 []() {
return prefs::get().auto_pixel_scale();},
523 [](
bool v) {
prefs::get().set_auto_pixel_scale(v);},
524 [&](
widget&
w) { disable_widget_on_toggle_inverted<slider>(*
this,
w,
"pixel_scale_slider"); },
true);
527 find_widget<toggle_button>(
this,
"auto_pixel_scale",
false);
533 []() {
return prefs::get().floating_labels();},
534 [](
bool v) {
prefs::get().set_floating_labels(v);});
538 []() {
return prefs::get().show_side_colors();},
539 [](
bool v) {
prefs::get().set_show_side_colors(v);});
549 [](
bool v) {
prefs::get().set_animate_map(v);},
550 [&](
widget&
w) { disable_widget_on_toggle<toggle_button>(*
this,
w,
"animate_water"); },
true);
555 [](
bool v) {
prefs::get().set_animate_water(v);});
566 [&](
widget&
w) { disable_widget_on_toggle<slider>(*
this,
w,
"idle_anim_frequency"); },
true);
570 [](
int v) {
prefs::get().set_idle_anim_rate(v);});
578 []() {
return prefs::get().draw_delay() != 0; }, [](
bool v) {
prefs::get().set_draw_delay(v ? -1 : 0); });
592 menu_button& gui2_theme_list = find_widget<menu_button>(
this,
"choose_gui2_theme",
false);
602 initialize_sound_option_group<sound, set_sound, sound_volume, set_sound_volume>(
"sfx");
605 initialize_sound_option_group<music_on, set_music, music_volume, set_music_volume>(
"music");
608 []() {
return prefs::get().stop_music_in_background();},
609 [](
bool v) {
prefs::get().set_stop_music_in_background(v);});
612 initialize_sound_option_group<turn_bell, set_turn_bell, bell_volume, set_bell_volume>(
"bell");
615 initialize_sound_option_group<ui_sound_on, set_ui_sound, ui_volume, set_ui_volume>(
"uisfx");
629 [](
bool v) {
prefs::get().set_chat_timestamp(v);});
638 []() {
return prefs::get().lobby_whisper_friends_only();},
639 [](
bool v) {
prefs::get().set_lobby_whisper_friends_only(v);});
653 listbox& friends_list = find_widget<listbox>(
this,
"friends_list",
false);
655 friends_list.
clear();
657 for(
const auto& entry :
prefs::get().get_acquaintances()) {
663 text_box& textbox = find_widget<text_box>(
this,
"friend_name_box",
false);
666 find_widget<button>(
this,
"add_friend",
false), std::bind(
672 find_widget<button>(
this,
"add_ignored",
false), std::bind(
678 find_widget<button>(
this,
"remove",
false), std::bind(
681 std::ref(friends_list),
687 std::ref(friends_list),
692 find_widget<button>(
this,
"mp_alerts",
false),
693 std::bind(&gui2::dialogs::mp_alerts_options::display<>));
704 listbox& advanced = find_widget<listbox>(
this,
"advanced_prefs",
false);
708 for(
const auto& option :
prefs::get().get_advanced_preferences()) {
709 const std::string pref_name = option.field;
711 row_data[
"pref_name"][
"label"] = option.name;
714 grid& details_grid = find_widget<grid>(main_grid,
"prefs_setter_grid",
false);
718 toggle_button& toggle_box = find_widget<toggle_button>(main_grid,
"value_toggle",
false);
721 if(!option.description.empty()) {
722 find_widget<styled_widget>(main_grid,
"description",
false).set_label(option.description);
725 switch(option.type) {
736 gui2::bind_status_label<toggle_button>(
737 main_grid,
"value_toggle", default_status_value_getter<toggle_button>,
"value");
743 auto setter_widget = build_single_widget_instance<slider>(
config {
"definition",
"minimal"});
744 setter_widget->set_id(
"setter");
746 setter_widget->set_value_range(option.cfg[
"min"].to_int(), option.cfg[
"max"].to_int());
747 setter_widget->set_step_size(option.cfg[
"step"].to_int(1));
749 details_grid.
swap_child(
"setter", std::move(setter_widget),
true);
751 slider& slide = find_widget<slider>(&details_grid,
"setter",
false);
760 gui2::bind_status_label<slider>(main_grid,
"setter", default_status_value_getter<slider>,
"value");
766 std::vector<config> menu_data;
767 std::vector<std::string> option_ids;
771 menu_item[
"label"] = choice[
"name"];
772 if(choice.has_attribute(
"description")) {
773 menu_item[
"details"] = std::string(
"<span color='#777'>") + choice[
"description"] +
"</span>";
775 menu_data.push_back(menu_item);
776 option_ids.push_back(choice[
"id"]);
780 int selected = std::distance(option_ids.begin(), std::find(option_ids.begin(), option_ids.end(),
785 if(selected < 0 || selected >=
static_cast<int>(option_ids.size())) {
789 auto setter_widget = build_single_widget_instance<menu_button>();
790 setter_widget->set_id(
"setter");
792 details_grid.
swap_child(
"setter", std::move(setter_widget),
true);
794 menu_button& menu = find_widget<menu_button>(&details_grid,
"setter",
false);
803 gui2::bind_status_label<menu_button>(main_grid,
"setter", default_status_value_getter<menu_button>,
"value");
811 auto value_widget = build_single_widget_instance<image>();
812 value_widget->set_label(
"icons/arrows/arrows_blank_right_25.png~CROP(3,3,18,18)");
814 main_grid->
swap_child(
"value", std::move(value_widget),
true);
824 std::ref(advanced)));
832 multimenu_button& hotkey_menu = find_widget<multimenu_button>(
this,
"hotkey_category_menu",
false);
838 text_box& filter = find_widget<text_box>(
this,
"filter",
false);
852 hotkey_list.set_active_sorting_option({0, sort_order::type::ascending},
true);
855 find_widget<button>(
this,
"btn_add_hotkey",
false), std::bind(
861 find_widget<button>(
this,
"btn_clear_hotkey",
false), std::bind(
867 find_widget<button>(
this,
"btn_reset_hotkeys",
false), std::bind(
876 t_string& row_icon = row_data[
"img_icon"][
"label"];
877 t_string& row_action = row_data[
"lbl_desc"][
"label"];
878 t_string& row_hotkey = row_data[
"lbl_hotkey"][
"label"];
880 t_string& row_is_g = row_data[
"lbl_is_game"][
"label"];
881 t_string& row_is_e = row_data[
"lbl_is_editor"][
"label"];
882 t_string& row_is_m = row_data[
"lbl_is_mainmenu"][
"label"];
895 const std::string gh =
"<span color='#0f0'>" +
_(
"game_hotkeys^G") +
"</span>";
896 const std::string eh =
"<span color='#0f0'>" +
_(
"editor_hotkeys^E") +
"</span>";
897 const std::string mh =
"<span color='#0f0'>" +
_(
"mainmenu_hotkeys^M") +
"</span>";
900 if(hotkey_item.hidden) {
908 row_icon =
"icons/action/" + hotkey_item.id +
"_25.png~CROP(3,3,18,18)";
913 row_action = hotkey_item.description;
927 std::vector<config> filter_ops;
932 find_widget<multimenu_button>(
this,
"hotkey_category_menu",
false).set_values(filter_ops);
954 if(newhk.get() ==
nullptr) {
959 if(!hk->is_disabled() && newhk->bindings_equal(hk)) {
964 if(oldhk && oldhk->get_command() == hotkey_item.
id) {
968 if(oldhk && oldhk->get_command() !=
"null") {
969 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>”?", {
970 {
"hotkey_sequence", oldhk->get_name()},
998 hotkey_list.set_active_sorting_option({0, sort_order::type::ascending},
true);
1004 if(row_number < 0) {
1016 const multimenu_button& hotkey_menu = find_widget<const multimenu_button>(
this,
"hotkey_category_menu",
false);
1017 const text_box& name_filter = find_widget<const text_box>(
this,
"filter",
false);
1022 std::string text = name_filter.
get_value();
1025 if(toggle_states.none()) {
1026 toggle_states = ~toggle_states;
1046 unsigned cat_index = 0;
1057 if(cat_index < toggle_states.size() && found) {
1058 res[
h] = toggle_states[cat_index];
1064 find_widget<listbox>(
this,
"list_hotkeys",
false).set_row_shown(res);
1073 if(pref.field ==
"logging") {
1074 gui2::dialogs::log_settings::display();
1075 }
else if(pref.field ==
"orb_color") {
1076 gui2::dialogs::select_orb_colors::display();
1078 WRN_GUI_L <<
"Invalid or unimplemented custom advanced prefs option: " << pref.field;
1084 const bool has_description = !pref.description.empty();
1087 find_widget<widget>(list.
get_row_grid(selected_row),
"prefs_setter_grid",
false)
1120 gui2::bind_status_label<slider>(&
window,
"max_saves_slider");
1121 gui2::bind_status_label<slider>(&
window,
"turbo_slider");
1122 gui2::bind_status_label<slider>(&
window,
"pixel_scale_slider");
1128 listbox& selector = find_widget<listbox>(&
window,
"selector",
false);
1139 "The preferences pager and its selector listbox do not have the same number of items.");
1141 const int main_index = index_in_pager_range(
initial_index_.first, pager);
1147 listbox* tab_selector = find_widget<listbox>(
1153 if(tab_pager && tab_selector) {
1154 const int ii =
static_cast<int>(
i);
1155 const int tab_index = index_in_pager_range(
initial_index_.second, *tab_pager);
1156 const int to_select = (ii == main_index ? tab_index : 0);
1173 find_widget<stacked_widget>(
this, pager_id,
false).select_layer(page);
1179 const bool ison = find_widget<toggle_button>(
this,
"fullscreen",
false).get_value_bool();
1182 menu_button& res_list = find_widget<menu_button>(
this,
"resolution_set",
false);
1190 menu_button& res_list = find_widget<menu_button>(
this,
"resolution_set",
false);
1201 const auto selection =
theme_list.get_value();
1214 menu_button& gui2_theme_list = find_widget<menu_button>(
this,
"choose_gui2_theme",
false);
1215 unsigned selected_theme = gui2_theme_list.
get_value();
1225 const int selected_row =
1226 std::max(0, find_widget<listbox>(
this,
"selector",
false).get_selected_row());
1232 const int selected_row =
1233 std::max(0, find_widget<listbox>(
this,
"tab_selector",
false).get_selected_row());
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.
void set_always_save_fields(const bool always_save_fields)
field_integer * register_integer(const std::string &id, const bool mandatory, const std::function< int()> callback_load_value=nullptr, const std::function< void(int)> callback_save_value=nullptr)
Creates a new integer field.
bool show(const unsigned auto_close_time=0)
Shows the window.
field_bool * register_bool(const std::string &id, const bool mandatory, const std::function< bool()> callback_load_value=nullptr, const std::function< void(bool)> callback_save_value=nullptr, const std::function< void(widget &)> callback_change=nullptr, const bool initial_fire=false)
Creates a new boolean field.
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)
const std::pair< int, int > & initial_index_
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.
unsigned current_gui_theme_
void handle_gui2_theme_select()
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()
std::vector< double > accl_speeds_
std::vector< const hotkey::hotkey_command * > visible_hotkeys_
std::vector< theme_info > themes_
widget_data get_friends_list_row_data(const preferences::acquaintance &entry)
std::set< hotkey::HOTKEY_CATEGORY > visible_categories_
void update_friends_list_controls(listbox &list)
void handle_res_select()
Special callback functions.
void fullscreen_toggle_callback()
std::vector< std::string > gui2_themes_
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)
group< pref_constants::lobby_joins > lobby_joins_group
void initialize_callbacks()
Initializers.
void set_gui2_theme_list(menu_button &theme_list)
std::vector< point > resolutions_
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.
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.
void set_callback_on_value_change(std::function< void(widget &, const T)> func)
Sets a common callback function for all members.
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
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.
A widget that allows the user to input text in single line.
base class of top level items, the only item which needs to store the final canvases to draw on.
void set_retval(const int retval, const bool close_window=true)
Sets there return value of the window.
void keyboard_capture(widget *widget)
const std::string & get_status() const
const std::string & get_nick() const
const std::string & get_notes() const
void set_lobby_joins(pref_constants::lobby_joins show)
bool set_music(bool ison)
void set_sound_volume(int vol)
void set_remember_password(bool remember)
const std::map< std::string, preferences::acquaintance > & get_acquaintances()
void set_turbo(bool ison)
bool set_ui_sound(bool ison)
void set_theme(const std::string &theme)
std::vector< preferences::option > & get_advanced_preferences()
void show_wesnothd_server_search()
bool set_turn_bell(bool ison)
void set_music_volume(int vol)
void set_show_standing_animations(bool value)
void set_pixel_scale(const int scale)
pref_constants::lobby_joins get_lobby_joins()
bool set_sound(bool ison)
void set_scroll_speed(const int scroll)
std::pair< preferences::acquaintance *, bool > add_acquaintance(const std::string &nick, const std::string &mode, const std::string ¬es)
void set_ui_volume(int vol)
void set_bell_volume(int vol)
bool show_standing_animations()
static std::vector< theme_info > get_basic_theme_info(bool include_hidden=false)
Returns minimal info about saved themes, optionally including hidden ones.
map_display and display: classes which take care of displaying the map and game-data on the screen.
Declarations for File-IO.
static std::string _(const char *str)
New lexcical_cast header.
void raise_resize_event()
static bool file_exists(const bfs::path &fpath)
const std::string unicode_multiplication_sign
static void set_sound_volume(int v)
static bool set_sound(bool v)
static bool set_music(bool v)
static bool set_ui_sound(bool v)
static int music_volume()
static void set_bell_volume(int v)
static void set_ui_volume(int v)
static void set_music_volume(int v)
REGISTER_DIALOG(editor_edit_unit)
static bool set_turn_bell(bool v)
static bool ui_sound_on()
static int sound_volume()
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.
gui_theme_map_t guis
Map of all known GUIs.
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_command & get_hotkey_command(const std::string &command)
returns the hotkey_command with the given name
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.
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.
Functions to load and save images from/to disk.
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.
static bool get(const std::string &pref, bool def)
static void set(const std::string &pref, bool value)
Definitions related to theme-support.
#define VALIDATE(cond, message)
The macro to use for the validation of WML.