fix pair layer not being hidden correctly

This commit is contained in:
in1tiate 2024-05-26 13:30:23 -05:00
parent 4c56a25463
commit b9df908113

View File

@ -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,6 +3064,27 @@ 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;
};
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);
calculate_offset_and_setup_layer(ui_vp_dummy_char, scaled_old_pos, m_previous_chatmessage[SELF_OFFSET]);
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]);
if (is_pair_under(m_previous_chatmessage[OTHER_CHARID]))
{
ui_vp_dummy_char->stackUnder(ui_vp_sidedummy_char);
}
else
{
ui_vp_sidedummy_char->stackUnder(ui_vp_dummy_char);
}
}
if (is_pairing(m_chatmessage))
{
ui_vp_sideplayer_char->loadCharacterEmote(m_chatmessage[OTHER_NAME], m_chatmessage[OTHER_EMOTE], kal::CharacterAnimationLayer::IdleEmote);
@ -3077,24 +3098,10 @@ void Courtroom::do_transition(QString p_desk_mod, QString oldPosId, QString newP
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);
calculate_offset_and_setup_layer(ui_vp_dummy_char, scaled_old_pos, m_previous_chatmessage[SELF_OFFSET]);
if (is_pairing(m_previous_chatmessage))
else
{
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]);
if (is_pair_under(m_previous_chatmessage[OTHER_CHARID]))
{
ui_vp_dummy_char->stackUnder(ui_vp_sidedummy_char);
}
else
{
ui_vp_sidedummy_char->stackUnder(ui_vp_dummy_char);
}
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