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