mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-02-07 02:40:30 -05:00
Link voice pitch v0 (#2430)
* Link voice pitch v0 * Using a new variable instead * Move voice pitch slider to Options tab * fallback to original behavior if freqMultiplier is set to 1 * Move reset button to Options tab with its slider * Fix voice pitch slider width in Options tab * [Review] Always use freqMultiplier
This commit is contained in:
parent
196de9d05d
commit
0f6147f41d
@ -371,6 +371,18 @@ void DrawSfxEditor(bool& open) {
|
||||
"gSeqNameOverlayDuration", 1, 10, "", 5);
|
||||
ImGui::PopItemWidth();
|
||||
ImGui::NewLine();
|
||||
ImGui::PopItemWidth();
|
||||
UIWidgets::EnhancementSliderFloat("Link's voice pitch multiplier: %f", "##linkVoiceFreqMultiplier",
|
||||
"gLinkVoiceFreqMultiplier", 0.4, 2.5, "", 1.0, false, false);
|
||||
ImGui::SameLine();
|
||||
const std::string resetButton = "Reset##linkVoiceFreqMultiplier";
|
||||
if (ImGui::Button(resetButton.c_str())) {
|
||||
CVarSetFloat("gLinkVoiceFreqMultiplier", 1.0f);
|
||||
SohImGui::RequestCvarSaveOnNextTick();
|
||||
}
|
||||
|
||||
ImGui::NewLine();
|
||||
ImGui::PushItemWidth(-FLT_MIN);
|
||||
UIWidgets::PaddedSeparator();
|
||||
UIWidgets::PaddedText("The following options are experimental and may cause music\nto sound odd or have other undesireable effects.");
|
||||
UIWidgets::EnhancementCheckbox("Lower Octaves of Unplayable High Notes", "gExperimentalOctaveDrop");
|
||||
|
@ -82,6 +82,9 @@ static s32 sCurCeilingBgId;
|
||||
// Used for animating the ice trap on the "Get Item" model.
|
||||
f32 iceTrapScale;
|
||||
|
||||
// For Link's voice pitch SFX modifier
|
||||
static f32 freqMultiplier = 1;
|
||||
|
||||
void ActorShape_Init(ActorShape* shape, f32 yOffset, ActorShadowFunc shadowDraw, f32 shadowScale) {
|
||||
shape->yOffset = yOffset;
|
||||
shape->shadowDraw = shadowDraw;
|
||||
@ -2185,7 +2188,17 @@ void func_8002F7A0(PlayState* play, Actor* actor, f32 arg2, s16 arg3, f32 arg4)
|
||||
}
|
||||
|
||||
void func_8002F7DC(Actor* actor, u16 sfxId) {
|
||||
Audio_PlaySoundGeneral(sfxId, &actor->projectedPos, 4, &D_801333E0, &D_801333E0, &D_801333E8);
|
||||
if (actor->id != ACTOR_PLAYER || sfxId < NA_SE_VO_LI_SWORD_N || sfxId > NA_SE_VO_LI_ELECTRIC_SHOCK_LV_KID) {
|
||||
Audio_PlaySoundGeneral(sfxId, &actor->projectedPos, 4, &D_801333E0 , &D_801333E0, &D_801333E8);
|
||||
} else {
|
||||
freqMultiplier = CVarGetFloat("gLinkVoiceFreqMultiplier", 1.0);
|
||||
if (freqMultiplier <= 0) {
|
||||
freqMultiplier = 1;
|
||||
}
|
||||
// Authentic behavior uses D_801333E0 for both freqScale and a4
|
||||
// Audio_PlaySoundGeneral(sfxId, &actor->projectedPos, 4, &D_801333E0 , &D_801333E0, &D_801333E8);
|
||||
Audio_PlaySoundGeneral(sfxId, &actor->projectedPos, 4, &freqMultiplier, &D_801333E0, &D_801333E8);
|
||||
}
|
||||
}
|
||||
|
||||
void Audio_PlayActorSound2(Actor* actor, u16 sfxId) {
|
||||
|
Loading…
Reference in New Issue
Block a user