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