From 97cb8cf1929302ebe4cad460cce31a0b0ecc3119 Mon Sep 17 00:00:00 2001 From: in1tiate Date: Sun, 14 Feb 2021 19:21:49 -0600 Subject: [PATCH 1/3] fix bg not resizing on reload theme --- include/aolayer.h | 3 +++ src/aolayer.cpp | 10 ++++++++++ src/courtroom.cpp | 2 ++ 3 files changed, 15 insertions(+) diff --git a/include/aolayer.h b/include/aolayer.h index c32da02..1984b77 100644 --- a/include/aolayer.h +++ b/include/aolayer.h @@ -64,6 +64,9 @@ public: // Stop the movie, clearing the image void stop(); + // Stop the movie and clear all vectors + void kill(); + // Set the m_flipped variable to true/false void set_flipped(bool p_flipped) { m_flipped = p_flipped; } diff --git a/src/aolayer.cpp b/src/aolayer.cpp index 2fac58b..e766495 100644 --- a/src/aolayer.cpp +++ b/src/aolayer.cpp @@ -493,6 +493,16 @@ void AOLayer::freeze() preanim_timer->stop(); } +void AOLayer::kill() +{ + // used for when we want to ensure a file is loaded anew + this->stop(); + this->clear(); + movie_frames.clear(); + movie_delays.clear(); + last_path = ""; +} + void CharLayer::movie_ticker() { AOLayer::movie_ticker(); diff --git a/src/courtroom.cpp b/src/courtroom.cpp index 16ec73e..76431e5 100644 --- a/src/courtroom.cpp +++ b/src/courtroom.cpp @@ -1299,6 +1299,8 @@ void Courtroom::set_background(QString p_background, bool display) ui_vp_objection->stop(); chat_tick_timer->stop(); ui_vp_evidence_display->reset(); + ui_vp_background->kill(); + ui_vp_desk->kill(); set_scene( QString::number(ao_app->get_desk_mod(current_char, current_emote)), current_side); From 68851a16aa417d2b942bf36b207242f800149fe7 Mon Sep 17 00:00:00 2001 From: in1tiate Date: Sun, 14 Feb 2021 19:22:05 -0600 Subject: [PATCH 2/3] fix objection prematurely adjusting chatbox --- src/courtroom.cpp | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/courtroom.cpp b/src/courtroom.cpp index 76431e5..4353e5c 100644 --- a/src/courtroom.cpp +++ b/src/courtroom.cpp @@ -2199,17 +2199,7 @@ bool Courtroom::handle_objection() objection_mod = m_chatmessage[OBJECTION_MOD].toInt(); } - if (is_ao2_bg) { - set_size_and_pos(ui_vp_chatbox, "ao2_chatbox", m_chatmessage[CHAR_NAME]); - } - else { - set_size_and_pos(ui_vp_chatbox, "chatbox", m_chatmessage[CHAR_NAME]); - } - set_size_and_pos(ui_vp_showname, "showname", m_chatmessage[CHAR_NAME]); - set_size_and_pos(ui_vp_message, "message", m_chatmessage[CHAR_NAME]); - ui_vp_message->move(ui_vp_message->x() + ui_vp_chatbox->x(), - ui_vp_message->y() + ui_vp_chatbox->y()); - ui_vp_message->setTextInteractionFlags(Qt::NoTextInteraction); + // if an objection is used if (objection_mod <= 4 && objection_mod >= 1) { @@ -2557,6 +2547,18 @@ void Courtroom::initialize_chatbox() ui_vp_showname->setText(m_chatmessage[SHOWNAME]); } + if (is_ao2_bg) { + set_size_and_pos(ui_vp_chatbox, "ao2_chatbox", m_chatmessage[CHAR_NAME]); + } + else { + set_size_and_pos(ui_vp_chatbox, "chatbox", m_chatmessage[CHAR_NAME]); + } + set_size_and_pos(ui_vp_showname, "showname", m_chatmessage[CHAR_NAME]); + set_size_and_pos(ui_vp_message, "message", m_chatmessage[CHAR_NAME]); + ui_vp_message->move(ui_vp_message->x() + ui_vp_chatbox->x(), + ui_vp_message->y() + ui_vp_chatbox->y()); + ui_vp_message->setTextInteractionFlags(Qt::NoTextInteraction); + QString customchar; if (ao_app->is_customchat_enabled()) customchar = m_chatmessage[CHAR_NAME]; From 9359ae290953d3dbbdc5dcec79909d1481f2617f Mon Sep 17 00:00:00 2001 From: in1tiate Date: Sun, 14 Feb 2021 19:24:26 -0600 Subject: [PATCH 3/3] fix testimony indicator not reappearing --- src/courtroom.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/courtroom.cpp b/src/courtroom.cpp index 4353e5c..b9ca070 100644 --- a/src/courtroom.cpp +++ b/src/courtroom.cpp @@ -3803,7 +3803,7 @@ void Courtroom::handle_wtce(QString p_wtce, int variant) if (p_wtce == "testimony1") { // End testimony indicator if (variant == 1) { - ui_vp_testimony->stop(); + ui_vp_testimony->kill(); return; } sfx_name = ao_app->get_court_sfx("witnesstestimony", bg_misc); @@ -3814,7 +3814,7 @@ void Courtroom::handle_wtce(QString p_wtce, int variant) else if (p_wtce == "testimony2") { sfx_name = ao_app->get_court_sfx("crossexamination", bg_misc); filename = "crossexamination"; - ui_vp_testimony->stop(); + ui_vp_testimony->kill(); } else { ui_vp_wtce->set_static_duration(verdict_static_time); @@ -3824,12 +3824,12 @@ void Courtroom::handle_wtce(QString p_wtce, int variant) if (variant == 0) { sfx_name = ao_app->get_court_sfx("notguilty", bg_misc); filename = "notguilty"; - ui_vp_testimony->stop(); + ui_vp_testimony->kill(); } else if (variant == 1) { sfx_name = ao_app->get_court_sfx("guilty", bg_misc); filename = "guilty"; - ui_vp_testimony->stop(); + ui_vp_testimony->kill(); } } // Completely custom WTCE