From 351a511dc7bca645c7e7e92c4a020466ddf050d0 Mon Sep 17 00:00:00 2001 From: skyyoshi86 <105878730+skyyoshi86@users.noreply.github.com> Date: Thu, 1 Feb 2024 19:44:16 -0700 Subject: [PATCH] Cosmetics Editor entry for Ivan the Fairy (#3718) * First commit * Reverted MODDING.md Reverted a correction to MODDING.md (case-sensitive broken link?) as this is not a change related to this PR * Delete CMakeSettings.json Deleted CMakeSettings.json as this is not a change related to this PR. * checks for cosmetic changes ONCE for both body and sparles Please review carefully. I made these changes blindly as I figure out why I can't compile it in my machine anymore. Sorry! * correctly updates OUTER color when it's changed in Cosmetics Editor * Update soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp * Update soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp * Update soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp * Update soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp * Update soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp * Update soh/src/overlays/actors/ovl_En_Partner/z_en_partner.c * Update soh/src/overlays/actors/ovl_En_Partner/z_en_partner.c * Update soh/src/overlays/actors/ovl_En_Partner/z_en_partner.c Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> * Update soh/src/overlays/actors/ovl_En_Partner/z_en_partner.c Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> * Update soh/src/overlays/actors/ovl_En_Partner/z_en_partner.c Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> * Update soh/src/overlays/actors/ovl_En_Partner/z_en_partner.c Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> * Update soh/src/overlays/actors/ovl_En_Partner/z_en_partner.c --------- Co-authored-by: Garrett Cox Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> --- docs/MODDING.md | 2 +- .../cosmetics/CosmeticsEditor.cpp | 8 +++++++ .../actors/ovl_En_Partner/z_en_partner.c | 22 +++++++++++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/docs/MODDING.md b/docs/MODDING.md index ebd7cf071..75293b64a 100644 --- a/docs/MODDING.md +++ b/docs/MODDING.md @@ -188,4 +188,4 @@ Assuming all went well, you can now push your changes to your fork with the foll ```bash git push origin -``` \ No newline at end of file +``` diff --git a/soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp b/soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp index 6c1e007fa..240bf5894 100644 --- a/soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp +++ b/soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp @@ -76,6 +76,7 @@ typedef enum { GROUP_SPIN_ATTACK, GROUP_TRAILS, GROUP_NAVI, + GROUP_IVAN, } CosmeticGroup; std::map groupLabels = { @@ -95,6 +96,7 @@ std::map groupLabels = { { GROUP_SPIN_ATTACK, "Spin Attack" }, { GROUP_TRAILS, "Trails" }, { GROUP_NAVI, "Navi" }, + { GROUP_IVAN, "Ivan" } }; typedef struct { @@ -350,6 +352,9 @@ static std::map cosmeticOptions = { COSMETIC_OPTION("Navi_EnemySecondary", "Enemy Secondary", GROUP_NAVI, ImVec4(200, 155, 0, 0), false, true, true), COSMETIC_OPTION("Navi_PropsPrimary", "Props Primary", GROUP_NAVI, ImVec4( 0, 255, 0, 255), false, true, false), COSMETIC_OPTION("Navi_PropsSecondary", "Props Secondary", GROUP_NAVI, ImVec4( 0, 255, 0, 0), false, true, true), + + COSMETIC_OPTION("Ivan_IdlePrimary", "Ivan Idle Primary", GROUP_IVAN, ImVec4(255, 255, 255, 255), false, true, false), + COSMETIC_OPTION("Ivan_IdleSecondary", "Ivan Idle Secondary", GROUP_IVAN, ImVec4( 0, 255, 0, 255), false, true, true), COSMETIC_OPTION("NPC_FireKeesePrimary", "Fire Keese Primary", GROUP_NPC, ImVec4(255, 255, 255, 255), false, true, false), COSMETIC_OPTION("NPC_FireKeeseSecondary", "Fire Keese Secondary", GROUP_NPC, ImVec4(255, 255, 255, 255), false, true, true), @@ -1660,6 +1665,8 @@ void RandomizeColor(CosmeticOption& cosmeticOption) { CopyMultipliedColor(cosmeticOption, cosmeticOptions.at("Navi_NPCSecondary"), 1.0f); } else if (cosmeticOption.label == "Props Primary") { CopyMultipliedColor(cosmeticOption, cosmeticOptions.at("Navi_PropsSecondary"), 1.0f); + } else if (cosmeticOption.label == "Ivan Idle Primary") { + CopyMultipliedColor(cosmeticOption, cosmeticOptions.at("Ivan_IdleSecondary"), 0.5f); } else if (cosmeticOption.label == "Level 1 Secondary") { CopyMultipliedColor(cosmeticOption, cosmeticOptions.at("SpinAttack_Level1Primary"), 2.0f); } else if (cosmeticOption.label == "Level 2 Secondary") { @@ -1892,6 +1899,7 @@ void CosmeticsEditorWindow::DrawElement() { if (ImGui::BeginTabItem("World & NPCs")) { DrawCosmeticGroup(GROUP_WORLD); DrawCosmeticGroup(GROUP_NAVI); + DrawCosmeticGroup(GROUP_IVAN); DrawCosmeticGroup(GROUP_NPC); ImGui::EndTabItem(); } diff --git a/soh/src/overlays/actors/ovl_En_Partner/z_en_partner.c b/soh/src/overlays/actors/ovl_En_Partner/z_en_partner.c index 51e3e1499..6a001d07b 100644 --- a/soh/src/overlays/actors/ovl_En_Partner/z_en_partner.c +++ b/soh/src/overlays/actors/ovl_En_Partner/z_en_partner.c @@ -745,6 +745,28 @@ void EnPartner_Update(Actor* thisx, PlayState* play) { CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); } + if (CVarGetInteger("gCosmetics.Ivan_IdlePrimary.Changed", 0)) { + Color_RGB8 ivanColor1 = CVarGetColor24("gCosmetics.Ivan_IdlePrimary.Value", (Color_RGB8){ 255, 255, 255 }); + this->innerColor.r = ivanColor1.r; + this->innerColor.g = ivanColor1.g; + this->innerColor.b = ivanColor1.b; + } else { + this->innerColor.r = 255; + this->innerColor.g = 255; + this->innerColor.b = 255; + } + + if (CVarGetInteger("gCosmetics.Ivan_IdleSecondary.Changed", 0)) { + Color_RGB8 ivanColor2 = CVarGetColor24("gCosmetics.Ivan_IdleSecondary.Value", (Color_RGB8){ 0, 255, 0 }); + this->outerColor.r = ivanColor2.r; + this->outerColor.g = ivanColor2.g; + this->outerColor.b = ivanColor2.b; + } else { + this->outerColor.r = 0; + this->outerColor.g = 255; + this->outerColor.b = 0; + } + SkelAnime_Update(&this->skelAnime); EnPartner_UpdateLights(this, play);