aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCrystalwarrior <varsash@gmail.com>2019-09-16 23:54:42 +0300
committerCrystalwarrior <varsash@gmail.com>2019-09-16 23:54:42 +0300
commit684e26cb776b143175590845c77813763927e759 (patch)
tree0bfb7b9c94290c2ef6a65d624347a013fd657908
parent19ff6cd5f8a74188d65aa0a0ffaf2827f6471586 (diff)
Change the way sideplayer/playerchar ordering works to be stackUnder instead of Raise so it doesn't break anything (like the chatbox)
-rw-r--r--src/courtroom.cpp26
1 files changed, 7 insertions, 19 deletions
diff --git a/src/courtroom.cpp b/src/courtroom.cpp
index 08ece887..f01c1780 100644
--- a/src/courtroom.cpp
+++ b/src/courtroom.cpp
@@ -1635,16 +1635,12 @@ void Courtroom::handle_chatmessage_2()
// The person more to the left is more in the front.
if (hor2_offset >= hor_offset)
{
- ui_vp_sideplayer_char->raise();
- ui_vp_player_char->raise();
+ ui_vp_sideplayer_char->stackUnder(ui_vp_player_char);
}
else
{
- ui_vp_player_char->raise();
- ui_vp_sideplayer_char->raise();
+ ui_vp_player_char->stackUnder(ui_vp_sideplayer_char);
}
- ui_vp_desk->raise();
- ui_vp_legacy_desk->raise();
}
else if (side == "pro")
{
@@ -1668,18 +1664,14 @@ void Courtroom::handle_chatmessage_2()
ui_vp_sideplayer_char->move(ui_viewport->width() * hor2_offset / 100, ui_viewport->height() * vert2_offset / 100);
// Finally, we reorder them based on who is more to the right.
- if (hor2_offset <= hor_offset)
+ if (hor2_offset >= hor_offset)
{
- ui_vp_sideplayer_char->raise();
- ui_vp_player_char->raise();
+ ui_vp_sideplayer_char->stackUnder(ui_vp_player_char);
}
else
{
- ui_vp_player_char->raise();
- ui_vp_sideplayer_char->raise();
+ ui_vp_player_char->stackUnder(ui_vp_sideplayer_char);
}
- ui_vp_desk->raise();
- ui_vp_legacy_desk->raise();
}
else
{
@@ -1696,16 +1688,12 @@ void Courtroom::handle_chatmessage_2()
// The person more to the left is more in the front.
if (hor2_offset >= hor_offset)
{
- ui_vp_sideplayer_char->raise();
- ui_vp_player_char->raise();
+ ui_vp_sideplayer_char->stackUnder(ui_vp_player_char);
}
else
{
- ui_vp_player_char->raise();
- ui_vp_sideplayer_char->raise();
+ ui_vp_player_char->stackUnder(ui_vp_sideplayer_char);
}
- ui_vp_desk->raise();
- ui_vp_legacy_desk->raise();
}
// We should probably also play the other character's idle emote.
if (ao_app->flipping_enabled && m_chatmessage[OTHER_FLIP].toInt() == 1)