diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/aoapplication.h | 29 | ||||
| -rw-r--r-- | include/aoblipplayer.h | 8 | ||||
| -rw-r--r-- | include/aomusicplayer.h | 8 | ||||
| -rw-r--r-- | include/aooptionsdialog.h | 6 | ||||
| -rw-r--r-- | include/aosfxplayer.h | 8 | ||||
| -rw-r--r-- | include/chatlogpiece.h | 8 | ||||
| -rw-r--r-- | include/courtroom.h | 51 |
7 files changed, 68 insertions, 50 deletions
diff --git a/include/aoapplication.h b/include/aoapplication.h index f4685eca..60d945ec 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -5,6 +5,9 @@ #include "datatypes.h" #include "discord_rich_presence.h" +#include "bass.h" +#include "bassopus.h" + #include <QApplication> #include <QFile> #include <QSettings> @@ -23,9 +26,6 @@ #include <QScreen> #include <QStringList> #include <QTextStream> -#ifdef QTAUDIO -#include <QAudioDeviceInfo> -#endif class NetworkManager; class Lobby; @@ -202,7 +202,8 @@ public: // Returns the value of whether custom chatboxes should be a thing. // from the config.ini. - // I am increasingly maddened by the lack of dynamic auto-generation system for settings. + // I am increasingly maddened by the lack of dynamic auto-generation system + // for settings. bool is_customchat_enabled(); // Returns the value of the maximum amount of lines the IC chatlog @@ -213,14 +214,20 @@ public: // or downwards (vanilla behaviour). bool get_log_goes_downwards(); + // Returns whether the log should separate name from text via newline or : + bool get_log_newline(); + + // Get spacing between IC log entries. + int get_log_margin(); + + // Returns whether the log should have a timestamp. + bool get_log_timestamp(); + // Returns the username the user may have set in config.ini. QString get_default_username(); // Returns the audio device used for the client. QString get_audio_output_device(); -#ifdef QTAUDIO - QAudioDeviceInfo QtAudioDevice; -#endif // Returns whether the user would like to have custom shownames on by default. bool get_showname_enabled_by_default(); @@ -433,10 +440,16 @@ public: // The file name of the log file in base/logs. QString log_filename; + void initBASS(); + static void load_bass_opus_plugin(); + static void CALLBACK BASSreset(HSTREAM handle, DWORD channel, DWORD data, + void *user); + static void doBASSreset(); + private: const int RELEASE = 2; const int MAJOR_VERSION = 8; - const int MINOR_VERSION = 4; + const int MINOR_VERSION = 5; QString current_theme = "default"; diff --git a/include/aoblipplayer.h b/include/aoblipplayer.h index 5a104718..4d3b5f14 100644 --- a/include/aoblipplayer.h +++ b/include/aoblipplayer.h @@ -1,12 +1,8 @@ #ifndef AOBLIPPLAYER_H #define AOBLIPPLAYER_H -#if defined(BASSAUDIO) #include "bass.h" #include "bassopus.h" -#elif defined(QTAUDIO) -#include <QSoundEffect> -#endif #include "aoapplication.h" @@ -35,11 +31,7 @@ private: void set_volume_internal(qreal p_volume); -#if defined(BASSAUDIO) HSTREAM m_stream_list[5]; -#elif defined(QTAUDIO) - QSoundEffect m_blips; -#endif }; #endif // AOBLIPPLAYER_H diff --git a/include/aomusicplayer.h b/include/aomusicplayer.h index 82751b68..36031f16 100644 --- a/include/aomusicplayer.h +++ b/include/aomusicplayer.h @@ -2,12 +2,8 @@ #define AOMUSICPLAYER_H #include "file_functions.h" -#if defined(BASSAUDIO) #include "bass.h" #include "bassopus.h" -#elif defined(QTAUDIO) -#include <QMediaPlayer> -#endif #include "aoapplication.h" @@ -44,12 +40,8 @@ private: // Channel 1 = ambience // Channel 2 = extra // Channel 3 = extra - #if defined(BASSAUDIO) HSTREAM m_stream_list[4]; HSYNC loop_sync[4]; - #elif defined(QTAUDIO) - QMediaPlayer m_stream_list[4]; - #endif }; #endif // AOMUSICPLAYER_H diff --git a/include/aooptionsdialog.h b/include/aooptionsdialog.h index 2b8c879b..fe99626a 100644 --- a/include/aooptionsdialog.h +++ b/include/aooptionsdialog.h @@ -46,6 +46,12 @@ private: QCheckBox *ui_downwards_cb; QLabel *ui_length_lbl; QSpinBox *ui_length_spinbox; + QLabel *ui_log_newline_lbl; + QCheckBox *ui_log_newline_cb; + QLabel *ui_log_margin_lbl; + QSpinBox *ui_log_margin_spinbox; + QLabel *ui_log_timestamp_lbl; + QCheckBox *ui_log_timestamp_cb; QFrame *ui_log_names_divider; QLineEdit *ui_username_textbox; QLabel *ui_username_lbl; diff --git a/include/aosfxplayer.h b/include/aosfxplayer.h index 99188719..0a5fffa8 100644 --- a/include/aosfxplayer.h +++ b/include/aosfxplayer.h @@ -1,12 +1,8 @@ #ifndef AOSFXPLAYER_H #define AOSFXPLAYER_H -#if defined(BASSAUDIO) #include "bass.h" #include "bassopus.h" -#elif defined(QTAUDIO) -#include <QSoundEffect> -#endif #include "aoapplication.h" @@ -37,11 +33,7 @@ private: const int m_channelmax = 5; -#if defined(BASSAUDIO) HSTREAM m_stream_list[5]; -#elif defined(QTAUDIO) - QSoundEffect m_stream_list[5]; -#endif }; #endif // AOSFXPLAYER_H diff --git a/include/chatlogpiece.h b/include/chatlogpiece.h index 14d4b349..da78d0da 100644 --- a/include/chatlogpiece.h +++ b/include/chatlogpiece.h @@ -10,14 +10,14 @@ class chatlogpiece { public: chatlogpiece(); chatlogpiece(QString p_name, QString p_showname, QString p_message, - bool p_song,int color); + QString p_action,int color); chatlogpiece(QString p_name, QString p_showname, QString p_message, - bool p_song, int color, QDateTime p_datetime); + QString p_action, int color, QDateTime p_datetime); QString get_name(); QString get_showname(); QString get_message(); - bool is_song(); + QString get_action(); QDateTime get_datetime(); QString get_datetime_as_string(); int get_chat_color(); @@ -27,9 +27,9 @@ private: QString name; QString showname; QString message; + QString action; QDateTime datetime; int color; - bool p_is_song; }; #endif // CHATLOGPIECE_H diff --git a/include/courtroom.h b/include/courtroom.h index 182c2a68..5b5ff6c1 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -109,7 +109,6 @@ public: if (arup_locks.size() > place) arup_locks[place] = value; } - list_areas(); } void character_loading_finished(); @@ -118,7 +117,9 @@ public: void set_widgets(); // sets font size based on theme ini files - void set_font(QWidget *widget, QString class_name, QString p_identifier, QString p_char="", QString font_name="", int f_pointsize=0); + void set_font(QWidget *widget, QString class_name, QString p_identifier, + QString p_char = "", QString font_name = "", + int f_pointsize = 0); // Get the properly constructed font QFont get_qfont(QString font_name, int f_pointsize, bool antialias = true); @@ -128,7 +129,7 @@ public: QColor f_color = Qt::black, bool bold = false); // helper function that calls above function on the relevant widgets - void set_fonts(QString p_char=""); + void set_fonts(QString p_char = ""); // sets dropdown menu stylesheet void set_dropdown(QWidget *widget); @@ -217,11 +218,14 @@ public: QString filter_ic_text(QString p_text, bool colorize = false, int pos = -1, int default_color = 0); + void log_ic_text(QString p_name, QString p_showname, QString p_message, QString p_action="", int p_color=0); + // adds text to the IC chatlog. p_name first as bold then p_text then a newlin // this function keeps the chatlog scrolled to the top unless there's text // selected // or the user isn't already scrolled to the top - void append_ic_text(QString p_text, QString p_name = "", QString action = "", int color = 0); + void append_ic_text(QString p_text, QString p_name = "", QString action = "", + int color = 0); // prints who played the song to IC chat and plays said song(if found on local // filesystem) takes in a list where the first element is the song name and @@ -260,7 +264,6 @@ private: int m_viewport_width = 256; int m_viewport_height = 192; - bool first_message_sent = false; int maximumMessages = 0; QParallelAnimationGroup *screenshake_animation_group = @@ -313,14 +316,23 @@ private: bool rainbow_appended = false; bool blank_blip = false; - // Whether or not is this message additive to the previous one - bool is_additive = false; - // Used for getting the current maximum blocks allowed in the IC chatlog. int log_maximum_blocks = 0; // True, if the log should go downwards. - bool log_goes_downwards = false; + bool log_goes_downwards = true; + + // True, if log should display colors. + bool log_colors = true; + + // True, if the log should display the message like name<br>text instead of name: text + bool log_newline = false; + + // Margin in pixels between log entries for the IC log. + int log_margin = 0; + + // True, if the log should have a timestamp. + bool log_timestamp = false; // delay before chat messages starts ticking QTimer *text_delay_timer; @@ -349,9 +361,10 @@ private: // amount by which we multiply the delay when we parse punctuation chars const int punctuation_modifier = 3; - static const int chatmessage_size = 30; - QString m_chatmessage[chatmessage_size]; - bool chatmessage_is_empty = false; + // Minumum and maximum number of parameters in the MS packet + static const int MS_MINIMUM = 15; + static const int MS_MAXIMUM = 30; + QString m_chatmessage[MS_MAXIMUM]; QString previous_ic_message = ""; QString additive_previous = ""; @@ -458,6 +471,14 @@ private: QString current_background = "default"; QString current_side = ""; + QBrush free_brush; + QBrush lfp_brush; + QBrush casing_brush; + QBrush recess_brush; + QBrush rp_brush; + QBrush gaming_brush; + QBrush locked_brush; + AOMusicPlayer *music_player; AOSfxPlayer *sfx_player; AOSfxPlayer *objection_player; @@ -639,6 +660,10 @@ private: void refresh_evidence(); void set_evidence_page(); + void reset_ic(); + void reset_ui(); + + void regenerate_ic_chatlog(); public slots: void objection_done(); void preanim_done(); @@ -803,8 +828,6 @@ private slots: void on_casing_clicked(); void ping_server(); - - void load_bass_opus_plugin(); }; #endif // COURTROOM_H |
