|
1 | 1 | #ifndef AOAPPLICATION_H |
2 | 2 | #define AOAPPLICATION_H |
3 | 3 |
|
| 4 | +#define UNUSED(x) (void)(x) |
| 5 | + |
4 | 6 | #include "aopacket.h" |
5 | 7 | #include "datatypes.h" |
| 8 | +#include "demoserver.h" |
6 | 9 | #include "discord_rich_presence.h" |
7 | 10 |
|
8 | 11 | #include "bass.h" |
|
28 | 31 | #include <QTextStream> |
29 | 32 | #include <QTime> |
30 | 33 |
|
| 34 | +#include <QElapsedTimer> |
| 35 | + |
31 | 36 | class NetworkManager; |
32 | 37 | class Lobby; |
33 | 38 | class Courtroom; |
@@ -129,6 +134,7 @@ class AOApplication : public QApplication { |
129 | 134 | QString get_default_theme_path(QString p_file); |
130 | 135 | QString get_custom_theme_path(QString p_theme, QString p_file); |
131 | 136 | QString get_character_path(QString p_char, QString p_file); |
| 137 | + QString get_misc_path(QString p_misc, QString p_file); |
132 | 138 | QString get_sounds_path(QString p_file); |
133 | 139 | QString get_music_path(QString p_song); |
134 | 140 | QString get_background_path(QString p_file); |
@@ -223,6 +229,9 @@ class AOApplication : public QApplication { |
223 | 229 | // Current wait time between messages for the queue system |
224 | 230 | int stay_time(); |
225 | 231 |
|
| 232 | + // Returns Minimum amount of time (in miliseconds) that must pass before the next Enter key press will send your IC message. (new behaviour) |
| 233 | + int get_chat_ratelimit(); |
| 234 | + |
226 | 235 | // Returns whether the log should go upwards (new behaviour) |
227 | 236 | // or downwards (vanilla behaviour). |
228 | 237 | bool get_log_goes_downwards(); |
@@ -265,6 +274,9 @@ class AOApplication : public QApplication { |
265 | 274 | // directory if it doesn't exist. |
266 | 275 | bool append_to_file(QString p_text, QString p_file, bool make_dir = false); |
267 | 276 |
|
| 277 | + // Append to the currently open demo file if there is one |
| 278 | + void append_to_demofile(QString packet_string); |
| 279 | + |
268 | 280 | // Appends the argument string to serverlist.txt |
269 | 281 | void write_to_serverlist_txt(QString p_line); |
270 | 282 |
|
@@ -294,14 +306,14 @@ class AOApplication : public QApplication { |
294 | 306 | // Returns the color with p_identifier from p_file |
295 | 307 | QColor get_color(QString p_identifier, QString p_file); |
296 | 308 |
|
297 | | - // Returns the markdown symbol used for specified p_identifier such as colors |
298 | | - QString get_chat_markdown(QString p_identifier, QString p_file); |
| 309 | + // Returns the markup symbol used for specified p_identifier such as colors |
| 310 | + QString get_chat_markup(QString p_identifier, QString p_file); |
299 | 311 |
|
300 | 312 | // Returns the color from the misc folder. |
301 | 313 | QColor get_chat_color(QString p_identifier, QString p_chat); |
302 | 314 |
|
303 | 315 | // Returns the sfx with p_identifier from sounds.ini in the current theme path |
304 | | - QString get_sfx(QString p_identifier); |
| 316 | + QString get_sfx(QString p_identifier, QString p_misc="default"); |
305 | 317 |
|
306 | 318 | // Figure out if we can opus this or if we should fall back to wav |
307 | 319 | QString get_sfx_suffix(QString sound_to_check); |
@@ -337,6 +349,9 @@ class AOApplication : public QApplication { |
337 | 349 | // Returns the showname from the ini of p_char |
338 | 350 | QString get_showname(QString p_char); |
339 | 351 |
|
| 352 | + // Returns the category of this character |
| 353 | + QString get_category(QString p_char); |
| 354 | + |
340 | 355 | // Returns the value of chat image from the specific p_char's ini file |
341 | 356 | QString get_chat(QString p_char); |
342 | 357 |
|
@@ -370,9 +385,9 @@ class AOApplication : public QApplication { |
370 | 385 | // t |
371 | 386 | QString get_effect(QString effect, QString p_char, QString p_folder); |
372 | 387 |
|
373 | | - // Return the effect sound associated with the fx_name in the |
374 | | - // misc/effects/<char-defined>/sounds.ini, or theme/effects/sounds.ini. |
375 | | - QString get_effect_sound(QString fx_name, QString p_char); |
| 388 | + // Return p_property of fx_name. If p_property is "sound", return |
| 389 | + // the value associated with fx_name, otherwise use fx_name + '_' + p_property. |
| 390 | + QString get_effect_property(QString fx_name, QString p_char, QString p_property); |
376 | 391 |
|
377 | 392 | // Returns the custom realisation used by the character. |
378 | 393 | QString get_custom_realization(QString p_char); |
@@ -422,6 +437,15 @@ class AOApplication : public QApplication { |
422 | 437 | // Returns p_char's blips (previously called their "gender") |
423 | 438 | QString get_blips(QString p_char); |
424 | 439 |
|
| 440 | + // Get a property of a given emote, or get it from "options" if emote doesn't have it |
| 441 | + QString get_emote_property(QString p_char, QString p_emote, QString p_property); |
| 442 | + |
| 443 | + // Return a transformation mode from a string ("smooth" for smooth, anything else for fast) |
| 444 | + Qt::TransformationMode get_scaling(QString p_scaling); |
| 445 | + |
| 446 | + // Returns the scaling type for p_miscname |
| 447 | + Qt::TransformationMode get_misc_scaling(QString p_miscname); |
| 448 | + |
425 | 449 | // ====== |
426 | 450 | // These are all casing-related settings. |
427 | 451 | // ====== |
@@ -462,6 +486,9 @@ class AOApplication : public QApplication { |
462 | 486 | void *user); |
463 | 487 | static void doBASSreset(); |
464 | 488 |
|
| 489 | + QElapsedTimer demo_timer; |
| 490 | + DemoServer* demo_server = nullptr; |
| 491 | + |
465 | 492 | private: |
466 | 493 | const int RELEASE = 2; |
467 | 494 | const int MAJOR_VERSION = 8; |
|
0 commit comments