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 --- src/packet_distribution.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/packet_distribution.cpp') diff --git a/src/packet_distribution.cpp b/src/packet_distribution.cpp index 1c881201..1053c20e 100644 --- a/src/packet_distribution.cpp +++ b/src/packet_distribution.cpp @@ -493,8 +493,10 @@ void AOApplication::server_packet_received(AOPacket *p_packet) w_courtroom->enter_courtroom(); - if (courtroom_constructed) + if (courtroom_constructed) { + w_courtroom->set_courtroom_size(); w_courtroom->update_character(f_contents.at(2).toInt()); + } } else if (header == "MS") { if (courtroom_constructed && courtroom_loaded) -- 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 --- src/packet_distribution.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/packet_distribution.cpp') diff --git a/src/packet_distribution.cpp b/src/packet_distribution.cpp index 1053c20e..b2e5d3ed 100644 --- a/src/packet_distribution.cpp +++ b/src/packet_distribution.cpp @@ -462,6 +462,7 @@ void AOApplication::server_packet_received(AOPacket *p_packet) goto end; if (courtroom_constructed) { + qDebug() << f_contents; if (f_contents.size() >= 2) // We have a pos included in the background packet! w_courtroom->set_side(f_contents.at(1)); @@ -475,7 +476,7 @@ void AOApplication::server_packet_received(AOPacket *p_packet) if (courtroom_constructed) // We were sent a "set position" packet { - w_courtroom->set_side(f_contents.at(0), false); + w_courtroom->set_side(f_contents.at(0)); append_to_demofile(p_packet->to_string(true)); } } -- cgit