From 96fcb75c4c836887c80af3ddc1b4c8e1d4622abb Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Tue, 12 Jan 2021 13:46:39 +0300 Subject: Make sure blankposts are properly displayed unless repeats, playing nice with view desync --- include/courtroom.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/courtroom.h') diff --git a/include/courtroom.h b/include/courtroom.h index 92b5a03c..46da7a32 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -349,6 +349,7 @@ private: QVector arup_locks; QVector ic_chatlog_history; + int ic_chatlog_current = -1; QQueue chatmessage_queue; -- cgit From 147892bae917ea1f99fba312db87a31140b3ba37 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Thu, 14 Jan 2021 01:34:20 +0300 Subject: Overhaul sound lists to introduce aliases, rethink editing behavior (#389) * Resolve https://github.com/AttorneyOnline/AO2-Client/issues/275 by adding a "Nothing" option to play no SFX even when playing a preanimation that behaves similar to the Default option * Overhaul sound list: * Allow aliases. .ini file syntax is "filename = alias". * Do not allow editing the .ini files from the client anymore. * The sound list dropdown is still editable, but all it does is play your custom sfx without adding it to any files. * Overhaul get_char_sfx * Fix aliases not working properly with a rather tricky solution * save character soundlist in base and drop the character_ from the filename Co-authored-by: stonedDiscord <10584181+stonedDiscord@users.noreply.github.com> --- include/courtroom.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/courtroom.h') diff --git a/include/courtroom.h b/include/courtroom.h index 92b5a03c..d7bd6966 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -503,6 +503,12 @@ private: // List of all currently available pos QStringList pos_dropdown_list; + // Current list file sorted line by line + QStringList sound_list; + + // Current SFX the user put in for the sfx dropdown list + QString custom_sfx = ""; + // is the message we're about to send supposed to present evidence? bool is_presenting_evidence = false; @@ -804,6 +810,7 @@ private slots: void on_iniswap_remove_clicked(); void on_sfx_dropdown_changed(int p_index); + void on_sfx_dropdown_custom(QString p_sfx); void set_sfx_dropdown(); void on_sfx_context_menu_requested(const QPoint &pos); void on_sfx_edit_requested(); -- cgit From ea94644cf5bbd11f507b318677a7360433a0ae92 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Mon, 18 Jan 2021 17:56:21 +0300 Subject: Attempt a theoretically safer method of tracking last displayed message --- 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 46da7a32..92b5a03c 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -349,7 +349,6 @@ private: QVector arup_locks; QVector ic_chatlog_history; - int ic_chatlog_current = -1; QQueue chatmessage_queue; -- cgit From 78777391467556b1312a00bdf1618619f771476e Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Mon, 18 Jan 2021 18:54:11 +0300 Subject: Simplify the logic behind last message = blankpost detection I need to stop overcomplicating things. --- include/courtroom.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/courtroom.h') diff --git a/include/courtroom.h b/include/courtroom.h index 92b5a03c..4cf42e1e 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -349,6 +349,7 @@ private: QVector arup_locks; QVector ic_chatlog_history; + QString last_ic_message = ""; QQueue chatmessage_queue; -- cgit From d41ec17fe72dbcf1b5277ab7b33b6374a9fb9e60 Mon Sep 17 00:00:00 2001 From: in1tiate <32779090+in1tiate@users.noreply.github.com> Date: Mon, 18 Jan 2021 14:10:45 -0600 Subject: Add a new "char_list" QTreeWidget that allows for categorizing characters (#399) * initial commit * use a "category" value instead * add filtering and taken indicator * hide serverlist header * set the items to disabled in place of the [X] text Co-authored-by: stonedDiscord <10584181+stonedDiscord@users.noreply.github.com> --- include/courtroom.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/courtroom.h') diff --git a/include/courtroom.h b/include/courtroom.h index 31b90c90..e86330e6 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -715,6 +715,9 @@ private: AOImage *ui_char_select_background; + // pretty list of characters + QTreeWidget *ui_char_list; + // abstract widget to hold char buttons QWidget *ui_char_buttons; @@ -908,6 +911,7 @@ private slots: void on_back_to_lobby_clicked(); + void on_char_list_double_clicked(QTreeWidgetItem *p_item, int column); void on_char_select_left_clicked(); void on_char_select_right_clicked(); void on_char_search_changed(); -- cgit From 894b2b2a0e6bb2744e92a2d8ed363a39d7ae59b1 Mon Sep 17 00:00:00 2001 From: in1tiate <32779090+in1tiate@users.noreply.github.com> Date: Tue, 19 Jan 2021 05:32:11 -0600 Subject: Consolidate AOScene, AOMovie, and AOCharMovie into one class, add support for (c) animations, implement emote continuity, add scaling overrides to all layer types, allow for stretch-to-fill images, allow for additional effect configuration (#302) * Rewrite AOScene and remove the need for AOMovie and AOCharMovie by consolidation * Rename AOScene to AOLayer, apply suggestions to improve functionality * Implement suggested change to allocation * Switch from pointer to field, fix ui_vp_player_char not resetting play_once * Use the variable gif_name instead of the string "gif_name" Oops. * Total rewrite of AOLayer (again) * Add support for (c) animations, do some housekeeping * allow themes to override misc chatboxes * add support for pulling InterfaceLayer elements from theme/misc * mistakes were made * move all frame fx functionality to CharLayer subclass * virtual functions are cool mkay * remove evidence of my incompetence * allow themes to override font design inis under theme/misc * Proper support for theme/misc chatbox, fixes * Fix chatbox dimensions not updating and inline color causing missingnos * rename chat markdown to chat markup * add missing misc overrides * quick hotfix for chatblank and misc overrides * Fix oversight with backgrounds causing them to be culled * Same as last commit but for FG layer * amend comment to explain impossible shenanigans * Adjust ForegroundLayer to take charname rather than miscname, allow for checking in char folder * fix an incredibly embarrassing pathing bug * add scaling overrides for all layer types, parent orphaned viewport elements to the viewport * stupid fix because themes use "custom.png" as a button * switch to .append() * Revert "Merge branch 'aoscene_rewrite' of https://github.com/AttorneyOnline/AO2-Client into aoscene_rewrite" This reverts commit bdeb1bff7639d522031aab3c133a83b0e2a291df, reversing changes made to 125ee63b97a6f6c156e69525d88fddc625e7a978. * switch to .append() (again) * move function call to fix showname length calculation error * fix nonlooping character animations being broken Again * unparent elements from the viewport and do fancy masking arithmetic instead * use override keyword * move scaling override to char.ini, allow stretching, restructure effect property loading * fix some redundancy * unparent chat_arrow from chatbox to prevent accidental masking * at no point do we want a frozen gif to display * overhaul how wtce is handled * oops * also let sounds be pulled from theme miscs * i should probably compile before i push * actually make it work * don't check a default bg * readd 1x1 stretch thing * actually the 1x1 thing was a bad idea * Add missing parenthesis * Use load_image instead of play play is a nonexistent method now * Remote shout_message and usages because it does nothing * Remove multiple redefinitions * Add in missing brackets and indent to fix build I have know idea what this does but it brings fear * fix build error * fix chat arrow and remove duped code * remove more duped code and fix misc themes * only update chat_arrow when needed * consolidate log_chatmessage and display_log_chatmessage Co-authored-by: scatterflower Co-authored-by: Skye Deving <76892045+skyedeving@users.noreply.github.com> Co-authored-by: oldmud0 --- include/courtroom.h | 69 +++++++++++++++++++++++++++++++---------------------- 1 file changed, 40 insertions(+), 29 deletions(-) (limited to 'include/courtroom.h') diff --git a/include/courtroom.h b/include/courtroom.h index e86330e6..5ad6fa61 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -5,17 +5,15 @@ #include "aoblipplayer.h" #include "aobutton.h" #include "aocharbutton.h" -#include "aocharmovie.h" #include "aoemotebutton.h" #include "aoevidencebutton.h" #include "aoevidencedisplay.h" #include "aoimage.h" +#include "aolayer.h" #include "aolineedit.h" -#include "aomovie.h" #include "aomusicplayer.h" #include "aooptionsdialog.h" #include "aopacket.h" -#include "aoscene.h" #include "aosfxplayer.h" #include "aotextarea.h" #include "aotextedit.h" @@ -151,6 +149,9 @@ public: // reads theme inis and sets size and pos based on the identifier void set_size_and_pos(QWidget *p_widget, QString p_identifier); + // reads theme and char inis and sets size and pos based on the identifier + void set_size_and_pos(QWidget *p_widget, QString p_identifier, QString p_char); + // reads theme inis and returns the size and pos as defined by it QPoint get_theme_pos(QString p_identifier); @@ -224,11 +225,13 @@ public: // Parse the chat message packet and unpack it into the m_chatmessage[ITEM] format void unpack_chatmessage(QStringList p_contents); - // Log the message contents and information such as evidence presenting etc. into the log file - void log_chatmessage(QString f_message, int f_char_id, QString f_showname = "", int f_color = 0); - - // Display the message contents and information such as evidence presenting etc. in the IC logs - void display_log_chatmessage(QString f_message, int f_char_id, QString f_showname = "", int f_color = 0); + enum LogMode { + IO_ONLY, + DISPLAY_ONLY, + DISPLAY_AND_IO + }; + // Log the message contents and information such as evidence presenting etc. into the log file, the IC log, or both. + void log_chatmessage(QString f_message, int f_char_id, QString f_showname = "", int f_color = 0, LogMode f_log_mode=IO_ONLY); // Log the message contents and information such as evidence presenting etc. into the IC logs void handle_callwords(); @@ -264,7 +267,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); + 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 @@ -380,7 +384,8 @@ private: // 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 + // True, if the log should display the message like name
text instead of + // name: text bool log_newline = false; // True, if the log should include RP actions like interjections, showing evidence, etc. @@ -408,16 +413,21 @@ private: const int time_mod = 40; // the amount of time non-animated objection/hold it/takethat images stay - // onscreen for in ms - const int shout_stay_time = 724; + // onscreen for in ms, and the maximum amount of time any interjections are + // allowed to play + const int shout_static_time = 724; + const int shout_max_time = 1500; // the amount of time non-animated guilty/not guilty images stay onscreen for - // in ms - const int verdict_stay_time = 3000; + // in ms, and the maximum amount of time g/ng images are allowed to play + const int verdict_static_time = 3000; + const int verdict_max_time = 4000; // the amount of time non-animated witness testimony/cross-examination images - // stay onscreen for in ms - const int wtce_stay_time = 1500; + // stay onscreen for in ms, and the maximum time any wt/ce image is allowed to + // play + const int wtce_static_time = 1500; + const int wtce_max_time = 4000; // characters we consider punctuation const QString punctuation_chars = ".,?!:;"; @@ -441,7 +451,7 @@ private: bool is_muted = false; // state of animation, 0 = objecting, 1 = preanim, 2 = talking, 3 = idle, 4 = - // noniterrupting preanim + // noniterrupting preanim, 5 = (c) animation int anim_state = 3; // whether or not current color is a talking one @@ -512,6 +522,7 @@ private: // is the message we're about to send supposed to present evidence? bool is_presenting_evidence = false; + bool c_played = false; // whether we've played a (c)-style postanimation yet // have we already presented evidence for this message? bool evidence_presented = false; @@ -579,21 +590,20 @@ private: AOImage *ui_background; QWidget *ui_viewport; - AOScene *ui_vp_background; - AOMovie *ui_vp_speedlines; - AOCharMovie *ui_vp_player_char; - AOCharMovie *ui_vp_sideplayer_char; - AOScene *ui_vp_desk; - AOScene *ui_vp_legacy_desk; + BackgroundLayer *ui_vp_background; + ForegroundLayer *ui_vp_speedlines; + CharLayer *ui_vp_player_char; + CharLayer *ui_vp_sideplayer_char; + BackgroundLayer *ui_vp_desk; AOEvidenceDisplay *ui_vp_evidence_display; AOImage *ui_vp_chatbox; QLabel *ui_vp_showname; - AOMovie *ui_vp_chat_arrow; + InterfaceLayer *ui_vp_chat_arrow; QTextEdit *ui_vp_message; - AOMovie *ui_vp_effect; - AOMovie *ui_vp_testimony; - AOMovie *ui_vp_wtce; - AOMovie *ui_vp_objection; + EffectLayer *ui_vp_effect; + InterfaceLayer *ui_vp_testimony; + InterjectionLayer *ui_vp_wtce; + InterjectionLayer *ui_vp_objection; QTextEdit *ui_ic_chatlog; @@ -605,7 +615,7 @@ private: QTreeWidget *ui_music_list; ScrollText *ui_music_name; - AOMovie *ui_music_display; + InterfaceLayer *ui_music_display; AOButton *ui_pair_button; QListWidget *ui_pair_list; @@ -759,6 +769,7 @@ private: void regenerate_ic_chatlog(); public slots: void objection_done(); + void effect_done(); void preanim_done(); void do_screenshake(); void do_flash(); -- cgit From 0926f3c15842a71002c0ec374fd54832469036d8 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Tue, 19 Jan 2021 16:02:28 +0300 Subject: Implement sticker logic with animated image support (#414) * Implement sticker logic with animated image support (will probably be remade in a much better way for AOLayers) * port to aolayer Co-authored-by: in1tiate --- 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 5ad6fa61..f12b47f7 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -617,6 +617,8 @@ private: ScrollText *ui_music_name; InterfaceLayer *ui_music_display; + StickerLayer *ui_vp_sticker; + AOButton *ui_pair_button; QListWidget *ui_pair_list; QSpinBox *ui_pair_offset_spinbox; -- cgit