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