From e76a83ddfe8f6fe16ee7e2a91d3ac30e89f80345 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Thu, 12 Sep 2019 18:28:08 +0300 Subject: Allow AOMovie to have timers that take priority over the animated image frame count Set it up so feeding the timer value when playing the AOMovie would use the timer but only in cases where a non-animated image is used Update shouts and wtce to pass the 'duration' argument which will be used if the image used is non-animated. Otherwise, prioritize the animated image duration. --- include/aomovie.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/aomovie.h b/include/aomovie.h index 1f278bf..33b3158 100644 --- a/include/aomovie.h +++ b/include/aomovie.h @@ -15,13 +15,15 @@ public: AOMovie(QWidget *p_parent, AOApplication *p_ao_app); void set_play_once(bool p_play_once); - void play(QString p_gif, QString p_char = "", QString p_custom_theme = ""); + void start_timer(int delay); + void play(QString p_gif, QString p_char = "", QString p_custom_theme = "", int duration = 0); void combo_resize(int w, int h); void stop(); private: QMovie *m_movie; AOApplication *ao_app; + QTimer *timer; bool play_once = true; signals: @@ -29,6 +31,7 @@ signals: private slots: void frame_change(int n_frame); + void timer_done(); }; #endif // AOMOVIE_H -- cgit From 5a31516a36e0f13211db807a48214f11ccef827d Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Thu, 12 Sep 2019 19:03:42 +0300 Subject: Remove unecessary hard-coded timers for the witness testimony .png Make the witness testimony use AOMovie instead of AOImage Remove pointless "testimony_in_progress" variable CONTROVERSIAL: Make the witness testimony indicator be position-ignorant so as to reduce the amount of hardcoding and allow broader usage of the witness testimony system (For example, Danganronpa investigation indicator, etc.) - This should not affect how the testimony indicator is received currently, as witness testimony usually requires the entire rest of the court to shut up until the cross-examination either way. (cherry picked from commit 932f430b683dffb0b965c32cd2247e2b6361dd0e) --- include/courtroom.h | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'include') diff --git a/include/courtroom.h b/include/courtroom.h index f0b6996..e053e23 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -309,11 +309,6 @@ private: //keeps track of how long realization is visible(it's just a white square and should be visible less than a second) QTimer *realization_timer; - //times how long the blinking testimony should be shown(green one in the corner) - QTimer *testimony_show_timer; - //times how long the blinking testimony should be hidden - QTimer *testimony_hide_timer; - //every time point in char.inis times this equals the final time const int time_mod = 40; @@ -323,14 +318,6 @@ private: QString previous_ic_message = ""; - bool testimony_in_progress = false; - - //in milliseconds - const int testimony_show_time = 1500; - - //in milliseconds - const int testimony_hide_time = 500; - //char id, muted or not QMap mute_map; @@ -407,8 +394,8 @@ private: AOImage *ui_vp_chatbox; QLabel *ui_vp_showname; QTextEdit *ui_vp_message; - AOImage *ui_vp_testimony; AOImage *ui_vp_realization; + AOMovie *ui_vp_testimony; AOMovie *ui_vp_wtce; AOMovie *ui_vp_objection; -- cgit From 3b3507df60673079482372b4da08eeabf9317a20 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Thu, 12 Sep 2019 19:37:44 +0300 Subject: Fix compilation error Allow realization flashes to be animated images by making them AOMovies Eploit the newly added 'duration' system for realization AOMovie (cherry picked from commit bb98f79083648243216f665852a7d2326af11be0) --- include/courtroom.h | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'include') diff --git a/include/courtroom.h b/include/courtroom.h index e053e23..fe870b4 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -306,9 +306,6 @@ private: //delay before sfx plays QTimer *sfx_delay_timer; - //keeps track of how long realization is visible(it's just a white square and should be visible less than a second) - QTimer *realization_timer; - //every time point in char.inis times this equals the final time const int time_mod = 40; @@ -394,7 +391,7 @@ private: AOImage *ui_vp_chatbox; QLabel *ui_vp_showname; QTextEdit *ui_vp_message; - AOImage *ui_vp_realization; + AOMovie *ui_vp_realization; AOMovie *ui_vp_testimony; AOMovie *ui_vp_wtce; AOMovie *ui_vp_objection; @@ -538,11 +535,6 @@ public slots: void objection_done(); void preanim_done(); - void realization_done(); - - void show_testimony(); - void hide_testimony(); - void mod_called(QString p_ip); void case_called(QString msg, bool def, bool pro, bool jud, bool jur, bool steno); -- cgit From 86523bb101e73417e44eaae71e6cac5a11a70751 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Fri, 13 Sep 2019 11:56:22 +0300 Subject: Rename dubious "duration" to "default_duration" for play function in AOMovie class --- include/aomovie.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/aomovie.h b/include/aomovie.h index 33b3158..974559d 100644 --- a/include/aomovie.h +++ b/include/aomovie.h @@ -16,7 +16,7 @@ public: 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 duration = 0); + 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(); -- cgit