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