diff options
| author | stonedDiscord <stoned@derpymail.org> | 2020-03-06 16:43:03 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-03-06 16:43:03 +0100 |
| commit | b668bb227652f0b19f0d0b7251c2afa2f36473c5 (patch) | |
| tree | 9f23859a30574d9ce9220dd0f5fd2450b5ec7e2c /include | |
| parent | c2fd3796a97ee8d87544ec26df7d6797acfebd80 (diff) | |
| parent | 8c93cce0be0a316723284349d1f618dbf770ba3f (diff) | |
Merge branch 'master' into music_list_update
Diffstat (limited to 'include')
| -rw-r--r-- | include/aoapplication.h | 36 | ||||
| -rw-r--r-- | include/aocaseannouncerdialog.h | 1 | ||||
| -rw-r--r-- | include/aocharmovie.h | 31 | ||||
| -rw-r--r-- | include/aomusicplayer.h | 34 | ||||
| -rw-r--r-- | include/aooptionsdialog.h | 8 | ||||
| -rw-r--r-- | include/aosfxplayer.h | 6 | ||||
| -rw-r--r-- | include/courtroom.h | 98 | ||||
| -rw-r--r-- | include/datatypes.h | 7 | ||||
| -rw-r--r-- | include/lobby.h | 3 |
9 files changed, 174 insertions, 50 deletions
diff --git a/include/aoapplication.h b/include/aoapplication.h index 5475eb7b..e4f2ee68 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -27,6 +27,11 @@ #include <QAudioDeviceInfo> #endif +#include <QtConcurrent/QtConcurrent> +#include <QThread> +#include <QThreadPool> +#include <QFuture> + class NetworkManager; class Lobby; class Courtroom; @@ -78,6 +83,7 @@ public: bool arup_enabled = false; bool casing_alerts_enabled = false; bool modcall_reason_enabled = false; + bool looping_sfx_support_enabled = false; ///////////////loading info/////////////////// @@ -93,6 +99,7 @@ public: int loaded_evidence = 0; int music_list_size = 0; int loaded_music = 0; + int area_count = 0; bool courtroom_loaded = false; @@ -150,6 +157,12 @@ public: //Returns true if blank blips is enabled in config.ini and false otherwise bool get_blank_blip(); + //Returns true if looping sound effects are enabled in the config.ini + bool get_looping_sfx(); + + //Returns true if kill music on object is enabled in the config.ini + bool get_objectmusic(); + //Returns the value of default_music in config.ini int get_default_music(); @@ -163,6 +176,10 @@ public: // from the config.ini. bool is_discord_enabled(); + // Returns the value of whether shaking and flashing should be enabled. + // from the config.ini. + bool is_shakeandflash_enabled(); + // Returns the value of the maximum amount of lines the IC chatlog // may contain, from config.ini. int get_max_log_size(); @@ -267,6 +284,18 @@ public: //Returns the sfx of p_char's p_emote QString get_sfx_name(QString p_char, int p_emote); + //Returns if an emote loops it's SFX + QString get_sfx_looping(QString p_char, int p_emote); + + //Returns if an emote has a frame specific SFX for it + QString get_frame_sfx_name(QString p_char, QString p_emote, int n_frame); + + //Returns if an emote has a frame specific SFX for it + QString get_realization_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); @@ -304,13 +333,16 @@ public: // Same for CM. bool get_casing_cm_enabled(); + // Same for witnesses. + bool get_casing_wit_enabled(); + // Get the message for the CM for casing alerts. QString get_casing_can_host_cases(); private: const int RELEASE = 2; - const int MAJOR_VERSION = 6; - const int MINOR_VERSION = 2; + const int MAJOR_VERSION = 7; + const int MINOR_VERSION = 0; QString current_theme = "default"; diff --git a/include/aocaseannouncerdialog.h b/include/aocaseannouncerdialog.h index a238c3f2..da26fab0 100644 --- a/include/aocaseannouncerdialog.h +++ b/include/aocaseannouncerdialog.h @@ -36,6 +36,7 @@ private: QCheckBox *ui_judge_needed; QCheckBox *ui_juror_needed; QCheckBox *ui_steno_needed; + QCheckBox *ui_witness_needed; public slots: void ok_pressed(); diff --git a/include/aocharmovie.h b/include/aocharmovie.h index 7ef7da3f..6c127a66 100644 --- a/include/aocharmovie.h +++ b/include/aocharmovie.h @@ -6,9 +6,12 @@ #include <QTimer> #include <QDebug> #include <QImageReader> +#include <QPainter> +#include "include/aosfxplayer.h" +#include "include/courtroom.h" -class AOApplication; +class AOApplication; class AOCharMovie : public QLabel { Q_OBJECT @@ -22,36 +25,52 @@ public: void play_idle(QString p_char, QString p_emote); void set_flipped(bool p_flipped) {m_flipped = p_flipped;} - + void LoadImageWithStupidMethodForFlipSupport(QImage image); void stop(); void move(int ax, int ay); - void combo_resize(int w, int h); - + void play_frame_sfx(); + + void sfx_two_network_boogaloo(); + void screenshake_two_network_boogaloo(); + void realization_two_network_boogaloo(); + + AOSfxPlayer *frame_specific_sfx_player; + Courtroom *mycourtroom; + QString frame_sfx_hellstring = ""; + QString frame_screenshake_hellstring = ""; + QString frame_realization_hellstring = ""; + bool use_networked_framehell = false; private: AOApplication *ao_app; QMovie *m_movie; QVector<QImage> movie_frames; QTimer *preanim_timer; + QTimer *ticker; + QString last_path; + QString current_emote; + QString current_char; const int time_mod = 62; // These are the X and Y values before they are fixed based on the sprite's width. int x = 0; int y = 0; + int default_w; + int default_h; bool m_flipped = false; bool play_once = true; + bool apng = false; signals: void done(); private slots: - void frame_change(int n_frame); void timer_done(); + void movie_ticker(); }; - #endif // AOCHARMOVIE_H diff --git a/include/aomusicplayer.h b/include/aomusicplayer.h index b34267c9..255cc456 100644 --- a/include/aomusicplayer.h +++ b/include/aomusicplayer.h @@ -6,31 +6,42 @@ #elif defined(QTAUDIO) #include <QMediaPlayer> #endif + #include "aoapplication.h" #include <QWidget> #include <string.h> #include <QDebug> +#include <QTimer> +#include <QObject> #if defined(BASSAUDIO) -class AOMusicPlayer +class AOMusicPlayer : public QObject { + Q_OBJECT public: AOMusicPlayer(QWidget *parent, AOApplication *p_ao_app); - ~AOMusicPlayer(); + virtual ~AOMusicPlayer(); void play(QString p_song); void set_volume(int p_value); + void kill_loop(); + QString get_path(); + bool enable_looping = true; + private: QWidget *m_parent; AOApplication *ao_app; int m_volume = 0; + QString f_path; + HSTREAM m_stream; + }; #elif defined(QTAUDIO) -class AOMusicPlayer +class AOMusicPlayer : public QObject { public: AOMusicPlayer(QWidget *parent, AOApplication *p_ao_app); @@ -39,15 +50,21 @@ public: void play(QString p_song); void set_volume(int p_value); + void kill_loop(); + QString get_path(); + bool enable_looping = true; + private: - QMediaPlayer m_player; QWidget *m_parent; AOApplication *ao_app; + QMediaPlayer m_player; + int m_volume = 0; + QString f_path; }; #else -class AOMusicPlayer +class AOMusicPlayer : public QObject { public: AOMusicPlayer(QWidget *parent, AOApplication *p_ao_app); @@ -56,9 +73,16 @@ public: void play(QString p_song); void set_volume(int p_value); + void kill_loop(); + QString get_path(); + bool enable_looping = true; + private: QWidget *m_parent; AOApplication *ao_app; + + int m_volume = 0; + QString f_path; }; #endif diff --git a/include/aooptionsdialog.h b/include/aooptionsdialog.h index 934d2577..233d079a 100644 --- a/include/aooptionsdialog.h +++ b/include/aooptionsdialog.h @@ -61,6 +61,8 @@ private: QLineEdit *ui_ms_textbox; QLabel *ui_discord_lbl; QCheckBox *ui_discord_cb; + QLabel *ui_epilepsy_lbl; + QCheckBox *ui_epilepsy_cb; QLabel *ui_language_label; QComboBox *ui_language_combobox; @@ -88,6 +90,10 @@ private: QLabel *ui_bliprate_lbl; QCheckBox *ui_blank_blips_cb; QLabel *ui_blank_blips_lbl; + QLabel *ui_loopsfx_lbl; + QCheckBox *ui_loopsfx_cb; + QLabel *ui_objectmusic_lbl; + QCheckBox *ui_objectmusic_cb; QDialogButtonBox *ui_settings_buttons; QWidget *ui_casing_tab; @@ -108,6 +114,8 @@ private: QCheckBox *ui_casing_steno_cb; QLabel *ui_casing_cm_lbl; QCheckBox *ui_casing_cm_cb; + QLabel *ui_casing_wit_lbl; + QCheckBox *ui_casing_wit_cb; QLabel *ui_casing_cm_cases_lbl; QLineEdit *ui_casing_cm_cases_textbox; diff --git a/include/aosfxplayer.h b/include/aosfxplayer.h index 19d4bdf3..5b4d2ece 100644 --- a/include/aosfxplayer.h +++ b/include/aosfxplayer.h @@ -12,20 +12,24 @@ #include <QWidget> #include <string.h> #include <QDebug> +#include <QTimer> -class AOSfxPlayer +class AOSfxPlayer : public QObject { + Q_OBJECT public: AOSfxPlayer(QWidget *parent, AOApplication *p_ao_app); void play(QString p_sfx, QString p_char = "", QString shout = ""); void stop(); void set_volume(qreal p_volume); + void setLooping(bool is_looping); private: QWidget *m_parent; AOApplication *ao_app; qreal m_volume = 0; + bool looping_sfx = false; void set_volume_internal(qreal p_volume); diff --git a/include/courtroom.h b/include/courtroom.h index baefbfa7..951a5a33 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -26,6 +26,7 @@ #include "datatypes.h" #include "debug_functions.h" #include "chatlogpiece.h" +#include "aocharmovie.h" #include <QMainWindow> #include <QLineEdit> @@ -35,11 +36,12 @@ #include <QComboBox> #include <QSlider> #include <QVector> +#include <QSignalMapper> #include <QCloseEvent> #include <QMap> #include <QTextBrowser> #include <QSpinBox> - +#include <QMovie> #include <QDebug> #include <QScrollBar> #include <QRegExp> @@ -48,12 +50,23 @@ #include <QFont> #include <QInputDialog> #include <QFileDialog> +#include <QWidget> +#include <QPropertyAnimation> +#include <QTransform> +#include <QParallelAnimationGroup> +#include <QtConcurrent/QtConcurrent> +#include <QtConcurrent/QtConcurrentRun> +#include <QThread> +#include <QThreadPool> +#include <QFuture> +#include <QMetaObject> +#include <QLayout> #include <QTextBoundaryFinder> #include <stack> class AOApplication; - +class AOCharMovie; class Courtroom : public QMainWindow { Q_OBJECT @@ -66,15 +79,33 @@ public: void append_area(QString f_area){area_list.append(f_area);} void clear_music(){music_list.clear();} void clear_areas(){area_list.clear();} - void fix_last_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; + //abstract widget to hold char buttons + QWidget *ui_char_buttons; + QVector<char_type> char_list; + QVector<evi_type> evidence_list; + QVector<QString> music_list; + QVector<QString> area_list; + QSignalMapper *char_button_mapper; + QVector<AOCharButton*> ui_char_button_list; + QVector<AOCharButton*> 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() { - 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) @@ -123,7 +154,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); @@ -170,6 +201,9 @@ public: //properly sets up some varibles: resets user state void enter_courtroom(int p_cid); + // 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 void list_music(); void list_areas(); @@ -210,14 +244,15 @@ 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(); + void doRealization(); ~Courtroom(); private: - AOApplication *ao_app; int m_courtroom_width = 714; int m_courtroom_height = 668; @@ -230,7 +265,10 @@ private: bool first_message_sent = false; int maximumMessages = 0; - + QPropertyAnimation *screenshake_animation; + QPropertyAnimation *chatbox_screenshake_animation; + QParallelAnimationGroup *screenshake_group; + QMovie *frame_emote_checker; // This is for inline message-colouring. enum INLINE_COLOURS { @@ -249,7 +287,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. @@ -265,11 +303,6 @@ private: // The offset this user has given if they want to appear alongside someone. int offset_with_pair = 0; - QVector<char_type> char_list; - QVector<evi_type> evidence_list; - QVector<QString> music_list; - QVector<QString> area_list; - QVector<int> arup_players; QVector<QString> arup_statuses; QVector<QString> arup_cms; @@ -319,7 +352,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; @@ -348,11 +381,10 @@ 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; + int screenshake_state = 0; int text_color = 0; bool is_presenting_evidence = false; @@ -368,7 +400,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; @@ -391,6 +422,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; @@ -479,6 +513,7 @@ private: AOButton *ui_custom_objection; AOButton *ui_realization; + AOButton *ui_screenshake; AOButton *ui_mute; AOButton *ui_defense_plus; @@ -515,11 +550,6 @@ private: AOImage *ui_char_select_background; - //abstract widget to hold char buttons - QWidget *ui_char_buttons; - - QVector<AOCharButton*> ui_char_button_list; - QVector<AOCharButton*> ui_char_button_list_filtered; AOImage *ui_selector; AOButton *ui_back_to_lobby; @@ -531,14 +561,9 @@ 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(); - void char_clicked(int n_char); void put_button_in_place(int starting, int chars_on_this_page); void filter_character_list(); @@ -560,7 +585,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(); @@ -607,6 +632,7 @@ private slots: void on_custom_objection_clicked(); void on_realization_clicked(); + void on_screenshake_clicked(); void on_mute_clicked(); void on_pair_clicked(); @@ -659,13 +685,17 @@ private slots: void on_spectator_clicked(); + void char_clicked(int n_char); + void on_switch_area_music_clicked(); void on_casing_clicked(); void ping_server(); + #ifdef BASSAUDIO void load_bass_opus_plugin(); + #endif }; #endif // COURTROOM_H diff --git a/include/datatypes.h b/include/datatypes.h index aaa5de52..1b76f725 100644 --- a/include/datatypes.h +++ b/include/datatypes.h @@ -100,7 +100,12 @@ enum CHAT_MESSAGE SELF_OFFSET, OTHER_OFFSET, OTHER_FLIP, - NONINTERRUPTING_PRE + NONINTERRUPTING_PRE, + LOOPING_SFX, + SCREENSHAKE, + FRAME_SCREENSHAKE, + FRAME_REALIZATION, + FRAME_SFX }; enum COLOR diff --git a/include/lobby.h b/include/lobby.h index 4293ac36..d32debed 100644 --- a/include/lobby.h +++ b/include/lobby.h @@ -78,7 +78,8 @@ private: QModelIndex last_model; void set_size_and_pos(QWidget *p_widget, QString p_identifier); - +public slots: + void lobbyThreadHandler(QString loadingText); private slots: void on_public_servers_clicked(); void on_favorites_clicked(); |
