The Battle for Wesnoth  1.19.13+dev
preferences_list.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2024 - 2025
3  Part of the Battle for Wesnoth Project https://www.wesnoth.org/
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY.
11 
12  See the COPYING file for more details.
13 */
14 
15 #pragma once
16 
17 #include "enum_base.hpp"
18 
19 #define ADDPREF(pref) static constexpr const char* const pref = #pref;
20 
21 /**
22  * Contains all valid preferences attributes.
23  */
25 {
26  //
27  // regular preferences
28  //
29  /** wesnoth version string when cache files were last deleted */
30  ADDPREF(_last_cache_cleaned_ver)
31  /** achievements completed for add-ons/UMC, are not steam achievements */
33  /** player names marked as either friends or as ignored */
34  ADDPREF(acquaintance)
35  /** whether to get the add-on icons when downloading the add-ons list */
36  ADDPREF(addon_icons)
37  /** the sort direction, ie: ascending */
38  ADDPREF(addon_manager_saved_order_direction)
39  /** the name of the column in the add-ons manager to use by default to sort results */
40  ADDPREF(addon_manager_saved_order_name)
41  /** set an alternate way to call a command, similar to linux terminal command aliases */
42  ADDPREF(alias)
43  /** whether a game should allow observers */
44  ADDPREF(allow_observers)
45  /** the orb color above allied units */
47  /** whether to stop movement of a unit when an allied unit comes into sight range */
48  ADDPREF(ally_sighted_interrupts)
49  /** whether to display animations on terrain (ie: windmill) */
50  ADDPREF(animate_map)
51  /** whether to animate water terrain */
52  ADDPREF(animate_water)
53  /** whether to automatically set the pixel scale multiplier based on the current window size */
54  ADDPREF(auto_pixel_scale)
55  /** the maximum number of autosaves to keep before deleting old ones */
56  ADDPREF(auto_save_max)
57  /** how loud the turn bell sound is */
59  /** whether to show the map before being given a side in online multiplayer */
60  ADDPREF(blindfold_replay)
61  /** the add-ons server name, ie: add-ons.wesnoth.org */
62  ADDPREF(campaign_server)
63  /** the number of lines of chat to display in-game */
64  ADDPREF(chat_lines)
65  /** whether to show a timestamp in in-game chat messages */
66  ADDPREF(chat_timestamp)
67  /** child tag name for completed campaign information */
68  ADDPREF(completed_campaigns)
69  /** whether to confirm ending your turn when units can still take action */
70  ADDPREF(confirm_end_turn)
71  /** the current core to use */
72  ADDPREF(core)
73  /**
74  * creates a single command composed of one or more other commands
75  * format - :custom show_terrain_codes;show_num_of_bitmaps
76  */
77  ADDPREF(custom_command)
78  /** whether to show a confirmation dialog when deleting a save */
79  ADDPREF(delete_saves)
80  /** additional folders shown when using the file selection dialog */
81  ADDPREF(dir_bookmarks)
82  /** whether to automatically move units that were previously told to move towards hexes more than one turn away */
83  ADDPREF(disable_auto_moves)
84  /** maximum FPS, if set, at which to refresh the screen */
85  ADDPREF(refresh_rate)
86  /** whether to have the editor automatically update terrain transitions when placing terrain immediately, after the mouse click is released, or not at all */
87  ADDPREF(editor_auto_update_transitions)
88  /** the current add-on being used in the editor */
89  ADDPREF(editor_chosen_addon)
90  /** whether to draw the x,y map coordinates in the editor */
91  ADDPREF(editor_draw_hex_coordinates)
92  /** number of images used to draw the hex */
93  ADDPREF(editor_draw_num_of_bitmaps)
94  /** whether to draw terrain codes on hexes in the editor */
95  ADDPREF(editor_draw_terrain_codes)
96  /** list of recently accessed files in the editor */
97  ADDPREF(editor_recent_files)
98  /** whether to display the active tool information help text at the bottom/top of the editor */
99  ADDPREF(editor_help_text_shown)
100  /** whether to automatically start in planning mode in-game */
101  ADDPREF(enable_planning_mode_on_start)
102  /** list of terrain seen so far */
103  ADDPREF(encountered_terrain_list)
104  /** list of units seen so far */
105  ADDPREF(encountered_units)
106  /** the color of the orb over enemy units */
108  /** in the multiplayer lobby, show games with blocked players in them */
109  ADDPREF(fi_blocked_in_game)
110  /** in the multiplayer lobby, show games with friends in them */
111  ADDPREF(fi_friends_in_game)
112  /** in the multiplayer lobby, invert all other filters */
113  ADDPREF(fi_invert)
114  /** in the multiplayer lobby, show games with vacant slots */
115  ADDPREF(fi_vacant_slots)
116  /** whether to show floating labels on the game map */
117  ADDPREF(floating_labels)
118  /** whether to use fullscreen mode */
119  ADDPREF(fullscreen)
120  /** saved options for game creation */
121  ADDPREF(game_preset)
122  /** whether to show a hex grid overlay on the map */
123  ADDPREF(grid)
124  /** the gui2 theme name */
125  ADDPREF(gui2_theme)
126  /** whether to show teammate's whiteboard plans on the game map */
127  ADDPREF(hide_whiteboard)
128  /** list of lines of text entered into textboxes that support keeping a history */
129  ADDPREF(history)
130  /** the most recent multiplayer server hostname */
131  ADDPREF(host)
132  /** whether to play idle animations */
133  ADDPREF(idle_anim)
134  /** how frequently to play idle animations */
135  ADDPREF(idle_anim_rate)
136  /** who to show notifications about when they join the multiplayer lobby */
138  /** whether to only accept whisper messages from friends */
139  ADDPREF(lobby_whisper_friends_only)
140  /** player chosen language to use */
141  ADDPREF(locale)
142  /** most recently use username for logging into the multiplayer server */
143  ADDPREF(login)
144  /** whether the window is maximized */
145  ADDPREF(maximized)
146  /** whether to play a sound when receiving a message */
147  ADDPREF(message_bell)
148  /** whether to draw terrain in the in-game minimap */
149  ADDPREF(minimap_draw_terrain)
150  /** whether to draw units on in-game/editor minimap */
151  ADDPREF(minimap_draw_units)
152  /** whether to draw villages on the in-game/editor minimap */
153  ADDPREF(minimap_draw_villages)
154  /**
155  * on the in-game minimap/editor minimap use a color for your side, a color for all allied sides, and a color for all enemy sides
156  * doesn't actually have anything to do with movement
157  */
158  ADDPREF(minimap_movement_coding)
159  /** simplified color coding by terrain type in the in-game minimap/editor */
160  ADDPREF(minimap_terrain_coding)
161  /** the color of the orb above a unit that can no longer move */
163  /** whether to enable the turn timer in multiplayer */
164  ADDPREF(mp_countdown)
165  /** seconds to add to the multiplayer turn timer when an action is taken */
166  ADDPREF(mp_countdown_action_bonus)
167  /** seconds for the multiplayer turn timer for each player's first turn */
168  ADDPREF(mp_countdown_init_time)
169  /** maximum seconds the multiplayer turn timer can have for a single turn */
170  ADDPREF(mp_countdown_reservoir_time)
171  /** bonus seconds for the multiplayer turn timer for turns after turn 1 */
172  ADDPREF(mp_countdown_turn_bonus)
173  /** the most recently played era in multiplayer */
174  ADDPREF(mp_era)
175  /** whether to enable fog in multiplayer games */
176  ADDPREF(mp_fog)
177  /** the id of the most recently played multiplayer scenario */
178  ADDPREF(mp_level)
179  /** most recently selected type of game: scenario, campaign, random map, etc */
180  ADDPREF(mp_level_type)
181  /** most recently selected mp playing mode/connection type */
182  ADDPREF(mp_connect_type)
183  /** list of the last selected multiplayer modifications */
184  ADDPREF(mp_modifications)
185  /** whether to use a random start time for the scenario */
186  ADDPREF(mp_random_start_time)
187  /** the name of the wesnothd executable */
188  ADDPREF(mp_server_program_name)
189  /** whether to show a warning dialog about starting wesnothd in the background when hosting LAN games */
190  ADDPREF(mp_server_warning_disabled)
191  /** whether to enable shroud in multiplayer games */
192  ADDPREF(mp_shroud)
193  /** the turn limit for multiplayer games */
194  ADDPREF(mp_turns)
195  /** whether to use the scenario's default settings */
196  ADDPREF(mp_use_map_settings)
197  /** the amount of gold each village gives */
198  ADDPREF(mp_village_gold)
199  /** the amount of unit upkeep each village offsets */
200  ADDPREF(mp_village_support)
201  /** the multiplier to apply to all units in a multiplayer game */
202  ADDPREF(mp_xp_modifier)
203  /** whether music is enabled */
204  ADDPREF(music)
205  /** the music's volume */
207  /** custom multiplayer scenario options */
208  ADDPREF(options)
209  /** the orb above units with that can still take some actions */
211  /** the pixel scale multiplier to apply */
212  ADDPREF(pixel_scale)
213  /** whether to allow any type of mirrors in a multiplayer scenario */
215  /** whether to remember passwords typed into password fields */
216  ADDPREF(remember_password)
217  /** audio sample rate */
218  ADDPREF(sample_rate)
219  /** whether to save replays of games */
220  ADDPREF(save_replays)
221  /** the scroll speed */
222  ADDPREF(scroll)
223  /** how close the mouse needs to get to the edge of the screen to start scrolling */
224  ADDPREF(scroll_threshold)
225  /** the most recently selected achievement group in the achievements dialog */
226  ADDPREF(selected_achievement_group)
227  /** contains the list of any player-entered multiplayer servers */
228  ADDPREF(server)
229  /** whether to show an orb over allied units */
231  /** whether to show an orb over disengaged units */
233  /** whether to show an orb over enemy units */
235  /** whether to show an orb over units that have used all their actions */
237  /** whether to show an orb over units that have only use some of their actions */
239  /** whether to show the team colored circle under units */
240  ADDPREF(show_side_colors)
241  /** whether to show unit status (moved, unmoved, etc) for allied units as well */
243  /** whether to show the tips panel on titlescreen */
244  ADDPREF(show_tips)
245  /** whether to show an orb over units that haven't done anything */
247  /** whether to randomly assign sides in multiplayer games */
248  ADDPREF(shuffle_sides)
249  /** whether to skip move animations for AI actions */
250  ADDPREF(skip_ai_moves)
251  /** whether to skip animation of all actions when joining an in-progress multiplayer game */
252  ADDPREF(skip_mp_replay)
253  /** whether to play non-UI sounds */
254  ADDPREF(sound)
255  /** audio buffer size */
256  ADDPREF(sound_buffer_size)
257  /** the volume for playing sounds */
259  /** list of the last selected single player modifications */
260  ADDPREF(sp_modifications)
261  /** whether to continue playing music when wesnoth isn't the focused window */
262  ADDPREF(stop_music_in_background)
263  /** the ThemeWML theme */
264  ADDPREF(theme)
265  /** hex size used to determine zoom level */
267  /** whether to enable accelerated animation speed */
268  ADDPREF(turbo)
269  /** how much to accelerate animation speed */
270  ADDPREF(turbo_speed)
271  /** whether to play a sound when it's your turn */
273  /** whether to show a dialog and add a blindfold between turns */
274  ADDPREF(turn_dialog)
275  /** whether to play sounds when clicking UI elements */
276  ADDPREF(ui_sound)
277  /** how loud to make the sound when clicking UI elements */
279  /** whether to show standing animations */
280  ADDPREF(unit_standing_animations)
281  /** the color of the orb over units that haven't done anything */
283  /** whether to lock the FPS to the screen refresh rate */
284  ADDPREF(vsync)
285  /** width of the wesnoth window */
286  ADDPREF(xresolution)
287  /** height of the wesnoth window */
288  ADDPREF(yresolution)
289  //
290  // MP alert preferences
291  // Note, this list of items must match those ids defined in data/gui/dialogs/mp_alerts_options.cfg
292  //
293  /** whether to play a sound when a player joins the game you're in */
294  ADDPREF(player_joins_sound)
295  /** whether to show a notification when a player joins the game you're in */
296  ADDPREF(player_joins_notif)
297  /** whether to show the enabled player join sound or notification in the lobby as well */
298  ADDPREF(player_joins_lobby)
299  /** whether to play a sound when a player leaves the game you're in */
300  ADDPREF(player_leaves_sound)
301  /** whether to show a notification when a player leaves the game you're in */
302  ADDPREF(player_leaves_notif)
303  /** whether to show the enabled player leave sound or notification in the lobby as well */
304  ADDPREF(player_leaves_lobby)
305  /** whether to play a sound when receiving a private message aka whisper */
306  ADDPREF(private_message_sound)
307  /** whether to show a notification when receiving a private message aka whisper */
308  ADDPREF(private_message_notif)
309  /** whether to show the enabled private message aka whisper join sound or notification in the lobby as well */
310  ADDPREF(private_message_lobby)
311  /** whether to play a sound when a friend messages you while in game */
312  ADDPREF(friend_message_sound)
313  /** whether to show a notification when a friend messages you while in game */
314  ADDPREF(friend_message_notif)
315  /** whether to show the enabled friend message sound or notification in the lobby as well */
316  ADDPREF(friend_message_lobby)
317  /** whether to play a sound when a public message is sent */
318  ADDPREF(public_message_sound)
319  /** whether to show a notification when a public message is sent */
320  ADDPREF(public_message_notif)
321  /** whether to show the enabled public message sound or notification in the lobby as well */
322  ADDPREF(public_message_lobby)
323  /** whether to play a sound when a server message is sent */
324  ADDPREF(server_message_sound)
325  /** whether to show a notification when a server message is sent */
326  ADDPREF(server_message_notif)
327  /** whether to show the enabled server message sound or notification in the lobby as well */
328  ADDPREF(server_message_lobby)
329  /** opacity of the reach map border, 100 being 100% of the original image opacity, 0 being invisible */
331  /** the color of the reach map */
333  /** the color of tile borders of the reach map that are next to an enemy */
335  /** opacity of the reach map tint, 100 being 100% of the original image opacity, 0 being invisible */
337  /** whether to play a sound when the game is ready to be started */
338  ADDPREF(ready_for_start_sound)
339  /** whether to show a notification when the game is ready to be started */
340  ADDPREF(ready_for_start_notif)
341  /** used to make a UI element invisible in the mp alerts options dialog */
342  ADDPREF(ready_for_start_lobby)
343  /** whether to play a sound when the game has started */
344  ADDPREF(game_has_begun_sound)
345  /** whether to show a notification when the game has started */
346  ADDPREF(game_has_begun_notif)
347  /** used to make a UI element invisible in the mp alerts options dialog */
348  ADDPREF(game_has_begun_lobby)
349  /** used to make a UI element invisible in the mp alerts options dialog */
350  ADDPREF(turn_changed_sound)
351  /** whether to show a notification when the turn changes */
352  ADDPREF(turn_changed_notif)
353  /** used to make a UI element invisible in the mp alerts options dialog */
354  ADDPREF(turn_changed_lobby)
355  /** whether to play a sound when a new game is created */
356  ADDPREF(game_created_sound)
357  /** whether to show a notification when a new game is created */
358  ADDPREF(game_created_notif)
359  /** whether to show the new game creation message sound or notification in the lobby as well */
360  ADDPREF(game_created_lobby)
361 
362  //
363  // advanced preferences
364  // these are also set via the preferences dialog without using their explicit setter methods
365  //
366  /** whether to show a confirmation dialog for deleting save files */
367  ADDPREF(ask_delete)
368  /** how many minutes to wait before removing chat messages */
369  ADDPREF(chat_message_aging)
370  /** whether to use a color cursor */
371  ADDPREF(color_cursors)
372  /** what compression to use for save files, if any */
373  ADDPREF(compress_saves)
374  /** whether to ask for confirmation when loading a save from a different version of wesnoth */
375  ADDPREF(confirm_load_save_from_different_version)
376  /** whether to use monte carlo instead of exact calculations for fight outcomes */
377  ADDPREF(damage_prediction_allow_monte_carlo_simulation)
378  /** how many recent files to keep a list of */
379  ADDPREF(editor_max_recent_files)
380  /** additional scaling for text on top of the pixel scale multiplier */
381  ADDPREF(font_scale)
382  /** how long to wait before assuming a connection to the multiplayer server has been lost */
383  ADDPREF(keepalive_timeout)
384  /** whether to open a new chat tab in the multiplayer lobby after sending a whisper */
385  ADDPREF(lobby_auto_open_whisper_windows)
386  /** whether holding middle click and moving the mouse will scroll around the map */
387  ADDPREF(middle_click_scrolls)
388  /** whether moving the mouse to the sides of the window scrolls around the map */
389  ADDPREF(mouse_scrolling)
390  /** whether to scroll to a unit when an action is taken */
391  ADDPREF(scroll_to_action)
392  /** keep scrolling when the mouse moves outside the wesnoth window */
393  ADDPREF(scroll_when_mouse_outside)
394  /** whether to show all units in the help rather than only the units encountered so far */
395  ADDPREF(show_all_units_in_help)
396  /** whether to show combat animations */
397  ADDPREF(show_combat)
398  /** whether to show deprecation warnings for WML, lua, etc APIs */
399  ADDPREF(show_deprecation)
400  /** whether to show an indicator above defenders when an attack misses */
401  ADDPREF(show_attack_miss_indicator)
402  /** whether to use a 12 hour vs 24 hours clock in various places on the UI */
403  ADDPREF(use_twelve_hour_clock_format)
404 
406  _last_cache_cleaned_ver,
407  achievements,
408  acquaintance,
409  addon_manager_saved_order_direction,
410  addon_manager_saved_order_name,
411  alias,
412  allow_observers,
414  ally_sighted_interrupts,
415  animate_map,
416  animate_water,
417  auto_pixel_scale,
418  auto_save_max,
419  bell_volume,
420  blindfold_replay,
421  campaign_server,
422  chat_lines,
423  chat_timestamp,
424  completed_campaigns,
425  confirm_end_turn,
426  core,
427  custom_command,
428  delete_saves,
429  dir_bookmarks,
430  disable_auto_moves,
431  refresh_rate,
432  editor_auto_update_transitions,
433  editor_chosen_addon,
434  editor_draw_hex_coordinates,
435  editor_draw_num_of_bitmaps,
436  editor_draw_terrain_codes,
437  editor_recent_files,
438  enable_planning_mode_on_start,
439  encountered_terrain_list,
440  encountered_units,
442  fi_blocked_in_game,
443  fi_friends_in_game,
444  fi_invert,
445  fi_vacant_slots,
446  floating_labels,
447  fullscreen,
448  game_preset,
449  grid,
450  gui2_theme,
451  hide_whiteboard,
452  history,
453  host,
454  idle_anim,
455  idle_anim_rate,
456  lobby_joins,
457  lobby_whisper_friends_only,
458  locale,
459  login,
460  maximized,
461  message_bell,
462  minimap_draw_terrain,
463  minimap_draw_units,
464  minimap_draw_villages,
465  minimap_movement_coding,
466  minimap_terrain_coding,
468  mp_connect_type,
469  mp_countdown,
470  mp_countdown_action_bonus,
471  mp_countdown_init_time,
472  mp_countdown_reservoir_time,
473  mp_countdown_turn_bonus,
474  mp_era,
475  mp_fog,
476  mp_level,
477  mp_level_type,
478  mp_modifications,
479  mp_random_start_time,
480  mp_server_program_name,
481  mp_server_warning_disabled,
482  mp_shroud,
483  mp_turns,
484  mp_use_map_settings,
485  mp_village_gold,
486  mp_village_support,
487  mp_xp_modifier,
488  music,
489  music_volume,
490  options,
492  pixel_scale,
494  remember_password,
495  sample_rate,
496  save_replays,
497  scroll,
498  scroll_threshold,
499  selected_achievement_group,
500  server,
506  show_side_colors,
508  show_tips,
510  shuffle_sides,
511  skip_ai_moves,
512  skip_mp_replay,
513  sound,
514  sound_buffer_size,
515  sound_volume,
516  sp_modifications,
517  stop_music_in_background,
518  theme,
519  tile_size,
520  turbo,
521  turbo_speed,
522  turn_bell,
523  turn_dialog,
524  ui_sound,
525  ui_volume,
526  unit_standing_animations,
528  vsync,
529  xresolution,
530  yresolution,
531  ask_delete,
532  chat_message_aging,
533  color_cursors,
534  compress_saves,
535  confirm_load_save_from_different_version,
536  damage_prediction_allow_monte_carlo_simulation,
537  editor_max_recent_files,
538  font_scale,
539  keepalive_timeout,
540  lobby_auto_open_whisper_windows,
541  middle_click_scrolls,
542  mouse_scrolling,
543  scroll_to_action,
544  scroll_when_mouse_outside,
545  show_all_units_in_help,
546  show_combat,
547  show_deprecation,
548  show_attack_miss_indicator,
549  use_twelve_hour_clock_format,
550  player_joins_sound,
551  player_joins_notif,
552  player_joins_lobby,
553  player_leaves_sound,
554  player_leaves_notif,
555  player_leaves_lobby,
556  private_message_sound,
557  private_message_notif,
558  private_message_lobby,
559  friend_message_sound,
560  friend_message_notif,
561  friend_message_lobby,
562  public_message_sound,
563  public_message_notif,
564  public_message_lobby,
565  server_message_sound,
566  server_message_notif,
567  server_message_lobby,
568  ready_for_start_sound,
569  ready_for_start_notif,
570  ready_for_start_lobby,
571  game_has_begun_sound,
572  game_has_begun_notif,
573  game_has_begun_lobby,
574  turn_changed_sound,
575  turn_changed_notif,
576  turn_changed_lobby,
577  game_created_sound,
578  game_created_notif,
579  game_created_lobby,
580  addon_icons,
585  )
586 };
This class is responsible for reading all available achievements from mainline's and any add-ons' ach...
Definition: theme.hpp:43
#define ENUM_AND_ARRAY(...)
Definition: enum_base.hpp:96
std::string partial_orb_color
std::string reach_map_enemy_color
std::string moved_orb_color
std::string unmoved_orb_color
std::string ally_orb_color
std::string enemy_orb_color
std::string reach_map_color
std::string turn_bell
bool show_status_on_ally_orb
bool show_moved_orb
int reach_map_border_opacity
unsigned int tile_size
Definition: game_config.cpp:55
bool show_ally_orb
bool show_disengaged_orb
bool show_partial_orb
bool show_enemy_orb
bool show_unmoved_orb
int reach_map_tint_opacity
static int bell_volume()
static int music_volume()
static int ui_volume()
static int sound_volume()
Audio output for sound and music.
Definition: sound.cpp:38
#define ADDPREF(pref)
Contains all valid preferences attributes.
The base template for associating string values with enum values.
Definition: enum_base.hpp:33