summaryrefslogtreecommitdiff
path: root/src/code/z_message.c
diff options
context:
space:
mode:
authorengineer124 <47598039+engineer124@users.noreply.github.com>2023-11-22 16:10:55 +1100
committerGitHub <noreply@github.com>2023-11-22 16:10:55 +1100
commit5ef277df2db5dd54c02c098ec88777f63680f6c3 (patch)
tree4116b487664fd329b91c1a5bb77b9ea545b2b40d /src/code/z_message.c
parent2b4610670fcd577d0684fdc912e8c81155845062 (diff)
Animation Cleanup: En_P* (#1507)
* anim P cleanup * PR Review * PR Review * Postbox Idle
Diffstat (limited to 'src/code/z_message.c')
-rw-r--r--src/code/z_message.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/code/z_message.c b/src/code/z_message.c
index 4ebcda37f..63330e507 100644
--- a/src/code/z_message.c
+++ b/src/code/z_message.c
@@ -5208,11 +5208,11 @@ void Message_Update(PlayState* play) {
PauseContext* pauseCtx = &play->pauseCtx;
InterfaceContext* interfaceCtx = &play->interfaceCtx;
Input* input = CONTROLLER1(&play->state);
- s16 averageY;
- s16 sp50;
+ s16 avgScreenPosY;
+ s16 screenPosX;
u16 temp_v1_2;
- s16 sp4C;
- s16 sp4A;
+ s16 playerScreenPosY;
+ s16 actorScreenPosY;
s16 sp48;
s32 sp44;
s32 sp40;
@@ -5223,7 +5223,7 @@ void Message_Update(PlayState* play) {
msgCtx->stickAdjX = input->rel.stick_x;
msgCtx->stickAdjY = input->rel.stick_y;
- averageY = 0;
+ avgScreenPosY = 0;
// If stickAdj is held, set a delay to allow the cursor to read the next input.
// The first delay is given a longer time than all subsequent delays.
@@ -5309,12 +5309,12 @@ void Message_Update(PlayState* play) {
}
if (temp) {
if (msgCtx->talkActor != NULL) {
- Actor_GetScreenPos(play, &GET_PLAYER(play)->actor, &sp50, &sp4C);
- Actor_GetScreenPos(play, msgCtx->talkActor, &sp50, &sp4A);
- if (sp4C >= sp4A) {
- averageY = ((sp4C - sp4A) / 2) + sp4A;
+ Actor_GetScreenPos(play, &GET_PLAYER(play)->actor, &screenPosX, &playerScreenPosY);
+ Actor_GetScreenPos(play, msgCtx->talkActor, &screenPosX, &actorScreenPosY);
+ if (playerScreenPosY >= actorScreenPosY) {
+ avgScreenPosY = ((playerScreenPosY - actorScreenPosY) / 2) + actorScreenPosY;
} else {
- averageY = ((sp4A - sp4C) / 2) + sp4C;
+ avgScreenPosY = ((actorScreenPosY - playerScreenPosY) / 2) + playerScreenPosY;
}
} else {
msgCtx->textboxX = msgCtx->textboxXTarget;
@@ -5326,13 +5326,13 @@ void Message_Update(PlayState* play) {
if ((u32)msgCtx->textBoxPos == 0) {
if ((play->sceneId == SCENE_UNSET_04) || (play->sceneId == SCENE_UNSET_05) ||
(play->sceneId == SCENE_UNSET_06)) {
- if (averageY < 0x64) {
+ if (avgScreenPosY < 100) {
msgCtx->textboxYTarget = sTextboxLowerYPositions[var_v1];
} else {
msgCtx->textboxYTarget = sTextboxUpperYPositions[var_v1];
}
} else {
- if (averageY < 0xA0) {
+ if (avgScreenPosY < 160) {
msgCtx->textboxYTarget = sTextboxLowerYPositions[var_v1];
} else {
msgCtx->textboxYTarget = sTextboxUpperYPositions[var_v1];