This commit is contained in:
MoriyaFaith 2024-04-08 00:35:00 -04:00 committed by GitHub
commit 109375dc58
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 39 additions and 3 deletions

View File

@ -56,6 +56,13 @@ static const ALIGN_ASSET(2) char gTriforcePiece2DL[] = dgTriforcePiece2DL;
#define dgTriforcePieceCompletedDL "__OTR__objects/object_triforce_completed/gTriforcePieceCompletedDL"
static const ALIGN_ASSET(2) char gTriforcePieceCompletedDL[] = dgTriforcePieceCompletedDL;
#define dgLinkBottleDL "__OTR__objects/object_link_eq/gLinkBottleDL"
static const ALIGN_ASSET(2) char gLinkBottleDL[] = dgLinkBottleDL;
#define dgLinkBottleContentsDL "__OTR__objects/object_link_eq/gLinkBottleContentsDL"
static const ALIGN_ASSET(2) char gLinkBottleContentsDL[] = dgLinkBottleContentsDL;
// overlays
#define dgOptionsDividerChangeLangVtx "__OTR__overlays/ovl_file_choose/gOptionsDividerChangeLangVtx"
static const ALIGN_ASSET(2) char gOptionsDividerChangeLangVtx[] = dgOptionsDividerChangeLangVtx;

View File

@ -5,6 +5,7 @@
#include "objects/object_link_child/object_link_child.h"
#include "objects/object_triforce_spot/object_triforce_spot.h"
#include "overlays/actors/ovl_Demo_Effect/z_demo_effect.h"
#include "soh_assets.h"
#include "soh/Enhancements/game-interactor/GameInteractor.h"
#include "soh/Enhancements/randomizer/draw.h"
@ -563,6 +564,23 @@ uint8_t Player_IsCustomLinkModel() {
(LINK_IS_CHILD && ResourceGetIsCustomByName(gLinkChildSkel));
}
// Alternate Equipment Loading function. (global function)
// Checks if player can use new loading method, for Bottles Only.
uint8_t Player_CanUseNewLoadingMethodBottle(Player* this) {
if (!CVarGetInteger("gAltLinkEquip", 1)) {
return false;
}
switch (this->leftHandType) {
case PLAYER_MODELTYPE_LH_BOTTLE:
if (ResourceGetIsCustomByName(gLinkBottleDL)) {
return true;
}
break;
return false;
}
}
s32 Player_InBlockingCsMode(PlayState* play, Player* this) {
return (this->stateFlags1 & (PLAYER_STATE1_DEAD | PLAYER_STATE1_IN_CUTSCENE)) || (this->csAction != 0) || (play->transitionTrigger == TRANS_TRIGGER_START) ||
(this->stateFlags1 & PLAYER_STATE1_LOADING) || (this->stateFlags3 & PLAYER_STATE3_HOOKSHOT_TRAVELLING) ||
@ -1808,11 +1826,22 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList, Ve
OPEN_DISPS(play->state.gfxCtx);
gSPMatrix(POLY_XLU_DISP++, MATRIX_NEWMTX(play->state.gfxCtx),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gDPSetEnvColor(POLY_XLU_DISP++, bottleColor->r, bottleColor->g, bottleColor->b, 0);
gSPDisplayList(POLY_XLU_DISP++, sBottleDLists[(gSaveContext.linkAge)]);
if (this->itemAction != PLAYER_IA_BOTTLE && Player_CanUseNewLoadingMethodBottle(this) &&
ResourceGetIsCustomByName(gLinkBottleContentsDL)) { //check to make sure that this won't break everything
gSPMatrix(POLY_XLU_DISP++, MATRIX_NEWMTX(play->state.gfxCtx),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, (Gfx*)gLinkBottleContentsDL);
}
gSPMatrix(POLY_XLU_DISP++, MATRIX_NEWMTX(play->state.gfxCtx),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
if (Player_CanUseNewLoadingMethodBottle(this)) {
gSPDisplayList(POLY_XLU_DISP++, (Gfx*)gLinkBottleDL);
} else {
gSPDisplayList(POLY_XLU_DISP++, sBottleDLists[(gSaveContext.linkAge)]);
}
CLOSE_DISPS(play->state.gfxCtx);
}