From 8b44d4ae9599a90579c4fb974fab1704ace8d131 Mon Sep 17 00:00:00 2001 From: scatterflower Date: Sat, 15 Aug 2020 19:40:52 -0500 Subject: Only regenerate the area list once per ARUP packet --- include/courtroom.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include/courtroom.h') diff --git a/include/courtroom.h b/include/courtroom.h index 182c2a68..e7a51d37 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(); -- cgit From 102ca4d64143ecb9401fdb1627ada00194d58dd1 Mon Sep 17 00:00:00 2001 From: scatterflower Date: Sat, 15 Aug 2020 19:47:24 -0500 Subject: Create brushes for area list once --- include/courtroom.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include/courtroom.h') diff --git a/include/courtroom.h b/include/courtroom.h index e7a51d37..f1cb0265 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -457,6 +457,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; -- cgit From 11250e13864dc5e3cdd799b02498905c58db55ea Mon Sep 17 00:00:00 2001 From: scatterflower Date: Sun, 16 Aug 2020 06:50:19 -0500 Subject: Ensure consistent behavior in IC log, clarify showname logic, and define constants for minimum and maximum packet sizes --- include/courtroom.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include/courtroom.h') diff --git a/include/courtroom.h b/include/courtroom.h index 182c2a68..6132ed9c 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -349,8 +349,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]; + // 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]; bool chatmessage_is_empty = false; QString previous_ic_message = ""; -- cgit From 1c5b097f654d16e0dde47f7ae62d236427077cb7 Mon Sep 17 00:00:00 2001 From: scatterflower Date: Sun, 16 Aug 2020 12:43:26 -0500 Subject: further cleanup of chat handler --- 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 a4bacc22..ca271a49 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -648,6 +648,8 @@ private: void refresh_evidence(); void set_evidence_page(); + void reset_ic(); + void reset_ui(); public slots: void objection_done(); void preanim_done(); -- cgit From ecb0ee42a3a399c092eafdf2ac60faaad4bf119f Mon Sep 17 00:00:00 2001 From: scatterflower Date: Sun, 16 Aug 2020 21:59:44 -0500 Subject: clang format --- include/courtroom.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'include/courtroom.h') diff --git a/include/courtroom.h b/include/courtroom.h index ca271a49..898e8bab 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -117,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); @@ -127,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); @@ -220,7 +222,8 @@ public: // 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 -- cgit From 475a572c3bdb0f1d4a7353b9c61bbfac71888ef9 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Tue, 18 Aug 2020 18:02:53 +0300 Subject: Improved blankposting (#256) * Consolidate blankposting into singular log entries of "no message" instead of spamming the logs repeatedly when someone decides to keep switching emotes Return proper blankpost checking to 2.8.5 (chatmessage_is_empty bool makes sure the chatbox doesn't appear - branch broke that behavior by never setting it) More robust blankpost checking, meaning that passing a competely empty "" string will also count as a blankpost Fix screenshake not working with blankposting by moving it before the chatmessage_is_empty check in start_chack_ticking() stage of the message parsing * Allow user to send blankposts without even having to input a single spacebar, but only if last m_chatmessage CID matches ours. * Reviews are cool and good:ok_hand: allow sending no-text chat message to server without weird cid checks (let the server validate if they want to do STR_OR_EMPTY or just STR) - doesn't break existing behavior and lets servers introduce the new one if they want to Treat all blank/whitespace messages as blankposting and not just single-whitespace. Remove chatmessage_is_empty bool because why the fuck would you even need it if you have m_chatmessage[MESSAGE] already Simplify chatlogpiece log entry to not be a *temp pointer by suggestion * another useless bool destroyed Make "additive" have a very awesome emergent behavior with blankposting - keep showing the chatbox+message while only changing the emotes. Works with preanims too! --- include/courtroom.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'include/courtroom.h') diff --git a/include/courtroom.h b/include/courtroom.h index 898e8bab..df75cce5 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -315,9 +315,6 @@ 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; @@ -355,7 +352,6 @@ private: static const int MS_MINIMUM = 15; static const int MS_MAXIMUM = 30; QString m_chatmessage[MS_MAXIMUM]; - bool chatmessage_is_empty = false; QString previous_ic_message = ""; QString additive_previous = ""; -- cgit From cef0ebc6eb2ac549a5475bee332be35ab7f565fc Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Wed, 19 Aug 2020 19:16:41 +0300 Subject: IC log rewrite (#259) * Rewrite the IC Log code to drastically reduce code duplication and have both downward and upward mode in the same function Regenerate the IC Log in set_widgets() function, making sure the maximum_blocks is accounted for and clearing the log to prepare for different log mode (upwards/downwards) if it's different from previous Add placeholder text telling the user the direction in which the log will go Remove useless first_message_sent global boolean, a remnant from a w e a k e r c o d e r m a n * Add log_colors boolean to reduce color I/O happening in append_ic_text (optimization meme) Clear the IC log when log_colors setting changes and reload theme is pressed Fix https://github.com/AttorneyOnline/AO2-Client/issues/221 * Add configurable margin between IC log entries Add configurable newline/singleline log mode Options in settings for these * Add optional timestamps * Un-hardcode "played music" from the chatlogpiece and introduce the "action" argument so that "presented evidence" is fully supported now Translate "has presented evidence" Regenerate IC chatlog instead of clearing it, properly updating every element with the new configurations * Go away *temp, code duplication making me shid and cry rn Why is this not done in append_ic_text, or why isn't there a dedicated ic logging func aAAAaaaaAAAaa Fix presenting evidence not being properly logged Fix timestamp being UTC instead of local time (local time will not be as confusing) * okok it was a joke a big ol bamboozle you got gnomed haha rick rolled beaned stickbugged I did NOT copy paste code, no, I actually intended to fix copy pasted code all along. log_ic_text was always planned. (Fix copypasted code for ic_chatlog_history and consolidate it into a single log_ic_text func) --- include/courtroom.h | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'include/courtroom.h') diff --git a/include/courtroom.h b/include/courtroom.h index df75cce5..979650a3 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -218,6 +218,8 @@ 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 @@ -262,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 = @@ -319,7 +320,19 @@ private: 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
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; @@ -649,6 +662,8 @@ private: void reset_ic(); void reset_ui(); + + void regenerate_ic_chatlog(); public slots: void objection_done(); void preanim_done(); -- cgit From 9eb0f53db1ae87058458eae267f2a72e3a0a8091 Mon Sep 17 00:00:00 2001 From: scatterflower <2956568+scatterflower@users.noreply.github.com> Date: Wed, 19 Aug 2020 16:40:37 -0500 Subject: Reset BASS when switching devices; drop Qt Multimedia support (#262) * Allow changing audio device on the fly while in a server * Use default audio device if device in config doesn't exist * Automatically change audio device to default when current one is invalid * Destroy Qt Multimedia support It was decided that there was not enough attention being given to Qt Multimedia support to justify its continued maintenance simply as a libre alternative to BASS. While substantial changes to audio were being made in 2.8, the Qt Multimedia support code fell behind in disrepair. It's clear that there is no vested interest in implementing audio features twice for the sake of licensing. When it's time to switch to another audio library, it will be done unilaterally. * CI: Use BASS for Linux build Co-authored-by: oldmud0 --- include/courtroom.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include/courtroom.h') diff --git a/include/courtroom.h b/include/courtroom.h index 979650a3..5b5ff6c1 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -828,8 +828,6 @@ private slots: void on_casing_clicked(); void ping_server(); - - void load_bass_opus_plugin(); }; #endif // COURTROOM_H -- cgit