1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-11-14 05:19:36 +00:00

Fix TEXTBOX_POS issue (#1329)

This commit is contained in:
mzxrules 2022-07-27 16:24:58 -04:00 committed by GitHub
parent 9647f50451
commit ffcbc0de79
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 16 deletions

View file

@ -21,8 +21,8 @@ typedef enum {
typedef enum { typedef enum {
/* 0 */ TEXTBOX_POS_VARIABLE, /* 0 */ TEXTBOX_POS_VARIABLE,
/* 1 */ TEXTBOX_POS_TOP, /* 1 */ TEXTBOX_POS_TOP,
/* 2 */ TEXTBOX_POS_BOTTOM, /* 2 */ TEXTBOX_POS_MIDDLE,
/* 3 */ TEXTBOX_POS_MIDDLE /* 3 */ TEXTBOX_POS_BOTTOM
} TextBoxPosition; } TextBoxPosition;
typedef struct { typedef struct {

View file

@ -3031,13 +3031,13 @@ void Message_Update(PlayState* play) {
static s16 sTextboxXPositions[] = { static s16 sTextboxXPositions[] = {
34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
}; };
static s16 sTextboxMidYPositions[] = { static s16 sTextboxLowerYPositions[] = {
142, 142, 142, 142, 174, 142, 142, 142, 142, 142, 174, 142,
}; };
static s16 sTextboxUpperYPositions[] = { static s16 sTextboxUpperYPositions[] = {
38, 38, 38, 38, 174, 38, 38, 38, 38, 38, 174, 38,
}; };
static s16 sTextboxLowerYPositions[] = { static s16 sTextboxMidYPositions[] = {
90, 90, 90, 90, 174, 90, 90, 90, 90, 90, 174, 90,
}; };
static s16 sTextboxEndIconYOffset[] = { static s16 sTextboxEndIconYOffset[] = {
@ -3127,32 +3127,30 @@ void Message_Update(PlayState* play) {
if (!msgCtx->textBoxPos) { // variable position if (!msgCtx->textBoxPos) { // variable position
if (R_SCENE_CAM_TYPE != SCENE_CAM_TYPE_DEFAULT || play->sceneNum == SCENE_HAIRAL_NIWA) { if (R_SCENE_CAM_TYPE != SCENE_CAM_TYPE_DEFAULT || play->sceneNum == SCENE_HAIRAL_NIWA) {
if (averageY < XREG(92)) { if (averageY < XREG(92)) {
R_TEXTBOX_Y_TARGET = sTextboxMidYPositions[var]; R_TEXTBOX_Y_TARGET = sTextboxLowerYPositions[var];
} else { } else {
R_TEXTBOX_Y_TARGET = sTextboxUpperYPositions[var]; R_TEXTBOX_Y_TARGET = sTextboxUpperYPositions[var];
} }
} else if (play->sceneNum == SCENE_MARKET_DAY || play->sceneNum == SCENE_MARKET_NIGHT || } else if (play->sceneNum == SCENE_MARKET_DAY || play->sceneNum == SCENE_MARKET_NIGHT ||
play->sceneNum == SCENE_MARKET_RUINS) { play->sceneNum == SCENE_MARKET_RUINS) {
if (averageY < XREG(93)) { if (averageY < XREG(93)) {
R_TEXTBOX_Y_TARGET = sTextboxMidYPositions[var]; R_TEXTBOX_Y_TARGET = sTextboxLowerYPositions[var];
} else { } else {
R_TEXTBOX_Y_TARGET = sTextboxUpperYPositions[var]; R_TEXTBOX_Y_TARGET = sTextboxUpperYPositions[var];
} }
} else { } else {
if (averageY < XREG(94)) { if (averageY < XREG(94)) {
R_TEXTBOX_Y_TARGET = sTextboxMidYPositions[var]; R_TEXTBOX_Y_TARGET = sTextboxLowerYPositions[var];
} else { } else {
R_TEXTBOX_Y_TARGET = sTextboxUpperYPositions[var]; R_TEXTBOX_Y_TARGET = sTextboxUpperYPositions[var];
} }
} }
} else if (msgCtx->textBoxPos == TEXTBOX_POS_TOP) {
R_TEXTBOX_Y_TARGET = sTextboxUpperYPositions[var];
} else if (msgCtx->textBoxPos == TEXTBOX_POS_MIDDLE) {
R_TEXTBOX_Y_TARGET = sTextboxMidYPositions[var];
} else { } else {
if (msgCtx->textBoxPos == TEXTBOX_POS_TOP) { R_TEXTBOX_Y_TARGET = sTextboxLowerYPositions[var];
R_TEXTBOX_Y_TARGET = sTextboxUpperYPositions[var];
} else if (msgCtx->textBoxPos == TEXTBOX_POS_BOTTOM) {
R_TEXTBOX_Y_TARGET = sTextboxLowerYPositions[var];
} else {
R_TEXTBOX_Y_TARGET = sTextboxMidYPositions[var];
}
} }
R_TEXTBOX_X_TARGET = sTextboxXPositions[var]; R_TEXTBOX_X_TARGET = sTextboxXPositions[var];

View file

@ -254,8 +254,8 @@ textbox_type = {
textbox_ypos = { textbox_ypos = {
0: "TEXTBOX_POS_VARIABLE", 0: "TEXTBOX_POS_VARIABLE",
1: "TEXTBOX_POS_TOP", 1: "TEXTBOX_POS_TOP",
2: "TEXTBOX_POS_BOTTOM", 2: "TEXTBOX_POS_MIDDLE",
3: "TEXTBOX_POS_MIDDLE", 3: "TEXTBOX_POS_BOTTOM",
} }
# message entry tables vrom addresses # message entry tables vrom addresses