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/courtroom.h') 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 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/courtroom.h') 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 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/courtroom.h') 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/courtroom.h') 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/courtroom.h') 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 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/courtroom.h') 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