The Battle for Wesnoth  1.19.4+dev
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
prefs Class Reference

#include <preferences.hpp>

Public Member Functions

 ~prefs ()
 
void write_preferences ()
 
void load_advanced_prefs (const game_config_view &gc)
 
void migrate_preferences (const std::string &prefs_dir)
 
void reload_preferences ()
 
std::set< std::string > all_attributes ()
 
void load_hotkeys ()
 
void save_hotkeys ()
 
void clear_hotkeys ()
 
bool show_fps ()
 
void set_show_fps (bool value)
 
bool message_private ()
 
void set_message_private (bool value)
 
bool message_bell ()
 
bool middle_click_scrolls ()
 
int mouse_scroll_threshold ()
 Gets the threshold for when to scroll. More...
 
bool confirm_load_save_from_different_version ()
 
bool use_twelve_hour_clock_format ()
 
sort_order::type addon_manager_saved_order_direction ()
 
void set_addon_manager_saved_order_direction (sort_order::type value)
 
bool get_show_deprecation (bool def)
 
bool get_scroll_when_mouse_outside (bool def)
 
bool auto_open_whisper_windows ()
 
bool show_combat ()
 
std::string get_chat_timestamp (const std::time_t &t)
 
compression::format save_compression_format ()
 
std::vector< std::string > * get_history (const std::string &id)
 Returns a pointer to the history vector associated with given id making a new one if it doesn't exist. More...
 
std::vector< preferences::option > & get_advanced_preferences ()
 
point resolution ()
 
void set_resolution (const point &res)
 
int pixel_scale ()
 
void set_pixel_scale (const int scale)
 
bool turbo ()
 
void set_turbo (bool ison)
 
int font_scaling ()
 
void set_font_scaling (int scale)
 
int font_scaled (int size)
 
int keepalive_timeout ()
 
void keepalive_timeout (int seconds)
 
bool sound ()
 
bool set_sound (bool ison)
 
unsigned int sample_rate ()
 
void save_sample_rate (const unsigned int rate)
 
std::size_t sound_buffer_size ()
 
void save_sound_buffer_size (const std::size_t size)
 
int sound_volume ()
 
void set_sound_volume (int vol)
 
int bell_volume ()
 
void set_bell_volume (int vol)
 
int ui_volume ()
 
void set_ui_volume (int vol)
 
bool music_on ()
 
bool set_music (bool ison)
 
int music_volume ()
 
void set_music_volume (int vol)
 
bool turn_bell ()
 
bool set_turn_bell (bool ison)
 
bool ui_sound_on ()
 
bool set_ui_sound (bool ison)
 
void add_alias (const std::string &alias, const std::string &command)
 
optional_const_config get_alias ()
 
std::string allied_color ()
 
void set_allied_color (const std::string &color_id)
 
std::string enemy_color ()
 
void set_enemy_color (const std::string &color_id)
 
std::string unmoved_color ()
 
void set_unmoved_color (const std::string &color_id)
 
std::string partial_color ()
 
void set_partial_color (const std::string &color_id)
 
std::string moved_color ()
 
void set_moved_color (const std::string &color_id)
 
int scroll_speed ()
 
void set_scroll_speed (const int scroll)
 
void set_dir_bookmarks (const config &cfg)
 
optional_const_config dir_bookmarks ()
 
std::size_t editor_mru_limit ()
 
std::vector< std::string > do_read_editor_mru ()
 
void do_commit_editor_mru (const std::vector< std::string > &mru)
 
std::vector< std::string > recent_files ()
 Retrieves the list of recently opened files. More...
 
void add_recent_files_entry (const std::string &path)
 Adds an entry to the recent files list. More...
 
bool use_color_cursors ()
 
void set_color_cursors (bool value)
 
bool show_standing_animations ()
 
void set_show_standing_animations (bool value)
 
void show_wesnothd_server_search ()
 
bool show_theme_dialog ()
 
void set_theme (const std::string &theme)
 
std::string theme ()
 
void set_mp_server_program_name (const std::string &)
 
std::string get_mp_server_program_name ()
 
bool parse_should_show_lobby_join (const std::string &sender, const std::string &message)
 
pref_constants::lobby_joins get_lobby_joins ()
 
void set_lobby_joins (pref_constants::lobby_joins show)
 
const std::map< std::string, preferences::acquaintance > & get_acquaintances ()
 
const std::string get_ignored_delim ()
 
std::map< std::string, std::string > get_acquaintances_nice (const std::string &filter)
 
std::pair< preferences::acquaintance *, bool > add_acquaintance (const std::string &nick, const std::string &mode, const std::string &notes)
 
void add_completed_campaign (const std::string &campaign_id, const std::string &difficulty_level)
 
bool remove_acquaintance (const std::string &nick)
 
bool is_friend (const std::string &nick)
 
bool is_ignored (const std::string &nick)
 
bool is_campaign_completed (const std::string &campaign_id)
 
bool is_campaign_completed (const std::string &campaign_id, const std::string &difficulty_level)
 
const std::vector< game_config::server_info > & builtin_servers_list ()
 
std::vector< game_config::server_infouser_servers_list ()
 
void set_user_servers_list (const std::vector< game_config::server_info > &value)
 
std::string network_host ()
 
void set_network_host (const std::string &host)
 
std::string campaign_server ()
 
void set_campaign_server (const std::string &host)
 
const configoptions ()
 
void set_options (const config &values)
 
int countdown_init_time ()
 
void set_countdown_init_time (int value)
 
void clear_countdown_init_time ()
 
int countdown_turn_bonus ()
 
void set_countdown_turn_bonus (int value)
 
void clear_countdown_turn_bonus ()
 
int countdown_reservoir_time ()
 
void set_countdown_reservoir_time (int value)
 
void clear_countdown_reservoir_time ()
 
int countdown_action_bonus ()
 
void set_countdown_action_bonus (int value)
 
void clear_countdown_action_bonus ()
 
int village_gold ()
 
void set_village_gold (int value)
 
int village_support ()
 
void set_village_support (int value)
 
int xp_modifier ()
 
void set_xp_modifier (int value)
 
bool remember_password ()
 
void set_remember_password (bool remember)
 
std::string login ()
 
void set_login (const std::string &login)
 
std::string password (const std::string &server, const std::string &login)
 
void set_password (const std::string &server, const std::string &login, const std::string &key)
 
const std::vector< std::string > & modifications (bool mp=true)
 
void set_modifications (const std::vector< std::string > &value, bool mp=true)
 
std::set< std::string > & encountered_units ()
 
std::set< t_translation::terrain_code > & encountered_terrains ()
 
bool yellow_confirm ()
 
bool green_confirm ()
 
bool confirm_no_moves ()
 
void encounter_recruitable_units (const std::vector< team > &teams)
 
void encounter_start_units (const unit_map &units)
 
void encounter_recallable_units (const std::vector< team > &teams)
 
void encounter_map_terrain (const gamemap &map)
 
void encounter_all_content (const game_board &gb)
 
bool achievement (const std::string &content_for, const std::string &id)
 
void set_achievement (const std::string &content_for, const std::string &id)
 Marks the specified achievement as completed. More...
 
int progress_achievement (const std::string &content_for, const std::string &id, int limit=999999, int max_progress=999999, int amount=0)
 Increments the achievement's current progress by amount if it hasn't already been completed. More...
 
bool sub_achievement (const std::string &content_for, const std::string &id, const std::string &sub_id)
 
void set_sub_achievement (const std::string &content_for, const std::string &id, const std::string &sub_id)
 Marks the specified sub-achievement as completed. More...
 
void clear_mp_alert_prefs ()
 The most recently selected add-on id from the editor. More...
 

Static Public Member Functions

static prefsget ()
 
static void disable_preferences_save ()
 
static bool preferences_save ()
 

Private Member Functions

 prefs ()
 
 prefs (const prefs &p)=delete
 
prefsoperator= (const prefs &p)=delete
 
 prefs (const prefs &&p)=delete
 
prefsoperator= (const prefs &&p)=delete
 
void load_preferences ()
 
void clear_preferences ()
 
void load_credentials ()
 
void save_credentials ()
 
void clear_credentials ()
 
void set_child (const std::string &key, const config &val)
 
optional_const_config get_child (const std::string &key)
 
std::string get (const std::string &key, const std::string &def)
 
config::attribute_value get_as_attribute (const std::string &key)
 
std::string get_system_username ()
 
preferences::secure_buffer aes_encrypt (const preferences::secure_buffer &text, const preferences::secure_buffer &key)
 Encrypts the value of text using key and a hard coded IV using AES. More...
 
preferences::secure_buffer aes_decrypt (const preferences::secure_buffer &text, const preferences::secure_buffer &key)
 Same as aes_encrypt(), except of course it takes encrypted data as an argument and returns decrypted data. More...
 
preferences::secure_buffer build_key (const std::string &server, const std::string &login)
 Fills a secure_buffer with 32 bytes of deterministically generated bytes, then overwrites it with the system login name, server login name, and server name. More...
 
preferences::secure_buffer escape (const preferences::secure_buffer &text)
 
preferences::secure_buffer unescape (const preferences::secure_buffer &text)
 

Private Attributes

config preferences_
 
bool fps_
 
std::map< std::string, std::set< std::string > > completed_campaigns_
 
std::set< std::string > encountered_units_set_
 
std::set< t_translation::terrain_codeencountered_terrains_set_
 
std::map< std::string, std::vector< std::string > > history_map_
 
std::map< std::string, preferences::acquaintanceacquaintances_
 
config option_values_
 
bool options_initialized_
 
std::vector< std::string > mp_modifications_
 
bool mp_modifications_initialized_
 
std::vector< std::string > sp_modifications_
 
bool sp_modifications_initialized_
 
bool message_private_on_
 
std::vector< preferences::login_infocredentials_
 
std::vector< preferences::optionadvanced_prefs_
 
std::set< std::string > unknown_synced_attributes_
 
std::set< std::string > unknown_unsynced_attributes_
 
std::set< std::string > unknown_synced_children_
 
std::set< std::string > unknown_unsynced_children_
 

Static Private Attributes

static bool no_preferences_save = false
 
static constexpr std::array synced_attributes_
 
static constexpr std::array synced_children_
 
static constexpr std::array unsynced_attributes_
 
static constexpr std::array unsynced_children_
 

Friends

struct preferences_dialog_friend
 
int impl_preferences_set (lua_State *L)
 The __newindex metamethod. More...
 
int impl_preferences_get (lua_State *L)
 The __index metamethod. More...
 

Detailed Description

Definition at line 192 of file preferences.hpp.

Constructor & Destructor Documentation

◆ ~prefs()

prefs::~prefs ( )

◆ prefs() [1/3]

prefs::prefs ( )
private

◆ prefs() [2/3]

prefs::prefs ( const prefs p)
privatedelete

◆ prefs() [3/3]

prefs::prefs ( const prefs &&  p)
privatedelete

Member Function Documentation

◆ achievement()

bool prefs::achievement ( const std::string &  content_for,
const std::string &  id 
)
Parameters
content_forThe achievement group the achievement is part of.
idThe ID of the achievement within the achievement group.
Returns
True if the achievement exists and is completed, false otherwise.

Definition at line 942 of file preferences.cpp.

References config::child_range(), preferences_, and utils::split().

Referenced by progress_achievement(), set_sub_achievement(), and sub_achievement().

◆ add_acquaintance()

std::pair< preferences::acquaintance *, bool > prefs::add_acquaintance ( const std::string &  nick,
const std::string &  mode,
const std::string &  notes 
)

◆ add_alias()

void prefs::add_alias ( const std::string &  alias,
const std::string &  command 
)

Definition at line 894 of file preferences.cpp.

References config::child_or_add(), and preferences_.

Referenced by events::console_handler::do_set_alias().

◆ add_completed_campaign()

void prefs::add_completed_campaign ( const std::string &  campaign_id,
const std::string &  difficulty_level 
)

Definition at line 1438 of file preferences.cpp.

References completed_campaigns_.

Referenced by campaign_controller::play_game().

◆ add_recent_files_entry()

void prefs::add_recent_files_entry ( const std::string &  path)

Adds an entry to the recent files list.

Definition at line 1210 of file preferences.cpp.

References do_commit_editor_mru(), do_read_editor_mru(), editor_mru_limit(), game_config::path, and gui2::dialogs::tip::remove().

Referenced by editor::map_context::add_to_recent_files().

◆ addon_manager_saved_order_direction()

sort_order::type prefs::addon_manager_saved_order_direction ( )

◆ aes_decrypt()

preferences::secure_buffer prefs::aes_decrypt ( const preferences::secure_buffer text,
const preferences::secure_buffer key 
)
private

Same as aes_encrypt(), except of course it takes encrypted data as an argument and returns decrypted data.

Definition at line 1989 of file preferences.cpp.

References DBG_CFG, ERR_CFG, i, and utils::join().

Referenced by load_credentials(), and password().

◆ aes_encrypt()

preferences::secure_buffer prefs::aes_encrypt ( const preferences::secure_buffer text,
const preferences::secure_buffer key 
)
private

Encrypts the value of text using key and a hard coded IV using AES.

Max size of text must not be larger than 1008 bytes.

NOTE: This is not meant to provide strong protections against a determined attacker. This is meant to hide the passwords from malware scanning files for passwords, family/friends poking around, etc.

Parameters
textThe original unencrypted data.
keyThe value to use to encrypt the data. See build_key() for key generation.
Returns
secure_buffer The encrypted data.

Definition at line 1901 of file preferences.cpp.

References DBG_CFG, ERR_CFG, i, and utils::join().

Referenced by save_credentials(), and set_password().

◆ all_attributes()

std::set< std::string > prefs::all_attributes ( )

Definition at line 217 of file preferences.cpp.

References config::attribute_range(), and preferences_.

◆ allied_color()

std::string prefs::allied_color ( )

◆ auto_open_whisper_windows()

bool prefs::auto_open_whisper_windows ( )

Definition at line 1145 of file preferences.cpp.

References preferences_.

Referenced by gui2::chatbox::add_whisper_received().

◆ bell_volume()

int prefs::bell_volume ( )

Definition at line 706 of file preferences.cpp.

References gui2::dialogs::bell_volume(), and preferences_.

Referenced by gui2::dialogs::bell_volume(), and set_bell_volume().

◆ build_key()

preferences::secure_buffer prefs::build_key ( const std::string &  server,
const std::string &  login 
)
private

Fills a secure_buffer with 32 bytes of deterministically generated bytes, then overwrites it with the system login name, server login name, and server name.

If this is more than 32 bytes, then it's truncated. If it's less than 32 bytes, then the pre-generated bytes are used to pad it.

Parameters
serverThe server being logged into.
loginThe username being used to login.
Returns
secure_buffer The data to be used as the encryption key.

Definition at line 1889 of file preferences.cpp.

References get_system_username(), i, and login().

Referenced by load_credentials(), password(), save_credentials(), and set_password().

◆ builtin_servers_list()

const std::vector< game_config::server_info > & prefs::builtin_servers_list ( )

Definition at line 1506 of file preferences.cpp.

References game_config::server_list.

Referenced by network_host().

◆ campaign_server()

std::string prefs::campaign_server ( )

◆ clear_countdown_action_bonus()

void prefs::clear_countdown_action_bonus ( )

◆ clear_countdown_init_time()

void prefs::clear_countdown_init_time ( )

◆ clear_countdown_reservoir_time()

void prefs::clear_countdown_reservoir_time ( )

◆ clear_countdown_turn_bonus()

void prefs::clear_countdown_turn_bonus ( )

◆ clear_credentials()

void prefs::clear_credentials ( )
private

Definition at line 416 of file preferences.cpp.

References credentials_, and draw::fill().

Referenced by load_credentials(), set_password(), and set_remember_password().

◆ clear_hotkeys()

void prefs::clear_hotkeys ( )

◆ clear_mp_alert_prefs()

void prefs::clear_mp_alert_prefs ( )

The most recently selected add-on id from the editor.

May be an empty string.

Definition at line 1837 of file preferences.cpp.

References preferences_, and config::remove_attribute().

Referenced by gui2::dialogs::revert_to_default_pref_values().

◆ clear_preferences()

void prefs::clear_preferences ( )
inlineprivate

Definition at line 624 of file preferences.hpp.

References config::clear(), and preferences_.

Referenced by reload_preferences().

◆ confirm_load_save_from_different_version()

bool prefs::confirm_load_save_from_different_version ( )

Definition at line 922 of file preferences.cpp.

References preferences_.

◆ confirm_no_moves()

bool prefs::confirm_no_moves ( )

Definition at line 1787 of file preferences.cpp.

References config::empty(), and preferences_.

Referenced by events::menu_handler::end_turn().

◆ countdown_action_bonus()

int prefs::countdown_action_bonus ( )

Definition at line 1641 of file preferences.cpp.

References preferences_.

Referenced by ng::configure_engine::mp_countdown_action_bonus_default().

◆ countdown_init_time()

int prefs::countdown_init_time ( )

Definition at line 1596 of file preferences.cpp.

References preferences_.

Referenced by ng::configure_engine::mp_countdown_init_time_default().

◆ countdown_reservoir_time()

int prefs::countdown_reservoir_time ( )

Definition at line 1611 of file preferences.cpp.

References preferences_.

Referenced by ng::configure_engine::mp_countdown_reservoir_time_default().

◆ countdown_turn_bonus()

int prefs::countdown_turn_bonus ( )

Definition at line 1626 of file preferences.cpp.

References preferences_.

Referenced by ng::configure_engine::mp_countdown_turn_bonus_default().

◆ dir_bookmarks()

optional_const_config prefs::dir_bookmarks ( )

Definition at line 1140 of file preferences.cpp.

References get_child().

◆ disable_preferences_save()

static void prefs::disable_preferences_save ( )
inlinestatic

Definition at line 225 of file preferences.hpp.

References no_preferences_save.

Referenced by game_launcher::game_launcher().

◆ do_commit_editor_mru()

void prefs::do_commit_editor_mru ( const std::vector< std::string > &  mru)

Definition at line 1183 of file preferences.cpp.

References config::add_child(), editor_mru_limit(), n, and set_child().

Referenced by add_recent_files_entry().

◆ do_read_editor_mru()

std::vector< std::string > prefs::do_read_editor_mru ( )

Definition at line 1161 of file preferences.cpp.

References config::child_range(), editor_mru_limit(), and get_child().

Referenced by add_recent_files_entry(), and recent_files().

◆ editor_mru_limit()

std::size_t prefs::editor_mru_limit ( )

Definition at line 1150 of file preferences.cpp.

References preferences_.

Referenced by add_recent_files_entry(), do_commit_editor_mru(), and do_read_editor_mru().

◆ encounter_all_content()

void prefs::encounter_all_content ( const game_board gb)

◆ encounter_map_terrain()

void prefs::encounter_map_terrain ( const gamemap map)

◆ encounter_recallable_units()

void prefs::encounter_recallable_units ( const std::vector< team > &  teams)

Definition at line 1809 of file preferences.cpp.

References encountered_units_set_, and t.

Referenced by encounter_all_content().

◆ encounter_recruitable_units()

void prefs::encounter_recruitable_units ( const std::vector< team > &  teams)

Definition at line 1794 of file preferences.cpp.

References encountered_units_set_.

Referenced by encounter_all_content().

◆ encounter_start_units()

void prefs::encounter_start_units ( const unit_map units)

Definition at line 1802 of file preferences.cpp.

References encountered_units_set_.

Referenced by encounter_all_content().

◆ encountered_terrains()

std::set< t_translation::terrain_code > & prefs::encountered_terrains ( )

◆ encountered_units()

std::set< std::string > & prefs::encountered_units ( )

◆ enemy_color()

std::string prefs::enemy_color ( )

◆ escape()

preferences::secure_buffer prefs::escape ( const preferences::secure_buffer text)
private

Definition at line 2107 of file preferences.cpp.

References c.

Referenced by save_credentials().

◆ font_scaled()

int prefs::font_scaled ( int  size)

◆ font_scaling()

int prefs::font_scaling ( )

◆ get() [1/2]

static prefs& prefs::get ( )
inlinestatic

Definition at line 199 of file preferences.hpp.

Referenced by achievement::achievement(), achievement_group::achievement_group(), ad_hoc_addon_fetch_session(), font::pango_text::add_attribute_size(), replay::add_chat_log_entry(), events::menu_handler::add_chat_message(), display_chat_manager::add_chat_message(), gui2::chatbox::add_chat_room_message_received(), events::chat_handler::add_chat_room_message_sent(), gui2::chatbox::add_chat_room_message_sent(), gui2::dialogs::preferences_dialog::add_friend_list_entry(), gui2::dialogs::lobby_player_info::add_to_friends_button_callback(), gui2::dialogs::lobby_player_info::add_to_ignores_button_callback(), editor::map_context::add_to_recent_files(), unit_creator::add_unit(), gui2::chatbox::add_whisper_received(), gui2::chatbox::add_whisper_sent(), gui2::dialogs::addon_auth::addon_auth(), advance_unit(), ng::configure_engine::allow_observers_default(), gui2::chatbox::append_to_chatbox(), unit::apply_builtin_effect(), gui2::dialogs::preferences_dialog::apply_pixel_scale(), playsingle_controller::before_human_turn(), gui2::dialogs::bell_volume(), gui2::dialogs::title_screen::button_callback_cores(), gui2::dialogs::title_screen::button_callback_multiplayer(), gui2::dialogs::campaign_selection::campaign_selected(), game_board::change_terrain(), gui2::chatbox::chat_input_keypress_callback(), savegame::loadgame::check_version_compatibility(), gui::floating_textbox::close(), ng::create_engine::create_engine(), events::menu_handler::custom_command(), gui2::dialogs::preferences_dialog::default_hotkey_callback(), gui2::dialogs::game_load::delete_button_callback(), addons_client::delete_remote_addon(), deprecated_message(), help::description_type(), display::display(), play_controller::do_autosave(), play_controller::do_consolesave(), events::console_handler::do_custom(), events::console_handler::do_discover(), events::console_handler::do_droid(), ai::move_result::do_execute(), ai::recall_result::do_execute(), ai::recruit_result::do_execute(), hotkey::command_executor::do_execute_command(), editor::editor_controller::do_execute_command(), events::console_handler::do_fps(), events::chat_command_handler::do_friend(), do_gameloop(), events::chat_command_handler::do_ignore(), events::chat_command_handler::do_remove(), do_replay_handle(), events::console_handler::do_set_alias(), events::console_handler::do_theme(), events::console_handler::do_undiscover(), display::draw(), display::draw_hex(), display::draw_minimap_units(), events::menu_handler::end_turn(), hotkey::command_executor::execute_command_wrap(), editor::context_manager::expand_load_mru_menu(), gui2::dialogs::mp_join_game::fetch_game_config(), combatant::fight(), game_display::float_label(), ng::configure_engine::fog_game_default(), foreach_autosave(), gui2::dialogs::format_addon_time(), savegame::save_info::format_time_local(), utils::format_time_summary(), mp::ui_alerts::friend_message(), game_config_manager::game_config_manager(), mp::ui_alerts::game_created(), mp::ui_alerts::game_has_begun(), game_launcher::game_launcher(), ng::configure_engine::game_name_default(), gui2::dialogs::mp_join_game::generate_side_list(), help::generate_terrain_sections(), preferences_dialog_friend::get(), play_controller::hotkey_handler::get_action_state(), editor::editor_controller::get_action_state(), gui2::dialogs::get_do_not_show_again(), gui2::dialogs::get_dont_ask_again(), draw_manager::get_frame_length(), gui2::text_history::get_history(), get_locale(), gui2::get_mp_tooltip(), orb_status_helper::get_orb_color(), mp::user_info::get_relation(), gui2::dialogs::preferences_dialog::handle_gui2_theme_select(), controller_base::handle_scroll(), gui2::dialogs::preferences_dialog::handle_theme_select(), sound::music_muter::handle_window_event(), wesnothd_connection::handshake(), impl_audio_get(), impl_audio_set(), impl_music_get(), impl_music_set(), impl_preferences_dir(), play_controller::init(), game_state::init(), game_config_manager::init_game_config(), editor::editor_controller::init_gui(), help::init_help(), events::console_handler::init_map(), sound::init_sound(), video::init_window(), gui2::dialogs::preferences_dialog::initialize_callbacks(), intf_add_known_unit(), game_lua_kernel::intf_has_achievement(), game_lua_kernel::intf_has_sub_achievement(), game_lua_kernel::intf_progress_achievement(), game_lua_kernel::intf_set_achievement(), game_lua_kernel::intf_set_sub_achievement(), display::invalidate_animations(), game_config_manager::load_addons_cfg(), game_config_manager::load_game_config(), editor::context_manager::load_mru_item(), gui2::dialogs::mp_login::load_password(), login(), manage_addons(), wb::manager::manager(), ng::campaign::mark_if_completed(), countdown_clock::maybe_play_sound(), migrate_preferences(), events::mouse_handler_base::mouse_press(), events::mouse_handler_base::mouse_wheel(), actions::move_unit_and_record(), gui2::dialogs::mp_connect::mp_connect(), ng::configure_engine::mp_countdown_action_bonus_default(), ng::configure_engine::mp_countdown_default(), ng::configure_engine::mp_countdown_init_time_default(), ng::configure_engine::mp_countdown_reservoir_time_default(), ng::configure_engine::mp_countdown_turn_bonus_default(), gui2::dialogs::mp_create_game::mp_create_game(), gui2::dialogs::mp_lobby::mp_lobby(), gui2::dialogs::mp_login::mp_login(), gui2::dialogs::mp_options_helper::mp_options_helper(), gui2::dialogs::music_on(), gui2::dialogs::music_volume(), ng::side_engine::new_config(), ng::configure_engine::num_turns_default(), gui2::dialogs::preferences_dialog::on_advanced_prefs_list_select(), gui2::dialogs::preferences_dialog::on_friends_list_select(), wb::manager::on_init_side(), gui2::dialogs::addon_manager::on_order_changed(), gui2::dialogs::mp_connect::on_server_add(), gui2::dialogs::mp_connect::on_server_delete(), help::unit_topic_generator::operator()(), ng::configure_engine::options_default(), gui2::dialogs::addon_manager::order_addons(), actions::place_recruit(), sound::play_bell(), campaign_controller::play_game(), playsingle_controller::play_human_turn(), playmp_controller::play_human_turn(), game_launcher::play_multiplayer(), sound::play_new_music(), playsingle_controller::play_scenario(), sound::play_sound(), sound::play_sound_positioned(), sound::play_timer(), sound::play_UI_sound(), mp::ui_alerts::player_joins(), mp::ui_alerts::player_leaves(), gui2::player_list_helper::player_list_helper(), gui2::dialogs::editor_choose_addon::populate_list(), unit_creator::post_create(), gui2::dialogs::achievements_dialog::post_show(), gui2::dialogs::campaign_selection::post_show(), gui2::dialogs::editor_choose_addon::post_show(), gui2::dialogs::language_selection::post_show(), gui2::dialogs::migrate_version_selection::post_show(), gui2::dialogs::mp_create_game::post_show(), gui2::dialogs::mp_join_game::post_show(), gui2::dialogs::mp_method_selection::post_show(), gui2::dialogs::preferences_dialog::post_show(), gui2::dialogs::select_orb_colors::post_show(), gui2::dialogs::addon_manager::pre_show(), gui2::dialogs::campaign_difficulty::pre_show(), gui2::dialogs::mp_lobby::pre_show(), gui2::dialogs::mp_change_control::pre_show(), gui2::dialogs::mp_create_game::pre_show(), gui2::dialogs::mp_method_selection::pre_show(), gui2::dialogs::select_orb_colors::pre_show(), orb_status_helper::prefs_show_orb(), image::prep_minimap_for_rendering(), mp::ui_alerts::private_message(), sound::music_thinker::process(), gui2::chatbox::process_message(), playmp_controller::process_network_data_impl(), gui2::dialogs::faction_select::profile_button_callback(), display_chat_manager::prune_chat_messages(), mp::ui_alerts::public_message(), gui2::dialogs::addon_manager::publish_addon(), events::pump(), sound::driver_status::query(), ng::configure_engine::random_faction_mode_default(), ng::configure_engine::random_start_time_default(), mp::ui_alerts::ready_for_start(), ng::side_engine::ready_for_start(), terrain_builder::tile::rebuild_cache(), unit_drawer::redraw_unit(), gui2::dialogs::title_screen::register_button(), gui2::dialogs::preferences_dialog::remove_friend_list_entry(), gui2::dialogs::lobby_player_info::remove_from_list_button_callback(), REPORT_GENERATOR(), events::menu_handler::request_control_change(), sound::reset_sound(), gui2::dialogs::mp_create_game::reset_timer_settings(), gui2::dialogs::revert_to_default_pref_values(), play_controller::save_game(), play_controller::save_game_auto(), gui2::dialogs::mp_login::save_password(), play_controller::save_replay(), play_controller::save_replay_auto(), display::scroll_to_xy(), gui2::chatbox::send_chat_message(), events::menu_handler::send_chat_message(), events::chat_handler::send_chat_room_message(), ng::connect_engine::send_level_data(), events::chat_handler::send_whisper(), mp::ui_alerts::server_message(), preferences_dialog_friend::set(), gui2::dialogs::set_bell_volume(), gui2::dialogs::set_do_not_show_again(), gui2::dialogs::set_dont_ask_again(), font::pango_text::set_font_size(), video::set_fullscreen(), gui2::dialogs::preferences_dialog::set_gui2_theme_list(), gui2::dialogs::set_music(), gui2::dialogs::set_music_volume(), ng::configure_engine::set_options(), video::set_resolution(), unit_animation_component::set_selecting(), gui2::dialogs::set_sound(), gui2::dialogs::set_sound_volume(), unit_animation_component::set_standing(), gui2::dialogs::preferences_dialog::set_theme_list(), gui2::dialogs::set_turn_bell(), gui2::dialogs::set_ui_sound(), gui2::dialogs::set_ui_volume(), editor::context_manager::set_update_transitions_mode(), display::set_zoom(), events::menu_handler::shout(), gui2::dialogs::mp_join_game::show_flg_select(), playsingle_controller::show_turn_dialog(), ng::configure_engine::shroud_game_default(), gui2::tip_of_the_day::shuffle(), ng::configure_engine::shuffle_sides_default(), gui2::dialogs::mp_lobby::skip_replay_changed_callback(), gui2::dialogs::sound(), gui2::dialogs::sound_volume(), events::menu_handler::speak(), mp::start_local_game(), mp::start_local_game_commandline(), game_launcher::start_wesnothd(), gui2::dialogs::chat_log::model::stream_log(), SYNCED_COMMAND_HANDLER_FUNCTION(), play_controller::tab(), game_classification::to_config(), play_controller::hotkey_handler::toggle_accelerated_speed(), events::menu_handler::toggle_ellipses(), video::toggle_fullscreen(), events::menu_handler::toggle_grid(), editor::editor_controller::toggle_grid(), editor::context_manager::toggle_update_transitions(), display::turbo_speed(), gui2::dialogs::turn_bell(), mp::ui_alerts::turn_changed(), gui2::dialogs::ui_sound_on(), gui2::dialogs::ui_volume(), unit_display::unit_attack(), unit_display::unit_die(), unit_display::unit_draw_weapon(), unit_moves(), unit_display::unit_sheath_weapon(), display::update(), video::update_framebuffer(), gui2::player_list_helper::update_list(), ng::configure_engine::use_map_settings_default(), ng::configure_engine::village_gold_default(), ng::configure_engine::village_support_default(), events::menu_handler::whisper(), savegame::save_index_class::write_save_index(), ng::configure_engine::xp_modifier_default(), and campaign_controller::~campaign_controller().

◆ get() [2/2]

std::string prefs::get ( const std::string &  key,
const std::string &  def 
)
private

Definition at line 506 of file preferences.cpp.

References config::empty(), and preferences_.

◆ get_acquaintances()

const std::map< std::string, preferences::acquaintance > & prefs::get_acquaintances ( )

◆ get_acquaintances_nice()

std::map< std::string, std::string > prefs::get_acquaintances_nice ( const std::string &  filter)

Definition at line 1369 of file preferences.cpp.

References acquaintances_.

Referenced by play_controller::tab().

◆ get_advanced_preferences()

std::vector<preferences::option>& prefs::get_advanced_preferences ( )
inline

◆ get_alias()

optional_const_config prefs::get_alias ( )

Definition at line 901 of file preferences.cpp.

References get_child().

◆ get_as_attribute()

config::attribute_value prefs::get_as_attribute ( const std::string &  key)
private

Definition at line 510 of file preferences.cpp.

References preferences_.

◆ get_chat_timestamp()

std::string prefs::get_chat_timestamp ( const std::time_t &  t)

◆ get_child()

optional_const_config prefs::get_child ( const std::string &  key)
private

◆ get_history()

std::vector< std::string > * prefs::get_history ( const std::string &  id)

Returns a pointer to the history vector associated with given id making a new one if it doesn't exist.

Todo:
FIXME only used for gui2. Could be used for the above histories.

Definition at line 1771 of file preferences.cpp.

References history_map_, and id.

Referenced by gui2::text_history::get_history().

◆ get_ignored_delim()

const std::string prefs::get_ignored_delim ( )

Definition at line 1355 of file preferences.cpp.

References acquaintances_, and utils::join().

Referenced by ng::connect_engine::send_level_data().

◆ get_lobby_joins()

pref_constants::lobby_joins prefs::get_lobby_joins ( )

◆ get_mp_server_program_name()

std::string prefs::get_mp_server_program_name ( )

Definition at line 1345 of file preferences.cpp.

References preferences_.

Referenced by show_wesnothd_server_search(), and game_launcher::start_wesnothd().

◆ get_scroll_when_mouse_outside()

bool prefs::get_scroll_when_mouse_outside ( bool  def)

Definition at line 1131 of file preferences.cpp.

References preferences_.

Referenced by controller_base::handle_scroll().

◆ get_show_deprecation()

bool prefs::get_show_deprecation ( bool  def)

Definition at line 1126 of file preferences.cpp.

References preferences_.

◆ get_system_username()

std::string prefs::get_system_username ( )
private

Definition at line 1871 of file preferences.cpp.

References login(), and utf8::size().

Referenced by build_key(), load_credentials(), login(), and save_credentials().

◆ green_confirm()

bool prefs::green_confirm ( )

Definition at line 1776 of file preferences.cpp.

References preferences_.

◆ is_campaign_completed() [1/2]

bool prefs::is_campaign_completed ( const std::string &  campaign_id)

◆ is_campaign_completed() [2/2]

bool prefs::is_campaign_completed ( const std::string &  campaign_id,
const std::string &  difficulty_level 
)

Definition at line 1448 of file preferences.cpp.

References completed_campaigns_.

◆ is_friend()

bool prefs::is_friend ( const std::string &  nick)

◆ is_ignored()

bool prefs::is_ignored ( const std::string &  nick)

◆ keepalive_timeout() [1/2]

int prefs::keepalive_timeout ( )

Definition at line 642 of file preferences.cpp.

References preferences_.

Referenced by wesnothd_connection::handshake().

◆ keepalive_timeout() [2/2]

void prefs::keepalive_timeout ( int  seconds)

Definition at line 647 of file preferences.cpp.

References preferences_.

◆ load_advanced_prefs()

void prefs::load_advanced_prefs ( const game_config_view gc)

◆ load_credentials()

void prefs::load_credentials ( )
private

◆ load_hotkeys()

void prefs::load_hotkeys ( )

◆ load_preferences()

void prefs::load_preferences ( )
private

◆ login()

std::string prefs::login ( )

◆ message_bell()

bool prefs::message_bell ( )

Definition at line 794 of file preferences.cpp.

References preferences_.

Referenced by do_replay_handle(), and playmp_controller::process_network_data_impl().

◆ message_private()

bool prefs::message_private ( )

Definition at line 1712 of file preferences.cpp.

References message_private_on_.

◆ middle_click_scrolls()

bool prefs::middle_click_scrolls ( )

Definition at line 858 of file preferences.cpp.

References preferences_.

◆ migrate_preferences()

void prefs::migrate_preferences ( const std::string &  prefs_dir)

◆ modifications()

const std::vector< std::string > & prefs::modifications ( bool  mp = true)

◆ mouse_scroll_threshold()

int prefs::mouse_scroll_threshold ( )

Gets the threshold for when to scroll.

This scrolling happens when the mouse is in the application and near the border.

Definition at line 863 of file preferences.cpp.

References preferences_.

Referenced by controller_base::handle_scroll().

◆ moved_color()

std::string prefs::moved_color ( )

◆ music_on()

bool prefs::music_on ( )

◆ music_volume()

int prefs::music_volume ( )

◆ network_host()

std::string prefs::network_host ( )

◆ operator=() [1/2]

prefs& prefs::operator= ( const prefs &&  p)
privatedelete

◆ operator=() [2/2]

prefs& prefs::operator= ( const prefs p)
privatedelete

◆ options()

const config & prefs::options ( )

◆ parse_should_show_lobby_join()

bool prefs::parse_should_show_lobby_join ( const std::string &  sender,
const std::string &  message 
)

◆ partial_color()

std::string prefs::partial_color ( )

◆ password()

std::string prefs::password ( const std::string &  server,
const std::string &  login 
)

◆ pixel_scale()

int prefs::pixel_scale ( )

◆ preferences_save()

static bool prefs::preferences_save ( )
inlinestatic

Definition at line 229 of file preferences.hpp.

References no_preferences_save.

◆ progress_achievement()

int prefs::progress_achievement ( const std::string &  content_for,
const std::string &  id,
int  limit = 999999,
int  max_progress = 999999,
int  amount = 0 
)

Increments the achievement's current progress by amount if it hasn't already been completed.

If you only want to check the achievement's current progress, then omit the last three arguments. amount defaults to 0, which will result in the current progress value being returned without being changed (x + 0 == x).

Note that this uses the same [in_progress] as is used for set_sub_achievement().

Parameters
content_forThe id of the achievement group this achievement is in.
idThe id for the specific achievement in the achievement group.
limitThe maximum value that a specific call to this function can increase the achievement progress value.
max_progressThe value when the achievement is considered completed.
amountThe amount to progress the achievement.
Returns
The achievement's current progress, or -1 if it has already been completed.

Definition at line 984 of file preferences.cpp.

References achievement(), config::add_child(), config::child_range(), id, and preferences_.

Referenced by game_lua_kernel::intf_progress_achievement().

◆ recent_files()

std::vector< std::string > prefs::recent_files ( )

Retrieves the list of recently opened files.

Definition at line 1205 of file preferences.cpp.

References do_read_editor_mru().

Referenced by editor::context_manager::expand_load_mru_menu(), and editor::context_manager::load_mru_item().

◆ reload_preferences()

void prefs::reload_preferences ( )

◆ remember_password()

bool prefs::remember_password ( )

◆ remove_acquaintance()

bool prefs::remove_acquaintance ( const std::string &  nick)

◆ resolution()

point prefs::resolution ( )

◆ sample_rate()

unsigned int prefs::sample_rate ( )

Definition at line 906 of file preferences.cpp.

References preferences_.

Referenced by save_sample_rate().

◆ save_compression_format()

compression::format prefs::save_compression_format ( )

Definition at line 1722 of file preferences.cpp.

References compression::bzip2, compression::gzip, compression::none, and preferences_.

Referenced by foreach_autosave().

◆ save_credentials()

void prefs::save_credentials ( )
private

◆ save_hotkeys()

void prefs::save_hotkeys ( )

Definition at line 883 of file preferences.cpp.

References preferences_, and hotkey::save_hotkeys().

Referenced by gui2::dialogs::preferences_dialog::post_show().

◆ save_sample_rate()

void prefs::save_sample_rate ( const unsigned int  rate)

Definition at line 911 of file preferences.cpp.

References preferences_, sound::reset_sound(), and sample_rate().

◆ save_sound_buffer_size()

void prefs::save_sound_buffer_size ( const std::size_t  size)

Definition at line 665 of file preferences.cpp.

References preferences_, sound::reset_sound(), and utf8::size().

◆ scroll_speed()

int prefs::scroll_speed ( )

◆ set_achievement()

void prefs::set_achievement ( const std::string &  content_for,
const std::string &  id 
)

Marks the specified achievement as completed.

Parameters
content_forThe achievement group the achievement is part of.
idThe ID of the achievement within the achievement group.

Definition at line 955 of file preferences.cpp.

References config::add_child(), config::child_range(), id, preferences_, and utils::split().

Referenced by game_lua_kernel::intf_set_achievement().

◆ set_addon_manager_saved_order_direction()

void prefs::set_addon_manager_saved_order_direction ( sort_order::type  value)

◆ set_allied_color()

void prefs::set_allied_color ( const std::string &  color_id)

◆ set_bell_volume()

void prefs::set_bell_volume ( int  vol)

◆ set_campaign_server()

void prefs::set_campaign_server ( const std::string &  host)

Definition at line 1560 of file preferences.cpp.

References preferences_.

◆ set_child()

void prefs::set_child ( const std::string &  key,
const config val 
)
private

◆ set_color_cursors()

void prefs::set_color_cursors ( bool  value)

Definition at line 1233 of file preferences.cpp.

References preferences_, and cursor::set().

◆ set_countdown_action_bonus()

void prefs::set_countdown_action_bonus ( int  value)

Definition at line 1646 of file preferences.cpp.

References preferences_.

◆ set_countdown_init_time()

void prefs::set_countdown_init_time ( int  value)

Definition at line 1601 of file preferences.cpp.

References preferences_.

◆ set_countdown_reservoir_time()

void prefs::set_countdown_reservoir_time ( int  value)

Definition at line 1616 of file preferences.cpp.

References preferences_.

◆ set_countdown_turn_bonus()

void prefs::set_countdown_turn_bonus ( int  value)

Definition at line 1631 of file preferences.cpp.

References preferences_.

◆ set_dir_bookmarks()

void prefs::set_dir_bookmarks ( const config cfg)

Definition at line 1136 of file preferences.cpp.

References set_child().

◆ set_enemy_color()

void prefs::set_enemy_color ( const std::string &  color_id)

◆ set_font_scaling()

void prefs::set_font_scaling ( int  scale)

◆ set_lobby_joins()

void prefs::set_lobby_joins ( pref_constants::lobby_joins  show)

◆ set_login()

void prefs::set_login ( const std::string &  login)

◆ set_message_private()

void prefs::set_message_private ( bool  value)

◆ set_modifications()

void prefs::set_modifications ( const std::vector< std::string > &  value,
bool  mp = true 
)

◆ set_moved_color()

void prefs::set_moved_color ( const std::string &  color_id)

◆ set_mp_server_program_name()

void prefs::set_mp_server_program_name ( const std::string &  path)

◆ set_music()

bool prefs::set_music ( bool  ison)

◆ set_music_volume()

void prefs::set_music_volume ( int  vol)

◆ set_network_host()

void prefs::set_network_host ( const std::string &  host)

Definition at line 1546 of file preferences.cpp.

References preferences_.

Referenced by game_launcher::play_multiplayer().

◆ set_options()

void prefs::set_options ( const config values)

Definition at line 1590 of file preferences.cpp.

References options_initialized_, and set_child().

Referenced by ng::configure_engine::set_options().

◆ set_partial_color()

void prefs::set_partial_color ( const std::string &  color_id)

◆ set_password()

void prefs::set_password ( const std::string &  server,
const std::string &  login,
const std::string &  key 
)

◆ set_pixel_scale()

void prefs::set_pixel_scale ( const int  scale)

◆ set_remember_password()

void prefs::set_remember_password ( bool  remember)

◆ set_resolution()

void prefs::set_resolution ( const point res)

Definition at line 595 of file preferences.cpp.

References preferences_.

Referenced by game_launcher::game_launcher(), events::pump(), and video::set_resolution().

◆ set_scroll_speed()

void prefs::set_scroll_speed ( const int  scroll)

Definition at line 853 of file preferences.cpp.

References preferences_.

Referenced by gui2::dialogs::preferences_dialog::initialize_callbacks().

◆ set_show_fps()

void prefs::set_show_fps ( bool  value)

Definition at line 873 of file preferences.cpp.

References fps_.

Referenced by events::console_handler::do_fps(), and game_launcher::game_launcher().

◆ set_show_standing_animations()

void prefs::set_show_standing_animations ( bool  value)

◆ set_sound()

bool prefs::set_sound ( bool  ison)

◆ set_sound_volume()

void prefs::set_sound_volume ( int  vol)

◆ set_sub_achievement()

void prefs::set_sub_achievement ( const std::string &  content_for,
const std::string &  id,
const std::string &  sub_id 
)

Marks the specified sub-achievement as completed.

Note that this uses the same [in_progress] as is used for progress_achievement().

Parameters
content_forThe achievement group the achievement is part of.
idThe ID of the achievement within the achievement group.
sub_idThe ID of the sub-achievement within the achievement.

Definition at line 1071 of file preferences.cpp.

References achievement(), config::add_child(), config::child_range(), id, preferences_, and utils::split().

Referenced by game_lua_kernel::intf_set_sub_achievement().

◆ set_theme()

void prefs::set_theme ( const std::string &  theme)

◆ set_turbo()

void prefs::set_turbo ( bool  ison)

◆ set_turn_bell()

bool prefs::set_turn_bell ( bool  ison)

◆ set_ui_sound()

bool prefs::set_ui_sound ( bool  ison)

◆ set_ui_volume()

void prefs::set_ui_volume ( int  vol)

◆ set_unmoved_color()

void prefs::set_unmoved_color ( const std::string &  color_id)

◆ set_user_servers_list()

void prefs::set_user_servers_list ( const std::vector< game_config::server_info > &  value)

◆ set_village_gold()

void prefs::set_village_gold ( int  value)

Definition at line 1661 of file preferences.cpp.

References preferences_.

◆ set_village_support()

void prefs::set_village_support ( int  value)

Definition at line 1671 of file preferences.cpp.

References preferences_.

◆ set_xp_modifier()

void prefs::set_xp_modifier ( int  value)

Definition at line 1681 of file preferences.cpp.

References preferences_.

◆ show_combat()

bool prefs::show_combat ( )

◆ show_fps()

bool prefs::show_fps ( )

Definition at line 868 of file preferences.cpp.

References fps_.

◆ show_standing_animations()

bool prefs::show_standing_animations ( )

Definition at line 1240 of file preferences.cpp.

References preferences_.

Referenced by gui2::dialogs::preferences_dialog::initialize_callbacks().

◆ show_theme_dialog()

bool prefs::show_theme_dialog ( )

◆ show_wesnothd_server_search()

void prefs::show_wesnothd_server_search ( )

◆ sound()

bool prefs::sound ( )

◆ sound_buffer_size()

std::size_t prefs::sound_buffer_size ( )

Definition at line 652 of file preferences.cpp.

References preferences_.

Referenced by sound::driver_status::query().

◆ sound_volume()

int prefs::sound_volume ( )

◆ sub_achievement()

bool prefs::sub_achievement ( const std::string &  content_for,
const std::string &  id,
const std::string &  sub_id 
)
Parameters
content_forThe achievement group the achievement is part of.
idThe ID of the achievement within the achievement group.
sub_idThe ID of the sub-achievement within the achievement.
Returns
True if the sub-achievement exists and is completed, false otherwise.

Definition at line 1045 of file preferences.cpp.

References achievement(), config::child_range(), preferences_, and utils::split().

◆ theme()

std::string prefs::theme ( )

Definition at line 1314 of file preferences.cpp.

References video::headless(), and preferences_.

Referenced by set_theme(), and show_theme_dialog().

◆ turbo()

bool prefs::turbo ( )

◆ turn_bell()

bool prefs::turn_bell ( )

◆ ui_sound_on()

bool prefs::ui_sound_on ( )

◆ ui_volume()

int prefs::ui_volume ( )

◆ unescape()

preferences::secure_buffer prefs::unescape ( const preferences::secure_buffer text)
private

Definition at line 2082 of file preferences.cpp.

References c.

Referenced by load_credentials().

◆ unmoved_color()

std::string prefs::unmoved_color ( )

◆ use_color_cursors()

bool prefs::use_color_cursors ( )

Definition at line 1228 of file preferences.cpp.

References preferences_.

◆ use_twelve_hour_clock_format()

bool prefs::use_twelve_hour_clock_format ( )

◆ user_servers_list()

std::vector< game_config::server_info > prefs::user_servers_list ( )

Definition at line 1512 of file preferences.cpp.

References config::child_range(), and preferences_.

◆ village_gold()

int prefs::village_gold ( )

◆ village_support()

int prefs::village_support ( )

◆ write_preferences()

void prefs::write_preferences ( )

◆ xp_modifier()

int prefs::xp_modifier ( )

◆ yellow_confirm()

bool prefs::yellow_confirm ( )

Definition at line 1782 of file preferences.cpp.

References preferences_.

Friends And Related Function Documentation

◆ impl_preferences_get

int impl_preferences_get ( lua_State *  L)
friend

The __index metamethod.

Parameter 1: the preference table. Parameter 2: preference name, must be a string. Returns: preference value. If there isn't such a preference, returns nil.

Definition at line 29 of file lua_preferences.cpp.

◆ impl_preferences_set

int impl_preferences_set ( lua_State *  L)
friend

The __newindex metamethod.

Parameter 1: the preference table. Parameter 2: preference name, must be a string. Parameter 3: preference value. Returns nothing.

Definition at line 43 of file lua_preferences.cpp.

◆ preferences_dialog_friend

friend struct preferences_dialog_friend
friend

Definition at line 194 of file preferences.hpp.

Member Data Documentation

◆ acquaintances_

std::map<std::string, preferences::acquaintance> prefs::acquaintances_
private

◆ advanced_prefs_

std::vector<preferences::option> prefs::advanced_prefs_
private

Definition at line 621 of file preferences.hpp.

Referenced by get_advanced_preferences(), and load_advanced_prefs().

◆ completed_campaigns_

std::map<std::string, std::set<std::string> > prefs::completed_campaigns_
private

◆ credentials_

std::vector<preferences::login_info> prefs::credentials_
private

◆ encountered_terrains_set_

std::set<t_translation::terrain_code> prefs::encountered_terrains_set_
private

Definition at line 610 of file preferences.hpp.

Referenced by encountered_terrains(), load_preferences(), and ~prefs().

◆ encountered_units_set_

std::set<std::string> prefs::encountered_units_set_
private

◆ fps_

bool prefs::fps_
private

Definition at line 607 of file preferences.hpp.

Referenced by set_show_fps(), and show_fps().

◆ history_map_

std::map<std::string, std::vector<std::string> > prefs::history_map_
private

Definition at line 611 of file preferences.hpp.

Referenced by get_history(), load_preferences(), and ~prefs().

◆ message_private_on_

bool prefs::message_private_on_
private

Definition at line 619 of file preferences.hpp.

Referenced by message_private(), and set_message_private().

◆ mp_modifications_

std::vector<std::string> prefs::mp_modifications_
private

Definition at line 615 of file preferences.hpp.

Referenced by modifications().

◆ mp_modifications_initialized_

bool prefs::mp_modifications_initialized_
private

Definition at line 616 of file preferences.hpp.

Referenced by modifications(), and set_modifications().

◆ no_preferences_save

bool prefs::no_preferences_save = false
inlinestaticprivate

Definition at line 604 of file preferences.hpp.

Referenced by disable_preferences_save(), preferences_save(), and ~prefs().

◆ option_values_

config prefs::option_values_
private

Definition at line 613 of file preferences.hpp.

Referenced by options().

◆ options_initialized_

bool prefs::options_initialized_
private

Definition at line 614 of file preferences.hpp.

Referenced by options(), and set_options().

◆ preferences_

config prefs::preferences_
private

Definition at line 606 of file preferences.hpp.

Referenced by achievement(), add_alias(), addon_manager_saved_order_direction(), all_attributes(), allied_color(), auto_open_whisper_windows(), bell_volume(), campaign_server(), clear_countdown_action_bonus(), clear_countdown_init_time(), clear_countdown_reservoir_time(), clear_countdown_turn_bonus(), clear_hotkeys(), clear_mp_alert_prefs(), clear_preferences(), confirm_load_save_from_different_version(), confirm_no_moves(), countdown_action_bonus(), countdown_init_time(), countdown_reservoir_time(), countdown_turn_bonus(), editor_mru_limit(), enemy_color(), font_scaling(), get(), preferences_dialog_friend::get(), get_as_attribute(), get_child(), get_lobby_joins(), get_mp_server_program_name(), get_scroll_when_mouse_outside(), get_show_deprecation(), green_confirm(), keepalive_timeout(), load_hotkeys(), load_preferences(), message_bell(), middle_click_scrolls(), migrate_preferences(), modifications(), mouse_scroll_threshold(), moved_color(), music_on(), music_volume(), network_host(), partial_color(), pixel_scale(), prefs(), progress_achievement(), remember_password(), resolution(), sample_rate(), save_compression_format(), save_hotkeys(), save_sample_rate(), save_sound_buffer_size(), scroll_speed(), preferences_dialog_friend::set(), set_achievement(), set_addon_manager_saved_order_direction(), set_allied_color(), set_bell_volume(), set_campaign_server(), set_child(), set_color_cursors(), set_countdown_action_bonus(), set_countdown_init_time(), set_countdown_reservoir_time(), set_countdown_turn_bonus(), set_enemy_color(), set_font_scaling(), set_lobby_joins(), set_login(), set_modifications(), set_moved_color(), set_mp_server_program_name(), set_music(), set_music_volume(), set_network_host(), set_partial_color(), set_pixel_scale(), set_remember_password(), set_resolution(), set_scroll_speed(), set_show_standing_animations(), set_sound(), set_sound_volume(), set_sub_achievement(), set_theme(), set_turbo(), set_turn_bell(), set_ui_sound(), set_ui_volume(), set_unmoved_color(), set_user_servers_list(), set_village_gold(), set_village_support(), set_xp_modifier(), show_combat(), show_standing_animations(), sound(), sound_buffer_size(), sound_volume(), sub_achievement(), theme(), turbo(), turn_bell(), ui_sound_on(), ui_volume(), unmoved_color(), use_color_cursors(), use_twelve_hour_clock_format(), user_servers_list(), village_gold(), village_support(), write_preferences(), xp_modifier(), yellow_confirm(), and ~prefs().

◆ sp_modifications_

std::vector<std::string> prefs::sp_modifications_
private

Definition at line 617 of file preferences.hpp.

Referenced by modifications().

◆ sp_modifications_initialized_

bool prefs::sp_modifications_initialized_
private

Definition at line 618 of file preferences.hpp.

Referenced by modifications(), and set_modifications().

◆ synced_attributes_

constexpr std::array prefs::synced_attributes_
staticconstexprprivate

Definition at line 669 of file preferences.hpp.

Referenced by load_preferences(), and write_preferences().

◆ synced_children_

constexpr std::array prefs::synced_children_
staticconstexprprivate
Initial value:
{
prefs_list::achievements,
prefs_list::completed_campaigns,
prefs_list::history,
prefs_list::options,
}

Definition at line 813 of file preferences.hpp.

Referenced by load_preferences(), and write_preferences().

◆ unknown_synced_attributes_

std::set<std::string> prefs::unknown_synced_attributes_
private

Definition at line 663 of file preferences.hpp.

Referenced by load_preferences(), and write_preferences().

◆ unknown_synced_children_

std::set<std::string> prefs::unknown_synced_children_
private

Definition at line 665 of file preferences.hpp.

Referenced by load_preferences(), and write_preferences().

◆ unknown_unsynced_attributes_

std::set<std::string> prefs::unknown_unsynced_attributes_
private

Definition at line 664 of file preferences.hpp.

Referenced by load_preferences(), and write_preferences().

◆ unknown_unsynced_children_

std::set<std::string> prefs::unknown_unsynced_children_
private

Definition at line 666 of file preferences.hpp.

Referenced by load_preferences(), and write_preferences().

◆ unsynced_attributes_

constexpr std::array prefs::unsynced_attributes_
staticconstexprprivate
Initial value:
{
prefs_list::auto_pixel_scale,
prefs_list::core,
prefs_list::draw_delay,
prefs_list::editor_chosen_addon,
prefs_list::gui2_theme,
prefs_list::mp_server_program_name,
prefs_list::pixel_scale,
prefs_list::sound_buffer_size,
prefs_list::theme,
prefs_list::vsync,
prefs_list::xresolution,
prefs_list::yresolution,
prefs_list::font_scale,
prefs_list::fullscreen,
prefs_list::maximized,
}
unsigned int tile_size
Definition: game_config.cpp:52
static int bell_volume()
static int music_volume()
static int ui_volume()
static int sound_volume()

Definition at line 819 of file preferences.hpp.

Referenced by load_preferences(), and write_preferences().

◆ unsynced_children_

constexpr std::array prefs::unsynced_children_
staticconstexprprivate
Initial value:
{
prefs_list::editor_recent_files,
prefs_list::dir_bookmarks,
}

Definition at line 841 of file preferences.hpp.

Referenced by load_preferences(), and write_preferences().


The documentation for this class was generated from the following files: