From 5063880530c98d17e6d15a888f7c4a8462351e52 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Tue, 16 Feb 2021 11:04:07 +0300 Subject: Patch a segfault by play_frame_effect being wacky Split behavior for courtroom resizing into its own function Use that function to optimize character changing screen Fix reload theme breaking the background positioning Fix changing character breaking the background positioning Fix excessive set_widgets() calls that caused unnecessary lag Fix unnecessary set_size_and_pos calls that didn't need to be there Only call size_and_pos on the chatbox in the initialize_chatbox func Remove checks for a boolean that will always be true Simplify two functions that copy-paste code called set_size_and_pos into a single one Fix "disable custom chat" setting not being used when setting chat sizes and pos --- include/courtroom.h | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'include') diff --git a/include/courtroom.h b/include/courtroom.h index eb1aa7b..69dd58e 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -121,6 +121,9 @@ public: void character_loading_finished(); + // + void set_courtroom_size(); + // sets position of widgets based on theme ini files void set_widgets(); @@ -147,11 +150,8 @@ public: void set_window_title(QString p_title); - // 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 and sets size and pos based on the identifier (using p_misc if provided) + void set_size_and_pos(QWidget *p_widget, QString p_identifier, QString p_misc=""); // reads theme inis and returns the size and pos as defined by it QPoint get_theme_pos(QString p_identifier); @@ -576,10 +576,6 @@ private: int evidence_rows = 3; int max_evidence_on_page = 18; - // is set to true if the bg folder contains defensedesk.png, - // prosecutiondesk.png and stand.png - bool is_ao2_bg = false; - // whether the ooc chat is server or master chat, true is server bool server_ooc = true; -- cgit From 63128fea1362b0fe2388ff0b85b9f1120806b332 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Tue, 16 Feb 2021 11:20:54 +0300 Subject: Stop supporting the DRO way (we will make a .bat file or utility that does it for you automatically instead!) Add an option to enable/disable stickers Make stickers actually respect the custom chatbox setting properly --- include/aoapplication.h | 3 +++ include/aooptionsdialog.h | 3 +++ 2 files changed, 6 insertions(+) (limited to 'include') diff --git a/include/aoapplication.h b/include/aoapplication.h index cd9f736..2dc8649 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -228,6 +228,9 @@ public: // for settings. bool is_customchat_enabled(); + // Returns the value of characer sticker (avatar) setting + bool is_sticker_enabled(); + // Returns the value of whether continuous playback should be used // from the config.ini. bool is_continuous_enabled(); diff --git a/include/aooptionsdialog.h b/include/aooptionsdialog.h index 31f3d66..e88ce54 100644 --- a/include/aooptionsdialog.h +++ b/include/aooptionsdialog.h @@ -108,6 +108,9 @@ private: QLabel *ui_customchat_lbl; QCheckBox *ui_customchat_cb; + QLabel *ui_sticker_lbl; + QCheckBox *ui_sticker_cb; + QLabel *ui_continuous_lbl; QCheckBox *ui_continuous_cb; -- cgit From b5f581eb5b336273c3e7976ac8f7c438fe454bb4 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Wed, 17 Feb 2021 15:15:40 +0300 Subject: Revert bad "fix" of the sound names for WTCE courtroom_sounds.ini Make pos dropdown ui editable for a custom pos Keep track of the custom pos index On switching from the custom pos, remove the entry at that index Fix regression causing the "sort by name" lobby server list header disappearing Expose column 0 for the # in the lobby server list header ("too ugly" just use lobby_stylesheets.css and pretty it up) --- include/courtroom.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/courtroom.h b/include/courtroom.h index 69dd58e..d1395e1 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -581,6 +581,7 @@ private: QString current_background = "default"; QString current_side = ""; + int temp_side_index = -1; QBrush free_brush; QBrush lfp_brush; -- cgit From f881df241533dafc214f72983d9c6e1c59837891 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Wed, 17 Feb 2021 15:29:18 +0300 Subject: Make the server list display all pretty and nice Resize the 0thcolumn to smallest possible size so it's not intrusive Remove text eliding so numbers don't get ...'s --- include/lobby.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/lobby.h b/include/lobby.h index 4278534..ca2b88b 100644 --- a/include/lobby.h +++ b/include/lobby.h @@ -17,6 +17,7 @@ #include #include +#include class AOApplication; -- cgit From 7246965e00e1ffb5b91517aa6d58e17a664d6454 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Wed, 17 Feb 2021 15:47:54 +0300 Subject: Adopt better method for setting custom pos using the pos dropdown Make it actually work properly --- include/courtroom.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/courtroom.h b/include/courtroom.h index d1395e1..98d4df9 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -581,7 +581,6 @@ private: QString current_background = "default"; QString current_side = ""; - int temp_side_index = -1; QBrush free_brush; QBrush lfp_brush; @@ -835,6 +834,7 @@ private slots: void on_emote_dropdown_changed(int p_index); void on_pos_dropdown_changed(int p_index); + void on_pos_dropdown_changed(QString p_text); void on_pos_remove_clicked(); void on_iniswap_dropdown_changed(int p_index); -- cgit From aa790dbc4b22badabbbc30bd1fb70668d0682ece Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Fri, 19 Feb 2021 11:20:38 +0300 Subject: Overhaul pos dropdown and pos remove system to work well with custom pos, char pos etc. Remove accidental duplicate code Fix some genius using & instead of && (SMH) Block pos_dropdown signals better --- include/courtroom.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/courtroom.h b/include/courtroom.h index 98d4df9..bba38b6 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -165,7 +165,7 @@ public: void set_background(QString p_background, bool display = false); // sets the local character pos/side to use. - void set_side(QString p_side, bool block_signals=true); + void set_side(QString p_side); // sets the pos dropdown void set_pos_dropdown(QStringList pos_dropdowns); -- cgit From 37011fc22d2d821f5370e21b626dc295a002defa Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Sun, 21 Feb 2021 15:50:34 +0300 Subject: Remove background-color stylesheet from the set_qfont (allowing stylesheets to properly initialize custom backgrounds for labels w/ transparent ones) rename "set_dropdown_ to "set_stylesheet" cuz that's what it is --- include/courtroom.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/courtroom.h b/include/courtroom.h index bba38b6..2e007d2 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -143,10 +143,10 @@ public: void set_fonts(QString p_char = ""); // sets dropdown menu stylesheet - void set_dropdown(QWidget *widget); + void set_stylesheet(QWidget *widget); // helper funciton that call above function on the relevant widgets - void set_dropdowns(); + void set_stylesheets(); void set_window_title(QString p_title); -- cgit From 679dcca0792650f3a2899af8009846fdc289c9ba Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Sun, 21 Feb 2021 16:18:45 +0300 Subject: Remove hardcoded stylesheets from lobby Stop doing the "tagget stylesheets" monstrosity --- include/lobby.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/lobby.h b/include/lobby.h index ca2b88b..0f066ab 100644 --- a/include/lobby.h +++ b/include/lobby.h @@ -33,7 +33,7 @@ public: void append_chatmessage(QString f_name, QString f_message); void append_error(QString f_message); void set_player_count(int players_online, int max_players); - void set_stylesheet(QWidget *widget, QString target_tag); + void set_stylesheet(QWidget *widget); void set_stylesheets(); void set_fonts(); void set_font(QWidget *widget, QString p_identifier); -- cgit From 5ac95ada564f11419441eca32907aef7ec16dd90 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Wed, 24 Feb 2021 16:02:07 +0300 Subject: Make "stop music on objection" work in tandem with the server by calling "music_stop()" instead of only working on the client-side --- include/courtroom.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/courtroom.h b/include/courtroom.h index 2e007d2..6a64deb 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -822,7 +822,7 @@ private slots: void music_random(); void music_list_expand_all(); void music_list_collapse_all(); - void music_stop(); + void music_stop(bool no_effects = false); void on_area_list_double_clicked(QTreeWidgetItem *p_item, int column); void select_emote(int p_id); -- cgit