From 7d120a021f7fdf3c6718fd2e290da555bd0c2ab9 Mon Sep 17 00:00:00 2001 From: Eric Hoey <121978037+A-Green-Spoon@users.noreply.github.com> Date: Thu, 26 Oct 2023 20:39:18 -0400 Subject: [PATCH] Apply Goron Neck Length to Goron City Shopkeeper (#3289) * Add limb override for Goron shopkeep * Remove extra line breaks * Fix bug with goron neck length --------- Co-authored-by: Garrett Cox --- soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp | 2 +- soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c | 2 +- soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c | 11 ++++++++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp b/soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp index 548ffa60c..8c2707453 100644 --- a/soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp +++ b/soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp @@ -1535,7 +1535,7 @@ void DrawSillyTab() { CVarClear("gCosmetics.BunnyHood_EarSpread"); LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); } - UIWidgets::EnhancementSliderFloat("Goron Neck Length: %f", "##Goron_NeckLength", "gCosmetics.Goron_NeckLength", 0.0f, 1000.0f, "", 0.0f, false); + UIWidgets::EnhancementSliderFloat("Goron Neck Length: %f", "##Goron_NeckLength", "gCosmetics.Goron_NeckLength", 0.0f, 5000.0f, "", 0.0f, false); ImGui::SameLine(); if (ImGui::Button("Reset##Goron_NeckLength")) { CVarClear("gCosmetics.Goron_NeckLength"); diff --git a/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c b/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c index 02c4d37a7..87745131e 100644 --- a/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c +++ b/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c @@ -2140,7 +2140,7 @@ s32 EnGo2_OverrideLimbDraw(PlayState* play, s32 limb, Gfx** dList, Vec3f* pos, V Matrix_RotateX(float1, MTXMODE_APPLY); float1 = (vec1.x / (f32)0x8000) * M_PI; Matrix_RotateZ(float1, MTXMODE_APPLY); - Matrix_Translate(-2800.0f + CVarGetFloat("gCosmetics.Goron_NeckLength", 0.0f), 0.0f, 0.0f, MTXMODE_APPLY); + Matrix_Translate(-2800.0f, 0.0f, 0.0f, MTXMODE_APPLY); } if (limb == 10) { vec1 = this->interactInfo.torsoRot; diff --git a/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c b/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c index 2ae32e916..460c788b2 100644 --- a/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c +++ b/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c @@ -2531,6 +2531,15 @@ void EnOssan_DrawKokiriShopkeeper(Actor* thisx, PlayState* play) { CLOSE_DISPS(play->state.gfxCtx); } +s32 EnGo2_OverrideLimbDrawGoronShopkeeper (PlayState* play, s32 limb, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) { + EnOssan* this = (EnOssan*)thisx; + + if (limb == 17) { + Matrix_Translate(CVarGetFloat("gCosmetics.Goron_NeckLength", 0.0f), 0.0f, 0.0f, MTXMODE_APPLY); + } + return 0; +} + void EnOssan_DrawGoronShopkeeper(Actor* thisx, PlayState* play) { static void* sGoronShopkeeperEyeTextures[] = { gGoronCsEyeOpenTex, gGoronCsEyeHalfTex, gGoronCsEyeClosedTex }; EnOssan* this = (EnOssan*)thisx; @@ -2541,7 +2550,7 @@ void EnOssan_DrawGoronShopkeeper(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sGoronShopkeeperEyeTextures[this->eyeTextureIdx])); gSPSegment(POLY_OPA_DISP++, 0x09, SEGMENTED_TO_VIRTUAL(gGoronCsMouthNeutralTex)); - SkelAnime_DrawSkeletonOpa(play, &this->skelAnime, NULL, NULL, this); + SkelAnime_DrawSkeletonOpa(play, &this->skelAnime, EnGo2_OverrideLimbDrawGoronShopkeeper, NULL, this); EnOssan_DrawCursor(play, this, this->cursorX, this->cursorY, this->cursorZ, this->drawCursor); EnOssan_DrawStickDirectionPrompts(play, this);