1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-03 06:24:30 +00:00

Document Hud Mode (#1323)

* begin interface alpha docs

* more progress/docs

* First draft of docs done

* cleanup

* Consistency

* Display -> Mode

* Remaining display -> mode

* Better docs

* Small touchups

* Small Update

* Apply discord discussion

* small fix

* More discussions

* PR Suggestions

* Roman PR Suggestions

* better comments

* PR Suggestions

* another suggestion

* discord discussions

* cleanup comments

* more discord/pr suggestions
This commit is contained in:
engineer124 2022-11-21 22:01:44 -05:00 committed by GitHub
parent 9bdf6ded2f
commit 9c35716fe2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
28 changed files with 387 additions and 324 deletions

View file

@ -391,7 +391,7 @@ void BgDyYoseizo_GreetPlayer_NoReward(BgDyYoseizo* this, PlayState* play) {
if ((this->dialogState == Message_GetState(&play->msgCtx)) && Message_ShouldAdvance(play)) {
Message_CloseTextbox(play);
Interface_ChangeAlpha(5);
Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_A_HEARTS_MAGIC_FORCE);
this->actionFunc = BgDyYoseizo_SetupHealPlayer_NoReward;
}
@ -712,7 +712,7 @@ void BgDyYoseizo_Give_Reward(BgDyYoseizo* this, PlayState* play) {
gSaveContext.isMagicAcquired = true;
gSaveContext.magicFillTarget = MAGIC_NORMAL_METER;
// magicLevel is already 0, setting isMagicAcquired to true triggers magicCapacity to grow
Interface_ChangeAlpha(9);
Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_HEARTS_MAGIC);
break;
case FAIRY_UPGRADE_DOUBLE_MAGIC:
if (!gSaveContext.isMagicAcquired) {
@ -722,11 +722,11 @@ void BgDyYoseizo_Give_Reward(BgDyYoseizo* this, PlayState* play) {
gSaveContext.magicFillTarget = MAGIC_DOUBLE_METER;
// Setting magicLevel to 0 triggers magicCapacity to grow
gSaveContext.magicLevel = 0;
Interface_ChangeAlpha(9);
Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_HEARTS_MAGIC);
break;
case FAIRY_UPGRADE_DOUBLE_DEFENSE:
gSaveContext.isDoubleDefenseAcquired = true;
Interface_ChangeAlpha(9);
Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_HEARTS_MAGIC);
break;
}
@ -760,7 +760,7 @@ void BgDyYoseizo_Give_Reward(BgDyYoseizo* this, PlayState* play) {
this->itemSpawned = true;
gSaveContext.healthAccumulator = 0x140;
Interface_ChangeAlpha(9);
Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_HEARTS_MAGIC);
gSaveContext.itemGetInf[ITEMGETINF_18_19_1A_INDEX] |= sItemGetFlags[actionIndex];
Item_Give(play, sItemIds[actionIndex]);
}

View file

@ -785,7 +785,7 @@ void BossGanon_IntroCutscene(BossGanon* this, PlayState* play) {
if (this->csTimer == 20) {
func_8002DF54(play, &this->actor, 0x17);
Interface_ChangeAlpha(11); // show hearts only
Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_HEARTS);
}
if (this->csTimer == 25) {
@ -793,7 +793,7 @@ void BossGanon_IntroCutscene(BossGanon* this, PlayState* play) {
}
if (this->csTimer == 100) {
Interface_ChangeAlpha(1);
Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_NOTHING);
}
if (this->csTimer == 120) {

View file

@ -791,7 +791,7 @@ void BossMo_Tentacle(BossMo* this, PlayState* play) {
case MO_TENT_SHAKE:
if (this->timers[0] == 138) {
Letterbox_SetSizeTarget(0);
Interface_ChangeAlpha(0xB);
Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_HEARTS);
}
if ((this->timers[0] % 8) == 0) {
play->damagePlayer(play, -1);

View file

@ -433,7 +433,7 @@ void func_80A79BAC(EnIn* this, PlayState* play, s32 index, u32 transitionType) {
play->transitionType = transitionType;
play->transitionTrigger = TRANS_TRIGGER_START;
func_8002DF54(play, &this->actor, 8);
Interface_ChangeAlpha(1);
Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_NOTHING);
if (index == 0) {
AREG(6) = 0;
}
@ -471,7 +471,7 @@ void func_80A79C78(EnIn* this, PlayState* play) {
player->actor.freezeTimer = 10;
this->actor.flags &= ~ACTOR_FLAG_0;
Letterbox_SetSizeTarget(32);
Interface_ChangeAlpha(2);
Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_NOTHING_ALT);
}
static s32 D_80A7B998 = 0;
@ -792,7 +792,7 @@ void func_80A7AA40(EnIn* this, PlayState* play) {
this->unk_1FC = 0;
play->csCtx.frames = 0;
Letterbox_SetSizeTarget(32);
Interface_ChangeAlpha(2);
Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_NOTHING_ALT);
this->actionFunc = func_80A7ABD4;
}
@ -857,7 +857,7 @@ void func_80A7AE84(EnIn* this, PlayState* play) {
Play_ChangeCameraStatus(play, this->returnToCamId, CAM_STAT_ACTIVE);
Play_ClearCamera(play, this->subCamId);
func_8002DF54(play, &this->actor, 7);
Interface_ChangeAlpha(0x32);
Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_ALL);
this->actionFunc = func_80A7AEF0;
}

View file

@ -68,7 +68,7 @@ void EnMag_Init(Actor* thisx, PlayState* play) {
this->effectFadeInState = this->effectPrimLodFrac = this->globalState = this->effectAlpha = this->mainAlpha =
this->subAlpha = this->copyrightAlpha = 0.0f;
if (gSaveContext.unk_13E7 != 0) {
if (gSaveContext.forceRisingButtonAlphas) {
this->mainAlpha = 210;
this->subAlpha = 255;
this->copyrightAlpha = 255;
@ -83,7 +83,7 @@ void EnMag_Init(Actor* thisx, PlayState* play) {
this->effectEnvColor[1] = 255.0f;
this->effectEnvColor[2] = 0;
gSaveContext.unk_13E7 = 0;
gSaveContext.forceRisingButtonAlphas = false;
this->globalState = MAG_STATE_DISPLAY;
sDelayTimer = 20;
gSaveContext.transFadeDuration = 1;

View file

@ -654,7 +654,7 @@ void EnOssan_EndInteraction(PlayState* play, EnOssan* this) {
play->msgCtx.stateTimer = 4;
player->stateFlags2 &= ~PLAYER_STATE2_29;
Play_SetViewpoint(play, VIEWPOINT_LOCKED);
Interface_ChangeAlpha(50);
Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_ALL);
this->drawCursor = 0;
this->stickLeftPrompt.isEnabled = false;
this->stickRightPrompt.isEnabled = false;
@ -1323,7 +1323,7 @@ void EnOssan_GiveItemWithFanfare(PlayState* play, EnOssan* this) {
play->msgCtx.stateTimer = 4;
player->stateFlags2 &= ~PLAYER_STATE2_29;
Play_SetViewpoint(play, VIEWPOINT_LOCKED);
Interface_ChangeAlpha(50);
Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_ALL);
this->drawCursor = 0;
EnOssan_UpdateCameraDirection(this, play, 0.0f);
this->stateFlag = OSSAN_STATE_GIVE_ITEM_FANFARE;

View file

@ -181,7 +181,7 @@ void func_80B4B010(EnZl1* this, PlayState* play) {
Play_CameraSetAtEye(play, this->subCamId, &subCamAt, &subCamEye);
Play_CameraSetFov(play, this->subCamId, 30.0f);
Letterbox_SetSizeTarget(32);
Interface_ChangeAlpha(2);
Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_NOTHING_ALT);
player->actor.world.pos = playerPos;
player->actor.speedXZ = 0.0f;
this->unk_1E2 = 0;
@ -556,7 +556,7 @@ void func_80B4BF2C(EnZl1* this, PlayState* play) {
case 6:
if (Actor_TextboxIsClosing(&this->actor, play)) {
func_8002DF54(play, &this->actor, 7);
Interface_ChangeAlpha(50);
Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_ALL);
this->actor.flags &= ~ACTOR_FLAG_8;
this->unk_1E2 = 4;
}

View file

@ -330,7 +330,7 @@ s32 EnZl4_SetupFromLegendCs(EnZl4* this, PlayState* play) {
EnZl4_SetActiveCamMove(play, 5);
Letterbox_SetSizeTarget(32);
Interface_ChangeAlpha(2);
Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_NOTHING_ALT);
this->talkTimer2 = 0;
return true;
}
@ -1150,7 +1150,7 @@ void EnZl4_Cutscene(EnZl4* this, PlayState* play) {
this->mouthExpression = ZL4_MOUTH_SURPRISED;
Audio_PlayFanfare(NA_BGM_APPEAR);
EnZl4_SetActiveCamDir(play, 0);
Interface_ChangeAlpha(2);
Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_NOTHING_ALT);
Letterbox_SetSizeTarget(32);
this->talkState = 0;
this->csState++;
@ -1194,7 +1194,7 @@ void EnZl4_Cutscene(EnZl4* this, PlayState* play) {
case ZL4_CS_PLAN:
if (EnZl4_CsMakePlan(this, play)) {
func_8002DF54(play, &this->actor, 7);
gSaveContext.unk_13EE = 0x32;
gSaveContext.prevHudVisibilityMode = HUD_VISIBILITY_ALL;
SET_EVENTCHKINF(EVENTCHKINF_40);
this->actionFunc = EnZl4_Idle;
}

View file

@ -5238,7 +5238,7 @@ void Fishing_UpdateOwner(Actor* thisx, PlayState* play2) {
sSubCamAt.y = mainCam->at.y;
sSubCamAt.z = mainCam->at.z;
D_80B7A6CC = 2;
Interface_ChangeAlpha(12);
Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_A_B_MINIMAP);
sSubCamVelFactor = 0.0f;
FALLTHROUGH;
}

View file

@ -165,8 +165,10 @@ void ObjLift_Shake(ObjLift* this, PlayState* play) {
ObjLift_SetupFall(this);
} else {
this->shakeOrientation.x += 10000;
this->dyna.actor.world.rot.x = (s16)(Math_SinS(this->shakeOrientation.x) * 300.0f) + this->dyna.actor.home.rot.x;
this->dyna.actor.world.rot.z = (s16)(Math_CosS(this->shakeOrientation.x) * 300.0f) + this->dyna.actor.home.rot.z;
this->dyna.actor.world.rot.x =
(s16)(Math_SinS(this->shakeOrientation.x) * 300.0f) + this->dyna.actor.home.rot.x;
this->dyna.actor.world.rot.z =
(s16)(Math_CosS(this->shakeOrientation.x) * 300.0f) + this->dyna.actor.home.rot.z;
this->dyna.actor.shape.rot.x = this->dyna.actor.world.rot.x;
this->dyna.actor.shape.rot.z = this->dyna.actor.world.rot.z;
this->shakeOrientation.y += 18000;

View file

@ -34,7 +34,7 @@ ActorInit Shot_Sun_InitVars = {
};
typedef enum {
/* 0 */ SPAWNER_OUT_OF_RANGE ,
/* 0 */ SPAWNER_OUT_OF_RANGE,
/* 1 */ SPAWNER_OCARINA_START,
/* 2 */ SPAWNER_OCARINA_PLAYING
} FairySpawnerState;

View file

@ -3106,7 +3106,7 @@ void func_80835DE4(PlayState* play, Player* this, PlayerFunc674 func, s32 flags)
void func_80835E44(PlayState* play, s16 camSetting) {
if (!Play_CamIsNotFixed(play)) {
if (camSetting == CAM_SET_SCENE_TRANSITION) {
Interface_ChangeAlpha(2);
Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_NOTHING_ALT);
}
} else {
Camera_ChangeSetting(Play_GetCamera(play, CAM_ID_MAIN), camSetting);

View file

@ -1469,7 +1469,7 @@ void FileSelect_LoadGame(GameState* thisx) {
gSaveContext.eventInf[1] = 0;
gSaveContext.eventInf[2] = 0;
gSaveContext.eventInf[3] = 0;
gSaveContext.unk_13EE = 0x32;
gSaveContext.prevHudVisibilityMode = HUD_VISIBILITY_ALL;
gSaveContext.nayrusLoveTimer = 0;
gSaveContext.healthAccumulator = 0;
gSaveContext.magicState = MAGIC_STATE_IDLE;
@ -1486,8 +1486,8 @@ void FileSelect_LoadGame(GameState* thisx) {
gSaveContext.buttonStatus[0] = gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] =
gSaveContext.buttonStatus[3] = gSaveContext.buttonStatus[4] = BTN_ENABLED;
gSaveContext.unk_13E7 = gSaveContext.unk_13E8 = gSaveContext.unk_13EA = gSaveContext.unk_13EC =
gSaveContext.magicCapacity = 0;
gSaveContext.forceRisingButtonAlphas = gSaveContext.nextHudVisibilityMode = gSaveContext.hudVisibilityMode =
gSaveContext.hudVisibilityModeTimer = gSaveContext.magicCapacity = 0; // false, HUD_VISIBILITY_NO_CHANGE
// Set the fill target to be the saved magic amount
gSaveContext.magicFillTarget = gSaveContext.magic;

View file

@ -29,7 +29,8 @@ void MapSelect_LoadGame(MapSelectState* this, s32 entranceIndex) {
}
gSaveContext.buttonStatus[0] = gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] =
gSaveContext.buttonStatus[3] = gSaveContext.buttonStatus[4] = BTN_ENABLED;
gSaveContext.unk_13E7 = gSaveContext.unk_13E8 = gSaveContext.unk_13EA = gSaveContext.unk_13EC = 0;
gSaveContext.forceRisingButtonAlphas = gSaveContext.nextHudVisibilityMode = gSaveContext.hudVisibilityMode =
gSaveContext.hudVisibilityModeTimer = 0; // false, HUD_VISIBILITY_NO_CHANGE
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0);
gSaveContext.entranceIndex = entranceIndex;
gSaveContext.respawnFlag = 0;

View file

@ -387,8 +387,8 @@ void KaleidoScope_SwitchPage(PauseContext* pauseCtx, u8 pt) {
osSyncPrintf("kscope->kscp_pos+pt = %d\n", pauseCtx->pageIndex + pt);
gSaveContext.unk_13EA = 0;
Interface_ChangeAlpha(50);
gSaveContext.hudVisibilityMode = HUD_VISIBILITY_NO_CHANGE;
Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_ALL);
}
void KaleidoScope_HandlePageToggles(PauseContext* pauseCtx, Input* input) {
@ -2935,8 +2935,8 @@ void KaleidoScope_Update(PlayState* play) {
gSaveContext.buttonStatus[0] = gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] =
gSaveContext.buttonStatus[3] = BTN_DISABLED;
gSaveContext.buttonStatus[4] = BTN_ENABLED;
gSaveContext.unk_13EA = 0;
Interface_ChangeAlpha(50);
gSaveContext.hudVisibilityMode = HUD_VISIBILITY_NO_CHANGE;
Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_ALL);
pauseCtx->unk_1EC = 0;
pauseCtx->state = 7;
}
@ -2982,8 +2982,8 @@ void KaleidoScope_Update(PlayState* play) {
gSaveContext.buttonStatus[0] = gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] =
gSaveContext.buttonStatus[3] = BTN_DISABLED;
gSaveContext.buttonStatus[4] = BTN_ENABLED;
gSaveContext.unk_13EA = 0;
Interface_ChangeAlpha(50);
gSaveContext.hudVisibilityMode = HUD_VISIBILITY_NO_CHANGE;
Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_ALL);
pauseCtx->unk_1EC = 0;
pauseCtx->state = 7;
} else if (pauseCtx->ocarinaStaff->state == pauseCtx->ocarinaSongIdx) {
@ -3032,8 +3032,8 @@ void KaleidoScope_Update(PlayState* play) {
gSaveContext.buttonStatus[0] = gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] =
gSaveContext.buttonStatus[3] = BTN_DISABLED;
gSaveContext.buttonStatus[4] = BTN_ENABLED;
gSaveContext.unk_13EA = 0;
Interface_ChangeAlpha(50);
gSaveContext.hudVisibilityMode = HUD_VISIBILITY_NO_CHANGE;
Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_ALL);
pauseCtx->unk_1EC = 0;
pauseCtx->state = 7;
}
@ -3066,8 +3066,8 @@ void KaleidoScope_Update(PlayState* play) {
Interface_SetDoAction(play, DO_ACTION_NONE);
gSaveContext.buttonStatus[0] = gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] =
gSaveContext.buttonStatus[3] = BTN_ENABLED;
gSaveContext.unk_13EA = 0;
Interface_ChangeAlpha(50);
gSaveContext.hudVisibilityMode = HUD_VISIBILITY_NO_CHANGE;
Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_ALL);
pauseCtx->unk_1EC = 2;
WREG(2) = -6240;
YREG(8) = pauseCtx->unk_204;
@ -3091,8 +3091,8 @@ void KaleidoScope_Update(PlayState* play) {
func_800F64E0(0);
gSaveContext.buttonStatus[0] = gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] =
gSaveContext.buttonStatus[3] = BTN_ENABLED;
gSaveContext.unk_13EA = 0;
Interface_ChangeAlpha(50);
gSaveContext.hudVisibilityMode = HUD_VISIBILITY_NO_CHANGE;
Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_ALL);
}
break;
@ -3102,8 +3102,8 @@ void KaleidoScope_Update(PlayState* play) {
Interface_SetDoAction(play, DO_ACTION_NONE);
gSaveContext.buttonStatus[0] = gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] =
gSaveContext.buttonStatus[3] = BTN_ENABLED;
gSaveContext.unk_13EA = 0;
Interface_ChangeAlpha(50);
gSaveContext.hudVisibilityMode = HUD_VISIBILITY_NO_CHANGE;
Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_ALL);
pauseCtx->unk_1EC = 5;
WREG(2) = -6240;
YREG(8) = pauseCtx->unk_204;
@ -3156,7 +3156,7 @@ void KaleidoScope_Update(PlayState* play) {
WREG(16) = -175;
WREG(17) = 155;
pauseCtx->unk_204 = -434.0f;
Interface_ChangeAlpha(1);
Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_NOTHING);
//! @bug messed up alignment, should match `ALIGN64`
pauseCtx->iconItemSegment = (void*)(((uintptr_t)play->objectCtx.spaceStart + 0x30) & ~0x3F);
@ -3507,9 +3507,9 @@ void KaleidoScope_Update(PlayState* play) {
gSaveContext.buttonStatus[4] = D_808321A8[4];
interfaceCtx->unk_1FA = interfaceCtx->unk_1FC = 0;
osSyncPrintf(VT_FGCOL(YELLOW));
osSyncPrintf("i=%d LAST_TIME_TYPE=%d\n", i, gSaveContext.unk_13EE);
gSaveContext.unk_13EA = 0;
Interface_ChangeAlpha(gSaveContext.unk_13EE);
osSyncPrintf("i=%d LAST_TIME_TYPE=%d\n", i, gSaveContext.prevHudVisibilityMode);
gSaveContext.hudVisibilityMode = HUD_VISIBILITY_NO_CHANGE;
Interface_ChangeHudVisibilityMode(gSaveContext.prevHudVisibilityMode);
player->targetActor = NULL;
Player_SetEquipmentData(play, player);
osSyncPrintf(VT_RST);