altasset cvar

Started moving things to work just based on the alt assets cvar. Currently crashing when toggled off
This commit is contained in:
Patrick12115 2024-02-25 20:58:23 -05:00
parent 0f4eba942c
commit c3c839eb8a
3 changed files with 6 additions and 5 deletions

View File

@ -760,7 +760,7 @@ void UpdatePatchHand() {
ResourceMgr_UnpatchGfxByName(gLinkChildLeftFistAndBoomerangNearDL, "adultBoomerang");
ResourceMgr_UnpatchGfxByName(gLinkChildRightFistAndDekuShieldNearDL, "adultDekuShield");
}
if ((CVarGetInteger("gEnhancements.EquimentAlwaysVisible", 0)) && LINK_IS_ADULT && Player_IsCustomLinkModel) {
if ((CVarGetInteger("gEnhancements.EquimentAlwaysVisible", 0)) && LINK_IS_ADULT) {
ResourceMgr_PatchCustomGfxByName(gLinkChildLeftFistNearDL, "customAdultHand1", 0, gsSPDisplayListOTRFilePath(gLinkAdultLeftHandClosedNearDL));
ResourceMgr_PatchCustomGfxByName(gLinkChildLeftFistNearDL, "customAdultHand2", 1, gsSPEndDisplayList());
ResourceMgr_PatchCustomGfxByName(gLinkChildRightHandClosedNearDL, "customAdultHand3", 0, gsSPDisplayListOTRFilePath(gLinkAdultRightHandClosedNearDL));
@ -771,7 +771,7 @@ void UpdatePatchHand() {
ResourceMgr_UnpatchGfxByName(gLinkChildRightHandClosedNearDL, "customAdultHand3");
ResourceMgr_UnpatchGfxByName(gLinkChildRightHandClosedNearDL, "customAdultHand4");
}
if ((CVarGetInteger("gEnhancements.CustomEquipDlists", 0)) && LINK_IS_CHILD && Player_IsCustomLinkModel) {
if ((CVarGetInteger("gEnhancements.EquimentAlwaysVisible", 0)) && LINK_IS_CHILD) {
ResourceMgr_PatchCustomGfxByName(gLinkAdultLeftHandClosedNearDL, "customChildHand1", 0, gsSPDisplayListOTRFilePath(gLinkChildLeftFistNearDL));
ResourceMgr_PatchCustomGfxByName(gLinkAdultLeftHandClosedNearDL, "customChildHand2", 1, gsSPEndDisplayList());
ResourceMgr_PatchCustomGfxByName(gLinkAdultRightHandClosedNearDL, "customChildHand3", 0, gsSPDisplayListOTRFilePath(gLinkChildRightHandClosedNearDL));
@ -794,7 +794,7 @@ void PatchOrUnpatch(const char* resource, const char* gfx, const char* dlist1, c
if (resource == NULL || gfx == NULL || dlist1 == NULL || dlist2 == NULL)
return;
if (ResourceGetIsCustomByName(gfx) && CVarGetInteger("gEnhancements.CustomEquipDlists", 0)) {
if (ResourceGetIsCustomByName(gfx) && CVarGetInteger("gAltAssets", 0)) {
if (alternateDL == NULL || ResourceGetIsCustomByName(alternateDL) || ResourceMgr_FileExists(alternateDL)) {
ResourceMgr_PatchCustomGfxByName(resource, dlist1, 0, gsSPDisplayListOTRFilePath(gfx));
if (dlist3 == NULL) {

View File

@ -1395,6 +1395,7 @@ extern "C" void Graph_ProcessGfxCommands(Gfx* commands) {
// Actually update the CVar now before runing the alt asset update listeners
CVarSetInteger("gAltAssets", !CVarGetInteger("gAltAssets", 0));
UpdatePatchCustomEquipmentDlists();
gfx_texture_cache_clear();
SOH::SkeletonPatcher::UpdateSkeletons();
GameInteractor::Instance->ExecuteHooks<GameInteractor::OnAssetAltChange>();

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 "objects/object_custom_equip/object_custom_equip.h"
#include "soh/Enhancements/game-interactor/GameInteractor.h"
#include "soh/Enhancements/randomizer/draw.h"
@ -1279,11 +1280,10 @@ s32 Player_OverrideLimbDrawGameplayCommon(PlayState* play, s32 limbIndex, Gfx**
}
}
if (CVarGetInteger("gEnhancements.CustomEquipDlists", 0) && CVarGetInteger("gEnhancements.ScaleAdultEquimentAsChild", 0) && LINK_IS_CHILD) {
if (ResourceGetIsCustomByName(gCustomDekuShieldOnBackScaledDL) && CVarGetInteger("gEnhancements.ScaleAdultEquimentAsChild", 0) && LINK_IS_CHILD) {
if (limbIndex == PLAYER_LIMB_SHEATH) {
if ((this->currentShield == PLAYER_SHIELD_DEKU && gSaveContext.equips.buttonItems[0] != ITEM_SWORD_KOKIRI &&
(this->sheathType == PLAYER_MODELTYPE_SHEATH_18 || this->sheathType == PLAYER_MODELTYPE_SHEATH_19))) {
// Matrix_Translate(218, -100, 62, MTXMODE_APPLY);
Matrix_Scale(0.8, 0.8, 0.8, MTXMODE_APPLY);
}
}