This commit is contained in:
MoriyaFaith 2023-11-01 10:57:41 -04:00
parent ff7fa77427
commit 1e453c7785
5 changed files with 42 additions and 6 deletions

@ -1 +1 @@
Subproject commit f1bc0a726813d7e70ad471fdebd080e6fd77996a
Subproject commit 717ae786632e3f3e5f32a12dc0ecd86958593a8b

2
ZAPDTR

@ -1 +1 @@
Subproject commit 9b8e224dac83aa8e47a688884ad48725f18fc293
Subproject commit 3d8a9c1efe15ad84bfca78a5a08a02489d8ed98c

@ -1 +1 @@
Subproject commit 317edd72cc317387f8ac010a9ec772d4bfdfdbb6
Subproject commit ec44917cf5536c8c59aaa7865696926e0bec1ba0

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"
@ -572,6 +573,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 & 0x20000080) || (this->csMode != 0) || (play->sceneLoadFlag == 0x14) ||
(this->stateFlags1 & 1) || (this->stateFlags3 & 0x80) ||
@ -1720,11 +1738,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);
}