diff --git a/soh/soh/SohMenuBar.cpp b/soh/soh/SohMenuBar.cpp index 65ee180bb..0c0a1240b 100644 --- a/soh/soh/SohMenuBar.cpp +++ b/soh/soh/SohMenuBar.cpp @@ -1066,6 +1066,9 @@ void DrawEnhancementsMenu() { UIWidgets::Tooltip("Prevents immediately falling off climbable surfaces if climbing on the edges."); UIWidgets::PaddedEnhancementCheckbox("Fix Link's eyes open while sleeping", "gFixEyesOpenWhileSleeping", true, false); UIWidgets::Tooltip("Fixes Link's eyes being open in the opening cutscene when he is supposed to be sleeping."); + UIWidgets::PaddedEnhancementCheckbox("Fix Darunia dancing too fast", "gEnhancements.FixDaruniaDanceSpeed", + true, false, false, "", UIWidgets::CheckboxGraphics::Cross, true); + UIWidgets::Tooltip("Fixes Darunia's dancing speed so he dances to the beat of Saria's Song, like in vanilla."); ImGui::EndMenu(); } diff --git a/soh/src/overlays/actors/ovl_En_Du/z_en_du.c b/soh/src/overlays/actors/ovl_En_Du/z_en_du.c index acd64e308..f9374f416 100644 --- a/soh/src/overlays/actors/ovl_En_Du/z_en_du.c +++ b/soh/src/overlays/actors/ovl_En_Du/z_en_du.c @@ -95,6 +95,26 @@ static AnimationInfo sAnimationInfo[] = { { &gDaruniaDancingEndAnim, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, -6.0f }, }; +// #region SOH [Enhancement] Only animations too fast need to be slowed down, otherwise not touched +static AnimationInfo sAnimationInfoFix[] = { + { NULL }, + { NULL }, + { NULL }, + { NULL }, + { NULL }, + { NULL }, + { NULL }, + { &gDaruniaDancingLoop1Anim, 0.78f, 0.0f, -1.0f, ANIMMODE_ONCE, -10.0f }, // + { &gDaruniaDancingLoop1Anim, 0.77f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, // hop + { &gDaruniaDancingLoop2Anim, 0.78f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, // from hop to spin + { &gDaruniaDancingLoop3Anim, 0.77f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, // spin + { NULL }, + { NULL }, + { &gDaruniaDancingLoop4Anim, 0.78f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, // from spin to hop + { NULL }, +}; +// #endregion + void EnDu_SetupAction(EnDu* this, EnDuActionFunc actionFunc) { this->actionFunc = actionFunc; } @@ -255,7 +275,13 @@ void func_809FE040(EnDu* this) { if (this->unk_1E6 >= 8) { this->unk_1E6 = 0; } - Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, animationIndices[this->unk_1E6]); + // #region SOH[Enhancement] + if (CVarGetInteger("gEnhancements.FixDaruniaDanceSpeed", 1)) { + Animation_ChangeByInfo(&this->skelAnime, sAnimationInfoFix, animationIndices[this->unk_1E6]); + // #endregion + } else { + Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, animationIndices[this->unk_1E6]); + } } } @@ -271,7 +297,13 @@ void func_809FE104(EnDu* this) { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { this->unk_1E6++; if (this->unk_1E6 < 4) { - Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, animationIndices[this->unk_1E6]); + // #region SOH[Enhancement] + if (CVarGetInteger("gEnhancements.FixDaruniaDanceSpeed", 1) && this->unk_1E6 <= 1) { + Animation_ChangeByInfo(&this->skelAnime, sAnimationInfoFix, animationIndices[this->unk_1E6]); + // #endregion + } else { + Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, animationIndices[this->unk_1E6]); + } } } } @@ -465,7 +497,13 @@ void func_809FE890(EnDu* this, PlayState* play) { } if (csAction->action == 7 || csAction->action == 8) { this->unk_1E6 = 0; - Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENDU_ANIM_7); + // #region SOH[Enhancement] + if (CVarGetInteger("gEnhancements.FixDaruniaDanceSpeed", 1)) { + Animation_ChangeByInfo(&this->skelAnime, sAnimationInfoFix, ENDU_ANIM_7); + // #endregion + } else { + Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENDU_ANIM_7); + } } this->unk_1EA = csAction->action; if (this->unk_1EA == 7) {