diff options
| author | Crystalwarrior <varsash@gmail.com> | 2019-09-15 17:44:02 +0300 |
|---|---|---|
| committer | Crystalwarrior <varsash@gmail.com> | 2019-09-15 17:44:02 +0300 |
| commit | a2f9df4042585ab0849b54e2bb0b9699f9064aed (patch) | |
| tree | e2ae5b98111959c75232ab24b9f909b742658e9c /include | |
| parent | 4db114007456f12c77f002cac4e26cd3f6917638 (diff) | |
Finally implement frame-specific effects such as screenshake, realization flash, sound effects, etc.
Fix screenshake animation modifying the default positions of shook elements
Fix aomovie sometimes not playing the last frame and causing lagspikes due to the delay() method
Diffstat (limited to 'include')
| -rw-r--r-- | include/aoapplication.h | 12 | ||||
| -rw-r--r-- | include/aocharmovie.h | 12 | ||||
| -rw-r--r-- | include/aomovie.h | 1 | ||||
| -rw-r--r-- | include/courtroom.h | 7 |
4 files changed, 28 insertions, 4 deletions
diff --git a/include/aoapplication.h b/include/aoapplication.h index 8d998f46..8164e166 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -271,6 +271,18 @@ public: //Returns the sfx of p_char's p_emote QString get_sfx_name(QString p_char, int p_emote); + //Returns if the sfx is defined as looping in char.ini + QString get_sfx_looping(QString p_char, QString p_sfx); + + //Returns if an emote has a frame specific SFX for it + QString get_sfx_frame(QString p_char, QString p_emote, int n_frame); + + //Returns if an emote has a frame specific SFX for it + QString get_flash_frame(QString p_char, QString p_emote, int n_frame); + + //Returns if an emote has a frame specific SFX for it + QString get_screenshake_frame(QString p_char, QString p_emote, int n_frame); + //Not in use int get_sfx_delay(QString p_char, int p_emote); diff --git a/include/aocharmovie.h b/include/aocharmovie.h index b8b73b7e..5eaafaf6 100644 --- a/include/aocharmovie.h +++ b/include/aocharmovie.h @@ -32,6 +32,9 @@ public: //Play an (a)normal.gif - style animation (not talking) void play_idle(QString p_char, QString p_emote); + //Play a frame-specific effect, if there's any defined for that specific frame. + void play_frame_effect(int frame); + //Retreive a pixmap adjused for mirroring/aspect ratio shenanigans from a provided QImage QPixmap get_pixmap(QImage image); @@ -61,6 +64,12 @@ private: QVector<QPixmap> movie_frames; QVector<int> movie_delays; + + //Effects such as sfx, screenshakes and realization flashes are stored in here. + //QString entry format: "sfx^[sfx_name]", "shake", "flash". + //The program uses the QVector index as reference. + QVector<QVector<QString>> movie_effects; + QTimer *preanim_timer; QTimer *ticker; QString last_path; @@ -83,6 +92,9 @@ private: signals: void done(); + void shake(); + void flash(); + void play_sfx(QString sfx); private slots: void preanim_done(); diff --git a/include/aomovie.h b/include/aomovie.h index 974559d2..a5af735e 100644 --- a/include/aomovie.h +++ b/include/aomovie.h @@ -15,7 +15,6 @@ public: AOMovie(QWidget *p_parent, AOApplication *p_ao_app); void set_play_once(bool p_play_once); - void start_timer(int delay); void play(QString p_gif, QString p_char = "", QString p_custom_theme = "", int default_duration = 0); void combo_resize(int w, int h); void stop(); diff --git a/include/courtroom.h b/include/courtroom.h index 9c79a3e3..7fbde274 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -219,8 +219,6 @@ public: void announce_case(QString title, bool def, bool pro, bool jud, bool jur, bool steno); void check_connection_received(); - void do_screenshake(); - void doRealization(); ~Courtroom(); @@ -239,7 +237,7 @@ private: bool first_message_sent = false; int maximumMessages = 0; - QParallelAnimationGroup *screenshake_animation_group; + QParallelAnimationGroup *screenshake_animation_group = new QParallelAnimationGroup; // This is for inline message-colouring. @@ -557,6 +555,9 @@ private: public slots: void objection_done(); void preanim_done(); + void do_screenshake(); + void do_flash(); + void play_char_sfx(QString sfx_name); void mod_called(QString p_ip); |
