aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeifa <26681464+TrickyLeifa@users.noreply.github.com>2024-05-26 20:49:12 +0200
committerGitHub <noreply@github.com>2024-05-26 20:49:12 +0200
commit67d5646d7c58eb0700d262672c5cf009d90969bf (patch)
treedb6e8171d6f2818dcbe02554b6c3e58750168901
parent4ec2a2efbbb555780653adb4e904a38799b7a4ae (diff)
parentf09ff7fc519bac1731ae8820640e61601ac0b0e0 (diff)
Merge pull request #974 from AttorneyOnline/slide-fixes
Fix pair layer not being hidden correctly
-rw-r--r--src/courtroom.cpp53
1 files changed, 34 insertions, 19 deletions
diff --git a/src/courtroom.cpp b/src/courtroom.cpp
index 7ea7d284..ce4b982f 100644
--- a/src/courtroom.cpp
+++ b/src/courtroom.cpp
@@ -2910,8 +2910,15 @@ void Courtroom::handle_ic_message()
{
// Update the chatbox information
initialize_chatbox();
-
- do_transition(m_chatmessage[DESK_MOD], last_side, m_chatmessage[SIDE]);
+ if (m_chatmessage[EMOTE] != "")
+ {
+ do_transition(m_chatmessage[DESK_MOD], last_side, m_chatmessage[SIDE]);
+ }
+ else
+ {
+ play_sfx();
+ start_chat_ticking();
+ }
// if we have instant objections disabled, and queue is not empty, check if next message after this is an objection.
if (!Options::getInstance().objectionSkipQueueEnabled() && chatmessage_queue.size() > 0)
@@ -2974,10 +2981,7 @@ void Courtroom::do_screenshake()
void Courtroom::do_transition(QString p_desk_mod, QString oldPosId, QString newPosId)
{
- if (m_chatmessage[EMOTE] != "")
- {
- display_character();
- }
+ display_character();
const QStringList legacy_pos = {"def", "wit", "pro"};
QString t_old_pos = oldPosId;
@@ -3064,19 +3068,6 @@ void Courtroom::do_transition(QString p_desk_mod, QString oldPosId, QString newP
QStringList pair_data = data.split("^");
return (pair_data.size() > 1) ? (pair_data.at(1).toInt() == 1) : false;
};
- if (is_pairing(m_chatmessage))
- {
- ui_vp_sideplayer_char->loadCharacterEmote(m_chatmessage[OTHER_NAME], m_chatmessage[OTHER_EMOTE], kal::CharacterAnimationLayer::IdleEmote);
- calculate_offset_and_setup_layer(ui_vp_sideplayer_char, scaled_new_pos, m_chatmessage[OTHER_OFFSET]);
- if (is_pair_under(m_chatmessage[OTHER_CHARID]))
- {
- ui_vp_player_char->stackUnder(ui_vp_sideplayer_char);
- }
- else
- {
- ui_vp_sideplayer_char->stackUnder(ui_vp_player_char);
- }
- }
ui_vp_dummy_char->loadCharacterEmote(m_previous_chatmessage[CHAR_NAME], m_previous_chatmessage[EMOTE], kal::CharacterAnimationLayer::IdleEmote);
ui_vp_dummy_char->setFlipped(m_previous_chatmessage[FLIP].toInt() == 1);
@@ -3084,6 +3075,7 @@ void Courtroom::do_transition(QString p_desk_mod, QString oldPosId, QString newP
if (is_pairing(m_previous_chatmessage))
{
+ qDebug() << "last message WAS paired";
ui_vp_sidedummy_char->loadCharacterEmote(m_previous_chatmessage[OTHER_NAME], m_previous_chatmessage[OTHER_EMOTE], kal::CharacterAnimationLayer::IdleEmote);
ui_vp_sidedummy_char->setFlipped(m_previous_chatmessage[OTHER_FLIP].toInt() == 1);
calculate_offset_and_setup_layer(ui_vp_sidedummy_char, scaled_old_pos, m_previous_chatmessage[OTHER_OFFSET]);
@@ -3097,6 +3089,25 @@ void Courtroom::do_transition(QString p_desk_mod, QString oldPosId, QString newP
}
}
+ if (is_pairing(m_chatmessage))
+ {
+ ui_vp_sideplayer_char->loadCharacterEmote(m_chatmessage[OTHER_NAME], m_chatmessage[OTHER_EMOTE], kal::CharacterAnimationLayer::IdleEmote);
+ calculate_offset_and_setup_layer(ui_vp_sideplayer_char, scaled_new_pos, m_chatmessage[OTHER_OFFSET]);
+ if (is_pair_under(m_chatmessage[OTHER_CHARID]))
+ {
+ ui_vp_player_char->stackUnder(ui_vp_sideplayer_char);
+ }
+ else
+ {
+ ui_vp_sideplayer_char->stackUnder(ui_vp_player_char);
+ }
+ }
+ else
+ {
+ ui_vp_sideplayer_char->setVisible(false);
+ ui_vp_sideplayer_char->hide();
+ }
+
transition_animation_group->start();
}
@@ -3117,6 +3128,10 @@ void Courtroom::post_transition_cleanup()
ui_vp_dummy_char->hide();
ui_vp_sidedummy_char->hide();
+ // reset the god damn pair character
+ ui_vp_sideplayer_char->hide();
+ ui_vp_sideplayer_char->move(0, 0);
+
set_scene(m_chatmessage[DESK_MOD].toInt(), m_chatmessage[SIDE]);
// Move the character on the viewport according to the offsets