-
Notifications
You must be signed in to change notification settings - Fork 71
Expand file tree
/
Copy pathoptions.h
More file actions
303 lines (232 loc) · 9.21 KB
/
options.h
File metadata and controls
303 lines (232 loc) · 9.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
#pragma once
#include "datatypes.h"
#include "network/serverinfo.h"
#include <QCoreApplication>
#include <QSettings>
#include <QPoint>
class Options
{
public:
Options(const Options &) = delete;
void operator=(const Options &) = delete;
static Options &getInstance()
{
static Options instance;
return instance;
}
/**
* @brief Migrates old configuration files to the most recent format.
*/
void migrate();
// Reads the theme from config.ini and loads it into the currenttheme
// variable
QString theme() const;
void setTheme(QString value);
double themeScalingFactor() const;
void setThemeScalingFactor(double value);
// Returns the blip rate from config.ini (once per X symbols)
int blipRate() const;
void setBlipRate(int value);
// Returns true if blank blips is enabled in config.ini and false otherwise
bool blankBlip() const;
void setBlankBlip(bool value);
// Returns true if looping sound effects are enabled in the config.ini
bool loopingSfx() const;
void setLoopingSfx(bool value);
// Returns true if stop music on objection is enabled in the config.ini
bool objectionStopMusic() const;
void setObjectionStopMusic(bool value);
// Returns true if streaming is enabled in the config.ini
bool streamingEnabled() const;
void setStreamingEnabled(bool value);
// Returns the value of defaultmusic in config.ini
int musicVolume() const;
void setMusicVolume(int value);
// Returns the value of defaultsfx in config.ini
int sfxVolume() const;
void setSfxVolume(int value);
// Returns the value of defaultblip in config.ini
int blipVolume() const;
void setBlipVolume(int value);
// Returns the value of suppressaudio in config.ini
int defaultSuppressAudio() const;
void setDefaultSupressedAudio(int value);
// Returns the value if objections interrupt and skip the message queue
// from the config.ini.
bool objectionSkipQueueEnabled() const;
void setObjectionSkipQueueEnabled(bool value);
// returns if log will show messages as-received, while viewport will parse
// according to the queue (Text Stay Time) from the config.ini
bool desynchronisedLogsEnabled() const;
void setDesynchronisedLogsEnabled(bool value);
// Returns the value of whether Discord should be enabled on startup
// from the config.ini.
bool discordEnabled() const;
void setDiscordEnabled(bool value);
// Returns the value of whether shaking should be enabled.
// from the config.ini.
bool shakeEnabled() const;
void setShakeEnabled(bool value);
// Returns the value of whether effects should be Enabled.
// from the config.ini.
bool effectsEnabled() const;
void setEffectsEnabled(bool value);
// Returns the value of whether frame-specific effects defined in char.ini
// should be sent/received over the network. from the config.ini.
bool networkedFrameSfxEnabled() const;
void setNetworkedFrameSfxEnabled(bool value);
// Returns the value of whether courtroom slide animations should be played
// on this client.
bool slidesEnabled() const;
void setSlidesEnabled(bool value);
// Returns the value of whether colored ic log should be a thing.
// from the config.ini.
bool colorLogEnabled() const;
void setColorLogEnabled(bool value);
// Returns the value of whether sticky sounds should be a thing.
// from the config.ini.
bool clearSoundsDropdownOnPlayEnabled() const;
void setClearSoundsDropdownOnPlayEnabled(bool value);
// Returns the value of whether sticky effects should be a thing.
// from the config.ini.
bool clearEffectsDropdownOnPlayEnabled() const;
void setClearEffectsDropdownOnPlayEnabled(bool value);
// Returns the value of whether sticky preanims should be a thing.
// from the config.ini.
bool clearPreOnPlayEnabled() const;
void setClearPreOnPlayEnabled(bool value);
// Returns the value of whether custom chatboxes should be a thing.
// from the config.ini.
// I am increasingly maddened by the lack of dynamic auto-generation system
// for settings.
bool customChatboxEnabled() const;
void setCustomChatboxEnabled(bool value);
// Returns the value of characer sticker (avatar) setting
bool characterStickerEnabled() const;
void setCharacterStickerEnabled(bool value);
// Returns the value of whether continuous playback should be used
// from the config.ini.
bool continuousPlaybackEnabled() const;
void setContinuousPlaybackEnabled(bool value);
// Returns the value of whether stopping music by double clicking category
// should be used from the config.ini.
bool stopMusicOnCategoryEnabled() const;
void setStopMusicOnCategoryEnabled(bool value);
// Returns the value of the maximum amount of lines the IC chatlog
// may contain, from config.ini.
int maxLogSize() const;
void setMaxLogSize(int value);
// Current wait time between messages for the queue system
int textStayTime() const;
void setTextStayTime(int value);
// Returns the letter display speed during text crawl in in-character messages
int textCrawlSpeed() const;
void setTextCrawlSpeed(int value);
// Returns Minimum amount of time (in miliseconds) that must pass before the
// next Enter key press will send your IC message. (new behaviour)
int chatRateLimit() const;
void setChatRateLimit(int value);
// Returns whether the log should go upwards (new behaviour)
// or downwards (vanilla behaviour).
bool logDirectionDownwards() const;
void setLogDirectionDownwards(bool value);
// Returns whether the log should separate name from text via newline or :
bool logNewline() const;
void setLogNewline(bool value);
// Get spacing between IC log entries.
int logMargin() const;
void setLogMargin(int value);
// Returns whether the log should have a timestamp.
bool logTimestampEnabled() const;
void setLogTimestampEnabled(bool value);
// Returns the format string for the log timestamp
QString logTimestampFormat() const;
void setLogTimestampFormat(QString value);
// Returns whether to log IC actions.
bool logIcActions() const;
void setLogIcActions(bool value);
// Returns the username the user may have set in config.ini.
QString username() const;
void setUsername(QString value);
// Returns the audio device used for the client.
QString audioOutputDevice() const;
void setAudioOutputDevice(QString value);
// Returns whether the user would like to have custom shownames on by default.
bool customShownameEnabled() const;
void setCustomShownameEnabled(bool value);
// Returns the showname the user may have set in config.ini.
QString shownameOnJoin() const;
void setShownameOnJoin(QString value);
// Get if text file logging is Enabled
bool logToTextFileEnabled() const;
void setLogToTextFileEnabled(bool value);
// Get if demo logging is Enabled
bool logToDemoFileEnabled() const;
void setLogToDemoFileEnabled(bool value);
// Get the subtheme from settings
QString subTheme() const;
QString settingsSubTheme() const;
void setSettingsSubTheme(QString value);
// Returns the server-
QString serverSubTheme() const;
void setServerSubTheme(QString value);
// Get if the theme is animated
bool animatedThemeEnabled() const;
void setAnimatedThemeEnabled(bool value);
// Get a list of custom mount paths
QStringList mountPaths() const;
void setMountPaths(QStringList value);
// Get whether to opt out of player count metrics sent to the master server
bool playerCountOptout() const;
void setPlayerCountOptout(bool value);
// Get if sfx can be sent to play on idle
bool playSelectedSFXOnIdle() const;
void setPlaySelectedSFXOnIdle(bool value);
// Whether opening evidence requires a single or double click
bool evidenceDoubleClickEdit() const;
void setEvidenceDoubleClickEdit(bool value);
// Supplies an alternative masterserver URL
QString alternativeMasterserver() const;
void setAlternativeMasterserver(QString value);
// Language the client loads on start.
QString language() const;
void setLanguage(QString value);
// The scaling algorithm to use on images.
RESIZE_MODE resizeMode() const;
void setResizeMode(RESIZE_MODE value);
// Callwords notify the user when the word/words are used in a game message.
QStringList callwords() const;
void setCallwords(QStringList value);
QString playerlistFormatString() const;
void setPlayerlistFormatString(QString value);
// Clears the configuration file. Essentially restoring it to default.
void clearConfig();
// Loads the favorite servers
QVector<ServerInfo> favorites();
void setFavorites(QVector<ServerInfo> value);
// Interactions with favorite servers
void removeFavorite(int index);
void addFavorite(ServerInfo server);
void updateFavorite(ServerInfo server, int index);
// Theming Nonesense!
QString getUIAsset(QString f_asset_name);
void setWindowPosition(QString widget, QPoint position);
std::optional<QPoint> windowPosition(QString widget);
bool restoreWindowPositionEnabled() const;
void setRestoreWindowPositionEnabled(bool state);
private:
/**
* @brief QSettings object for config.ini
*/
QSettings config;
/**
* @brief QSettings object for favorite_servers.ini
*/
QSettings favorite;
void migrateCallwords();
/**
* @brief Constructor for options class.
*/
Options();
QString m_server_subtheme;
};