summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorcadmic <cadmic24@gmail.com>2025-01-24 20:00:46 -0800
committerGitHub <noreply@github.com>2025-01-24 23:00:46 -0500
commit5bca304cbc3be769dbf252352a469779bbdf2175 (patch)
tree70914aac7b3ba6298f96307e304266a8e683eb22 /src
parentf8d050bf7f8817c94d21865a70aa40669480fa57 (diff)
[iQue] Unify file select actionButtonAlpha and confirmButtonAlpha (#2436)
* Fix all confirmButtonAlpha indices * Unify actionButtonAlpha and confirmButtonAlpha * Restore ConfirmButtonIndex * Add comment for actionButtonAlpha
Diffstat (limited to 'src')
-rw-r--r--src/overlays/gamestates/ovl_file_choose/file_select.h4
-rw-r--r--src/overlays/gamestates/ovl_file_choose/z_file_choose.c11
-rw-r--r--src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c49
3 files changed, 32 insertions, 32 deletions
diff --git a/src/overlays/gamestates/ovl_file_choose/file_select.h b/src/overlays/gamestates/ovl_file_choose/file_select.h
index 465d017ed..122ba09af 100644
--- a/src/overlays/gamestates/ovl_file_choose/file_select.h
+++ b/src/overlays/gamestates/ovl_file_choose/file_select.h
@@ -140,7 +140,9 @@ typedef enum ConfirmButtonIndex {
typedef enum ActionButtonIndex {
/* 0 */ FS_BTN_ACTION_COPY,
- /* 1 */ FS_BTN_ACTION_ERASE
+ /* 1 */ FS_BTN_ACTION_ERASE,
+ /* 2 */ FS_BTN_ACTION_YES,
+ /* 3 */ FS_BTN_ACTION_QUIT
} ActionButtonIndex;
typedef enum SettingIndex {
diff --git a/src/overlays/gamestates/ovl_file_choose/z_file_choose.c b/src/overlays/gamestates/ovl_file_choose/z_file_choose.c
index a661b1b48..52dec1658 100644
--- a/src/overlays/gamestates/ovl_file_choose/z_file_choose.c
+++ b/src/overlays/gamestates/ovl_file_choose/z_file_choose.c
@@ -1475,7 +1475,7 @@ void FileSelect_DrawWindowContents(GameState* thisx) {
temp = this->confirmButtonTexIndices[i];
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, this->windowColor[0], this->windowColor[1], this->windowColor[2],
- this->confirmButtonAlpha[i]);
+ this->actionButtonAlpha[i + 2]);
gDPLoadTextureBlock(POLY_OPA_DISP++, sActionButtonTextures[gSaveContext.language][temp], G_IM_FMT_IA,
G_IM_SIZ_16b, 64, 16, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
@@ -1717,7 +1717,7 @@ void FileSelect_FadeInFileInfo(GameState* thisx) {
this->selectMode++;
}
- this->confirmButtonAlpha[FS_BTN_CONFIRM_YES] = this->confirmButtonAlpha[FS_BTN_CONFIRM_QUIT] =
+ this->actionButtonAlpha[FS_BTN_ACTION_YES] = this->actionButtonAlpha[FS_BTN_ACTION_QUIT] =
this->fileInfoAlpha[this->buttonIndex];
}
@@ -1772,7 +1772,8 @@ void FileSelect_FadeOutFileInfo(GameState* thisx) {
this->selectMode++;
}
- this->confirmButtonAlpha[0] = this->confirmButtonAlpha[1] = this->fileInfoAlpha[this->buttonIndex];
+ this->actionButtonAlpha[FS_BTN_ACTION_YES] = this->actionButtonAlpha[FS_BTN_ACTION_QUIT] =
+ this->fileInfoAlpha[this->buttonIndex];
}
/**
@@ -2239,8 +2240,8 @@ void FileSelect_InitContext(GameState* thisx) {
this->nameBoxAlpha[2] = this->nameAlpha[0] = this->nameAlpha[1] = this->nameAlpha[2] =
this->connectorAlpha[0] = this->connectorAlpha[1] = this->connectorAlpha[2] = this->fileInfoAlpha[0] =
this->fileInfoAlpha[1] = this->fileInfoAlpha[2] = this->actionButtonAlpha[FS_BTN_ACTION_COPY] =
- this->actionButtonAlpha[FS_BTN_ACTION_ERASE] = this->confirmButtonAlpha[FS_BTN_CONFIRM_YES] =
- this->confirmButtonAlpha[FS_BTN_CONFIRM_QUIT] = this->optionButtonAlpha =
+ this->actionButtonAlpha[FS_BTN_ACTION_ERASE] = this->actionButtonAlpha[FS_BTN_ACTION_YES] =
+ this->actionButtonAlpha[FS_BTN_ACTION_QUIT] = this->optionButtonAlpha =
this->nameEntryBoxAlpha = this->controlsAlpha = this->emptyFileTextAlpha = 0;
this->windowPosX = 6;
diff --git a/src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c b/src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c
index 827aca8a1..a8ae9da91 100644
--- a/src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c
+++ b/src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c
@@ -33,7 +33,7 @@ void FileSelect_SetupCopySource(GameState* thisx) {
this->actionButtonAlpha[FS_BTN_ACTION_COPY] -= 25;
this->actionButtonAlpha[FS_BTN_ACTION_ERASE] -= 25;
this->optionButtonAlpha -= 25;
- this->confirmButtonAlpha[FS_BTN_CONFIRM_QUIT] += 25;
+ this->actionButtonAlpha[FS_BTN_ACTION_QUIT] += 25;
this->titleAlpha[0] -= 31;
this->titleAlpha[1] += 31;
this->actionTimer--;
@@ -44,7 +44,7 @@ void FileSelect_SetupCopySource(GameState* thisx) {
this->actionButtonAlpha[FS_BTN_ACTION_COPY] = this->actionButtonAlpha[FS_BTN_ACTION_ERASE] =
this->optionButtonAlpha = 0;
- this->confirmButtonAlpha[FS_BTN_CONFIRM_QUIT] = 200;
+ this->actionButtonAlpha[FS_BTN_ACTION_QUIT] = 200;
this->titleLabel = this->nextTitleLabel;
this->titleAlpha[0] = 255;
@@ -292,7 +292,7 @@ void FileSelect_ExitToCopySource2(GameState* thisx) {
this->titleLabel = this->nextTitleLabel;
this->titleAlpha[0] = 255;
this->titleAlpha[1] = 0;
- this->buttonIndex = 3;
+ this->buttonIndex = FS_BTN_COPY_QUIT;
this->configMode = CM_SELECT_COPY_SOURCE;
}
}
@@ -349,7 +349,7 @@ void FileSelect_SetupCopyConfirm1(GameState* thisx) {
void FileSelect_SetupCopyConfirm2(GameState* thisx) {
FileSelectState* this = (FileSelectState*)thisx;
- this->confirmButtonAlpha[FS_BTN_CONFIRM_YES] += 25;
+ this->actionButtonAlpha[FS_BTN_ACTION_YES] += 25;
this->actionTimer--;
if (this->actionTimer == 0) {
@@ -406,7 +406,7 @@ void FileSelect_ReturnToCopyDest(GameState* thisx) {
this->titleAlpha[0] -= 31;
this->titleAlpha[1] += 31;
- this->confirmButtonAlpha[FS_BTN_CONFIRM_YES] -= 25;
+ this->actionButtonAlpha[FS_BTN_ACTION_YES] -= 25;
for (i = 0; i < 3; i++) {
if ((i != this->copyDestFileIndex) && (i != this->selectedFileIndex)) {
@@ -447,8 +447,8 @@ void FileSelect_CopyAnim1(GameState* thisx) {
FileSelectState* this = (FileSelectState*)thisx;
this->titleAlpha[0] -= 31;
- this->confirmButtonAlpha[FS_BTN_CONFIRM_YES] -= 25;
- this->confirmButtonAlpha[FS_BTN_CONFIRM_QUIT] -= 25;
+ this->actionButtonAlpha[FS_BTN_ACTION_YES] -= 25;
+ this->actionButtonAlpha[FS_BTN_ACTION_QUIT] -= 25;
this->actionTimer--;
if (this->actionTimer == 0) {
@@ -619,14 +619,14 @@ void FileSelect_ExitCopyToMain(GameState* thisx) {
}
this->actionButtonAlpha[FS_BTN_ACTION_COPY] += 25;
- this->confirmButtonAlpha[FS_BTN_CONFIRM_QUIT] -= 25;
+ this->actionButtonAlpha[FS_BTN_ACTION_QUIT] -= 25;
this->titleAlpha[0] -= 31;
this->titleAlpha[1] += 31;
this->actionTimer--;
if (this->actionTimer == 0) {
this->actionButtonAlpha[FS_BTN_ACTION_COPY] = 200;
- this->confirmButtonAlpha[FS_BTN_CONFIRM_QUIT] = 0;
+ this->actionButtonAlpha[FS_BTN_ACTION_QUIT] = 0;
this->titleLabel = this->nextTitleLabel;
this->titleAlpha[0] = 255;
this->titleAlpha[1] = 0;
@@ -659,7 +659,7 @@ void FileSelect_SetupEraseSelect(GameState* thisx) {
this->actionButtonAlpha[FS_BTN_ACTION_COPY] -= 50;
this->actionButtonAlpha[FS_BTN_ACTION_ERASE] -= 50;
this->optionButtonAlpha -= 50;
- this->confirmButtonAlpha[FS_BTN_CONFIRM_QUIT] += 25;
+ this->actionButtonAlpha[FS_BTN_ACTION_QUIT] += 25;
if (this->actionButtonAlpha[FS_BTN_ACTION_COPY] <= 0) {
this->actionButtonAlpha[FS_BTN_ACTION_COPY] = this->actionButtonAlpha[FS_BTN_ACTION_ERASE] =
@@ -676,7 +676,7 @@ void FileSelect_SetupEraseSelect(GameState* thisx) {
XREG(35) = XREG(36);
this->actionButtonAlpha[FS_BTN_ACTION_COPY] = this->actionButtonAlpha[FS_BTN_ACTION_ERASE] =
this->optionButtonAlpha = 0;
- this->confirmButtonAlpha[1] = 200;
+ this->actionButtonAlpha[FS_BTN_ACTION_QUIT] = 200;
this->titleLabel = this->nextTitleLabel;
this->titleAlpha[0] = 255;
this->titleAlpha[1] = 0;
@@ -810,7 +810,7 @@ void FileSelect_SetupEraseConfirm1(GameState* thisx) {
void FileSelect_SetupEraseConfirm2(GameState* thisx) {
FileSelectState* this = (FileSelectState*)thisx;
- this->confirmButtonAlpha[FS_BTN_CONFIRM_YES] += 25;
+ this->actionButtonAlpha[FS_BTN_ACTION_YES] += 25;
this->titleAlpha[0] -= 15;
this->titleAlpha[1] += 15;
this->fileInfoAlpha[this->buttonIndex] += 25;
@@ -821,8 +821,8 @@ void FileSelect_SetupEraseConfirm2(GameState* thisx) {
this->titleLabel = this->nextTitleLabel;
this->fileInfoAlpha[this->buttonIndex] = this->titleAlpha[0] = 255;
this->titleAlpha[1] = 0;
- this->confirmButtonAlpha[FS_BTN_CONFIRM_YES] = 200;
- this->buttonIndex = FS_BTN_ERASE_FILE_2;
+ this->actionButtonAlpha[FS_BTN_ACTION_YES] = 200;
+ this->buttonIndex = FS_BTN_CONFIRM_QUIT;
this->configMode = CM_ERASE_CONFIRM;
}
}
@@ -868,7 +868,7 @@ void FileSelect_ExitToEraseSelect1(GameState* thisx) {
this->fileInfoAlpha[this->buttonIndex] -= 25;
this->nameBoxAlpha[this->buttonIndex] += 25;
- this->confirmButtonAlpha[FS_BTN_CONFIRM_YES] -= 25;
+ this->actionButtonAlpha[FS_BTN_ACTION_YES] -= 25;
this->actionTimer--;
if (this->actionTimer == 0) {
@@ -941,8 +941,8 @@ void FileSelect_EraseAnim1(GameState* thisx) {
this->titleAlpha[0] -= 31;
this->titleAlpha[1] += 31;
this->fileInfoAlpha[this->selectedFileIndex] -= 25;
- this->confirmButtonAlpha[FS_BTN_CONFIRM_YES] -= 25;
- this->confirmButtonAlpha[FS_BTN_CONFIRM_QUIT] -= 25;
+ this->actionButtonAlpha[FS_BTN_ACTION_YES] -= 25;
+ this->actionButtonAlpha[FS_BTN_ACTION_QUIT] -= 25;
}
this->fileNamesY[this->selectedFileIndex] -= D_80813800;
@@ -955,11 +955,8 @@ void FileSelect_EraseAnim1(GameState* thisx) {
this->titleAlpha[0] = 255;
this->titleAlpha[1] = this->connectorAlpha[this->selectedFileIndex] = 0;
- // probably a fake match, there should be a better chained assignment
- this->confirmButtonAlpha[0] = this->confirmButtonAlpha[1] = 0;
- if (1) {}
this->fileInfoAlpha[this->selectedFileIndex] = this->nameBoxAlpha[this->selectedFileIndex] =
- this->confirmButtonAlpha[1];
+ this->actionButtonAlpha[FS_BTN_ACTION_YES] = this->actionButtonAlpha[FS_BTN_ACTION_QUIT] = 0;
this->configMode++;
this->actionTimer = 90;
@@ -1035,7 +1032,7 @@ void FileSelect_EraseAnim3(GameState* thisx) {
this->highlightPulseDir = 1;
XREG(35) = XREG(36);
this->actionButtonAlpha[FS_BTN_ACTION_COPY] = 200;
- this->confirmButtonAlpha[0] = this->confirmButtonAlpha[1] = 0;
+ this->actionButtonAlpha[FS_BTN_ACTION_YES] = this->actionButtonAlpha[FS_BTN_ACTION_QUIT] = 0;
this->titleLabel = this->nextTitleLabel;
this->titleAlpha[0] = 255;
this->titleAlpha[1] = 0;
@@ -1068,10 +1065,10 @@ void FileSelect_ExitEraseToMain(GameState* thisx) {
this->actionButtonAlpha[FS_BTN_ACTION_COPY] += 25;
this->actionButtonAlpha[FS_BTN_ACTION_ERASE] += 25;
this->optionButtonAlpha += 25;
- this->confirmButtonAlpha[FS_BTN_CONFIRM_QUIT] -= 50;
+ this->actionButtonAlpha[FS_BTN_ACTION_QUIT] -= 50;
- if (this->confirmButtonAlpha[FS_BTN_CONFIRM_QUIT] <= 0) {
- this->confirmButtonAlpha[FS_BTN_CONFIRM_QUIT] = 0;
+ if (this->actionButtonAlpha[FS_BTN_ACTION_QUIT] <= 0) {
+ this->actionButtonAlpha[FS_BTN_ACTION_QUIT] = 0;
}
this->titleAlpha[0] -= 31;
@@ -1083,7 +1080,7 @@ void FileSelect_ExitEraseToMain(GameState* thisx) {
this->highlightPulseDir = 1;
XREG(35) = XREG(36);
this->actionButtonAlpha[FS_BTN_ACTION_COPY] = 200;
- this->confirmButtonAlpha[FS_BTN_CONFIRM_QUIT] = 0;
+ this->actionButtonAlpha[FS_BTN_ACTION_QUIT] = 0;
this->titleLabel = this->nextTitleLabel;
this->titleAlpha[0] = 255;
this->titleAlpha[1] = 0;