supertux
gameconfig.hpp
1 // SuperTux
2 // Copyright (C) 2006 Matthias Braun <matze@braunis.de>
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
16 
17 #ifndef HEADER_SUPERTUX_SUPERTUX_GAMECONFIG_HPP
18 #define HEADER_SUPERTUX_SUPERTUX_GAMECONFIG_HPP
19 
20 #include <optional>
21 
22 #include "control/joystick_config.hpp"
23 #include "control/keyboard_config.hpp"
24 #include "math/size.hpp"
25 #include "math/vector.hpp"
26 #include "video/drawing_context.hpp"
27 #include "video/video_system.hpp"
28 
29 class Config final
30 {
31 public:
32  Config();
33 
34  void load();
35  void save();
36 
37  void check_values();
38 
39 public:
40  int profile;
41 
44 
47 
50 
53 
56 
57 #ifdef __EMSCRIPTEN__
58 
59  bool fit_window;
60 #endif
61 
62  float magnification;
63 
64  bool use_fullscreen;
65  VideoSystem::Enum video;
66  int vsync;
67  bool frame_prediction;
68  bool show_fps;
69  bool show_player_pos;
70  bool show_controller;
71  float camera_peek_multiplier;
72  bool sound_enabled;
73  bool music_enabled;
74  int sound_volume;
75  int music_volume;
76  int flash_intensity;
77 
80 
81  bool enable_script_debugger;
82 
84  std::optional<Vector> tux_spawn_pos;
85 
89  std::string locale;
90 
91  KeyboardConfig keyboard_config;
92  JoystickConfig joystick_config;
93 
94  bool mobile_controls;
95  float m_mobile_controls_scale;
96 
97  struct Addon
98  {
99  std::string id;
100  bool enabled;
101  };
102  std::vector<Addon> addons;
103 
104  bool developer_mode;
105  bool christmas_mode;
106  bool transitions_enabled;
107  bool confirmation_dialog;
108  bool pause_on_focusloss;
109  bool custom_mouse_cursor;
110  bool do_release_check;
111  bool custom_title_levels;
112 
113 #ifdef ENABLE_DISCORD
114  bool enable_discord;
115 #endif
116  bool hide_editor_levelnames;
117 
119  {
120  std::string id;
121  bool disabled;
122  };
123  std::vector<Notification> notifications;
124 
125  Color menubackcolor;
126  Color menufrontcolor;
127  Color menuhelpbackcolor;
128  Color menuhelpfrontcolor;
129  Color labeltextcolor;
130  Color activetextcolor;
131  Color hlcolor;
132  Color editorcolor;
133  Color editorhovercolor;
134  Color editorgrabcolor;
135  float menuroundness;
136 
137  int editor_selected_snap_grid_size;
138  bool editor_render_grid;
139  bool editor_snap_to_grid;
140  bool editor_render_background;
141  bool editor_render_lighting;
142  bool editor_autotile_mode;
143  bool editor_autotile_help;
144  int editor_autosave_frequency;
145  bool editor_undo_tracking;
146  int editor_undo_stack_size;
147  bool editor_show_deprecated_tiles;
148 
149  bool multiplayer_auto_manage_players;
150  bool multiplayer_multibind;
151  bool multiplayer_buzz_controllers;
152 
153  std::string repository_url;
154 
155  bool is_christmas() const;
156 };
157 
158 #endif
159 
160 /* EOF */
int fullscreen_refresh_rate
refresh rate for use in fullscreen, 0 for auto
Definition: gameconfig.hpp:46
int random_seed
initial random seed.
Definition: gameconfig.hpp:79
bool window_resizable
Window is resizable.
Definition: gameconfig.hpp:52
Definition: gameconfig.hpp:29
Size aspect_size
the aspect ratio
Definition: gameconfig.hpp:55
std::optional< Vector > tux_spawn_pos
this variable is set if tux should spawn somewhere which isn&#39;t the "main" spawn point ...
Definition: gameconfig.hpp:84
Definition: size.hpp:24
Definition: gameconfig.hpp:118
Definition: gameconfig.hpp:97
Definition: joystick_config.hpp:28
Definition: keyboard_config.hpp:29
Size window_size
the width/height of the window managers window
Definition: gameconfig.hpp:49
Definition: color.hpp:26
std::string locale
force SuperTux language to this locale, e.g.
Definition: gameconfig.hpp:89
Size fullscreen_size
the width/height to be used to display the game in fullscreen
Definition: gameconfig.hpp:43