From 3c0cedbe922c9fcacd0d171423f83e375f66e178 Mon Sep 17 00:00:00 2001 From: iamgoofball Date: Fri, 18 Jan 2019 19:08:56 -0800 Subject: Add screenshake, frame-specific effects, looping SFX, and clientside music looping Committed by patch since Goof is currently banned on GitHub for no good reason. --- include/courtroom.h | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'include/courtroom.h') diff --git a/include/courtroom.h b/include/courtroom.h index ec9f9ef0..3f93e4c5 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -25,6 +25,7 @@ #include "datatypes.h" #include "debug_functions.h" #include "chatlogpiece.h" +#include "aocharmovie.h" #include #include @@ -48,11 +49,15 @@ #include #include #include +#include +#include +#include +#include #include class AOApplication; - +class AOCharMovie; class Courtroom : public QMainWindow { Q_OBJECT @@ -63,7 +68,6 @@ public: void append_evidence(evi_type p_evi){evidence_list.append(p_evi);} void append_music(QString f_music){music_list.append(f_music);} void append_area(QString f_area){area_list.append(f_area);} - void fix_last_area() { if (area_list.size() > 0) @@ -210,6 +214,8 @@ public: void announce_case(QString title, bool def, bool pro, bool jud, bool jur, bool steno); void check_connection_received(); + void doScreenShake(); + void doRealization(); ~Courtroom(); @@ -227,7 +233,10 @@ private: bool first_message_sent = false; int maximumMessages = 0; - + QPropertyAnimation *screenshake_animation; + QPropertyAnimation *chatbox_screenshake_animation; + QParallelAnimationGroup *screenshake_group; + QImageReader *frame_emote_checker; // This is for inline message-colouring. enum INLINE_COLOURS { @@ -318,7 +327,7 @@ private: //every time point in char.inis times this equals the final time const int time_mod = 40; - static const int chatmessage_size = 23; + static const int chatmessage_size = 28; QString m_chatmessage[chatmessage_size]; bool chatmessage_is_empty = false; @@ -352,6 +361,7 @@ private: int objection_state = 0; int realization_state = 0; + int screenshake_state = 0; int text_color = 0; bool is_presenting_evidence = false; @@ -390,6 +400,9 @@ private: AOMusicPlayer *music_player; AOSfxPlayer *sfx_player; + AOSfxPlayer *misc_sfx_player; + AOSfxPlayer *frame_emote_sfx_player; + AOSfxPlayer *pair_frame_emote_sfx_player; AOSfxPlayer *objection_player; AOBlipPlayer *blip_player; @@ -478,6 +491,7 @@ private: AOButton *ui_custom_objection; AOButton *ui_realization; + AOButton *ui_screenshake; AOButton *ui_mute; AOButton *ui_defense_plus; @@ -605,6 +619,7 @@ private slots: void on_custom_objection_clicked(); void on_realization_clicked(); + void on_screenshake_clicked(); void on_mute_clicked(); void on_pair_clicked(); -- cgit From 248444307ff7cbe87ec4fe4024073cddb999dabc Mon Sep 17 00:00:00 2001 From: iamgoofball Date: Fri, 18 Jan 2019 22:05:21 -0800 Subject: Fix bug with simultaneous shakes --- include/courtroom.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/courtroom.h') diff --git a/include/courtroom.h b/include/courtroom.h index 3f93e4c5..7d2a5513 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -124,7 +124,7 @@ public: //reads theme inis and sets size and pos based on the identifier void set_size_and_pos(QWidget *p_widget, QString p_identifier); - + QPoint get_theme_pos(QString p_identifier); //sets status as taken on character with cid n_char and places proper shading on charselect void set_taken(int n_char, bool p_taken); -- cgit From 10436992148e2342e6bd563d1acfb684f225aa30 Mon Sep 17 00:00:00 2001 From: iamgoofball Date: Sat, 19 Jan 2019 21:01:19 -0800 Subject: Suffix-independent Music, Mod Music List, looping bugfixes, easter eggs, etc. --- include/courtroom.h | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'include/courtroom.h') diff --git a/include/courtroom.h b/include/courtroom.h index 7d2a5513..c76e4a1f 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -68,14 +68,10 @@ public: void append_evidence(evi_type p_evi){evidence_list.append(p_evi);} void append_music(QString f_music){music_list.append(f_music);} void append_area(QString f_area){area_list.append(f_area);} - void fix_last_area() + void handle_failed_login(); + void reset_music_list() { - if (area_list.size() > 0) - { - QString malplaced = area_list.last(); - area_list.removeLast(); - append_music(malplaced); - } + music_list.clear(); } void arup_append(int players, QString status, QString cm, QString locked) -- cgit From debd386a7176327d481470621a7a3a65cd715f2e Mon Sep 17 00:00:00 2001 From: iamgoofball Date: Sun, 20 Jan 2019 21:06:21 -0800 Subject: Bugfixes and blip speeds --- include/courtroom.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/courtroom.h') diff --git a/include/courtroom.h b/include/courtroom.h index c76e4a1f..b746c6ac 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -251,7 +251,7 @@ private: bool message_is_centered = false; int current_display_speed = 3; - int message_display_speed[7] = {30, 40, 50, 60, 75, 100, 120}; + int message_display_speed[7] = {10, 20, 30, 40, 50, 60, 75}; // This is for checking if the character should start talking again // when an inline blue text ends. -- cgit From 13bc82094f76011eef371ece3b3894d7cc20eaf9 Mon Sep 17 00:00:00 2001 From: iamgoofball Date: Wed, 23 Jan 2019 00:14:47 -0800 Subject: >>>>multi-threading the frame sfx/screenshake/flashes --- include/courtroom.h | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'include/courtroom.h') diff --git a/include/courtroom.h b/include/courtroom.h index b746c6ac..1c739b8f 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -40,7 +40,7 @@ #include #include #include - +#include #include #include #include @@ -53,7 +53,11 @@ #include #include #include - +#include +#include +#include +#include +#include #include class AOApplication; @@ -69,6 +73,16 @@ public: void append_music(QString f_music){music_list.append(f_music);} void append_area(QString f_area){area_list.append(f_area);} void handle_failed_login(); + QString threading_sfx = ""; + QString threading_shake = ""; + QString threading_flash = ""; + QString threading_prefix = ""; + //cid and this may differ in cases of ini-editing + QString current_char = ""; + int current_emote = 0; + AOApplication *ao_app; + void mt_pre_framegetter(int frameNumber); + void mt_framegetter(int frameNumber); void reset_music_list() { music_list.clear(); @@ -216,7 +230,6 @@ public: ~Courtroom(); private: - AOApplication *ao_app; int m_courtroom_width = 714; int m_courtroom_height = 668; @@ -232,7 +245,7 @@ private: QPropertyAnimation *screenshake_animation; QPropertyAnimation *chatbox_screenshake_animation; QParallelAnimationGroup *screenshake_group; - QImageReader *frame_emote_checker; + QMovie *frame_emote_checker; // This is for inline message-colouring. enum INLINE_COLOURS { @@ -352,8 +365,6 @@ private: //character id, which index of the char_list the player is int m_cid = -1; - //cid and this may differ in cases of ini-editing - QString current_char = ""; int objection_state = 0; int realization_state = 0; @@ -373,7 +384,6 @@ private: const int button_height = 60; int current_emote_page = 0; - int current_emote = 0; int emote_columns = 5; int emote_rows = 2; int max_emotes_on_page = 10; -- cgit From 906c9016bb4660eb0445a3345a55ede959c3cb96 Mon Sep 17 00:00:00 2001 From: iamgoofball Date: Wed, 23 Jan 2019 00:58:30 -0800 Subject: Multithreaded character generation TODO: fix loading screen --- include/courtroom.h | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'include/courtroom.h') diff --git a/include/courtroom.h b/include/courtroom.h index 1c739b8f..f6124127 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -58,6 +58,7 @@ #include #include #include +#include #include class AOApplication; @@ -81,6 +82,15 @@ public: QString current_char = ""; int current_emote = 0; AOApplication *ao_app; + //abstract widget to hold char buttons + QWidget *ui_char_buttons; + QVector char_list; + QVector evidence_list; + QVector music_list; + QVector area_list; + QSignalMapper *char_button_mapper; + QVector ui_char_button_list; + QVector ui_char_button_list_filtered; void mt_pre_framegetter(int frameNumber); void mt_framegetter(int frameNumber); void reset_music_list() @@ -280,18 +290,11 @@ private: // The offset this user has given if they want to appear alongside someone. int offset_with_pair = 0; - QVector char_list; - QVector evidence_list; - QVector music_list; - QVector area_list; - QVector arup_players; QVector arup_statuses; QVector arup_cms; QVector arup_locks; - QSignalMapper *char_button_mapper; - QVector ic_chatlog_history; // These map music row items and area row items to their actual IDs. @@ -534,11 +537,6 @@ private: AOImage *ui_char_select_background; - //abstract widget to hold char buttons - QWidget *ui_char_buttons; - - QVector ui_char_button_list; - QVector ui_char_button_list_filtered; AOImage *ui_selector; AOButton *ui_back_to_lobby; -- cgit From f75032840450263bfe27d3b5a68ea1458a0ce8a5 Mon Sep 17 00:00:00 2001 From: iamgoofball Date: Wed, 23 Jan 2019 01:07:20 -0800 Subject: Multithreaded filtering of the character list --- include/courtroom.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'include/courtroom.h') diff --git a/include/courtroom.h b/include/courtroom.h index f6124127..be37869a 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -91,6 +91,9 @@ public: QSignalMapper *char_button_mapper; QVector ui_char_button_list; QVector ui_char_button_list_filtered; + QLineEdit *ui_char_search; + QCheckBox *ui_char_passworded; + QCheckBox *ui_char_taken; void mt_pre_framegetter(int frameNumber); void mt_framegetter(int frameNumber); void reset_music_list() @@ -548,10 +551,6 @@ private: AOButton *ui_spectator; - QLineEdit *ui_char_search; - QCheckBox *ui_char_passworded; - QCheckBox *ui_char_taken; - void construct_char_select(); void set_char_select(); void set_char_select_page(); -- cgit From 0649e7b28e16a054072d8656a5046c7cc3cfefb6 Mon Sep 17 00:00:00 2001 From: iamgoofball Date: Wed, 23 Jan 2019 07:35:29 -0800 Subject: Case Announcer: Witness Support also some other shit --- include/courtroom.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'include/courtroom.h') diff --git a/include/courtroom.h b/include/courtroom.h index be37869a..e00e454c 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -59,6 +59,7 @@ #include #include #include +#include #include class AOApplication; @@ -194,6 +195,9 @@ public: //properly sets up some varibles: resets user state void enter_courtroom(int p_cid); + // mfw this didnt fucking exist yet + void set_character(int char_id); + //helper function that populates ui_music_list with the contents of music_list void list_music(); void list_areas(); @@ -234,7 +238,7 @@ public: //Toggles the judge buttons, whether they should appear or not. void toggle_judge_buttons(bool is_on); - void announce_case(QString title, bool def, bool pro, bool jud, bool jur, bool steno); + void announce_case(QString title, bool def, bool pro, bool jud, bool jur, bool steno, bool wit); void check_connection_received(); void doScreenShake(); @@ -575,7 +579,7 @@ public slots: void mod_called(QString p_ip); - void case_called(QString msg, bool def, bool pro, bool jud, bool jur, bool steno); + void case_called(QString msg, bool def, bool pro, bool jud, bool jur, bool steno, bool witness); private slots: void start_chat_ticking(); -- cgit From f93459ed0eec6c7c64bece75cb6e8de627c605b9 Mon Sep 17 00:00:00 2001 From: sD Date: Fri, 21 Feb 2020 17:18:25 +0100 Subject: remove fuck --- include/courtroom.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/courtroom.h') diff --git a/include/courtroom.h b/include/courtroom.h index 587d9630..37d3f6fc 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -197,7 +197,7 @@ public: //properly sets up some varibles: resets user state void enter_courtroom(int p_cid); - // mfw this didnt fucking exist yet + // set the character using an ID void set_character(int char_id); //helper function that populates ui_music_list with the contents of music_list -- cgit From 2716416b62ce6ffec89d2a8b4b984b709cb5221a Mon Sep 17 00:00:00 2001 From: sD Date: Fri, 21 Feb 2020 18:00:23 +0100 Subject: only load bass plugins when bass is included --- include/courtroom.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/courtroom.h') diff --git a/include/courtroom.h b/include/courtroom.h index 37d3f6fc..4d271e4b 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -688,7 +688,9 @@ private slots: void ping_server(); + #ifdef BASSAUDIO void load_bass_opus_plugin(); + #endif }; #endif // COURTROOM_H -- cgit From 0123b4d1924a495827f91eef72f1427119cf1651 Mon Sep 17 00:00:00 2001 From: sD Date: Sun, 23 Feb 2020 03:19:05 +0100 Subject: move the click event back to the slots --- include/courtroom.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include/courtroom.h') diff --git a/include/courtroom.h b/include/courtroom.h index 4d271e4b..41e88e74 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -560,7 +561,6 @@ private: void construct_char_select(); void set_char_select(); void set_char_select_page(); - void char_clicked(int n_char); void put_button_in_place(int starting, int chars_on_this_page); void filter_character_list(); @@ -682,6 +682,8 @@ private slots: void on_spectator_clicked(); + void char_clicked(int n_char); + void on_switch_area_music_clicked(); void on_casing_clicked(); -- cgit