diff options
Diffstat (limited to 'src/courtroom.cpp')
| -rw-r--r-- | src/courtroom.cpp | 41 |
1 files changed, 26 insertions, 15 deletions
diff --git a/src/courtroom.cpp b/src/courtroom.cpp index 7ea7d284..e79d3d51 100644 --- a/src/courtroom.cpp +++ b/src/courtroom.cpp @@ -2974,7 +2974,7 @@ void Courtroom::do_screenshake() void Courtroom::do_transition(QString p_desk_mod, QString oldPosId, QString newPosId) { - if (m_chatmessage[EMOTE] != "") + if (m_chatmessage[EMOTE].isEmpty()) { display_character(); } @@ -3000,7 +3000,7 @@ void Courtroom::do_transition(QString p_desk_mod, QString oldPosId, QString newP int duration = ao_app->get_pos_transition_duration(t_old_pos, t_new_pos); // conditions to stop slide - if (oldPosId == newPosId || old_pos_pair.first != new_pos_pair.first || !new_pos_pair.second.isValid() || !Options::getInstance().slidesEnabled() || m_chatmessage[SLIDE] != "1" || duration == -1 || m_chatmessage[EMOTE_MOD].toInt() == ZOOM || m_chatmessage[EMOTE_MOD].toInt() == PREANIM_ZOOM) + if (m_chatmessage[EMOTE].isEmpty() || oldPosId == newPosId || old_pos_pair.first != new_pos_pair.first || !new_pos_pair.second.isValid() || !Options::getInstance().slidesEnabled() || m_chatmessage[SLIDE] != "1" || duration == -1 || m_chatmessage[EMOTE_MOD].toInt() == ZOOM || m_chatmessage[EMOTE_MOD].toInt() == PREANIM_ZOOM) { #ifdef DEBUG_TRANSITION qDebug() << "skipping transition - not applicable"; @@ -3064,19 +3064,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 +3071,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 +3085,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 +3124,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 |
