feat(audio): add custom sound volume slider
This commit is contained in:
@@ -95,6 +95,24 @@ internal sealed class General : ISettingsTab
|
||||
{
|
||||
ImGui.Checkbox(Language.Options_PlaySounds_Name, ref Mutable.PlaySounds);
|
||||
ImGuiUtil.HelpMarker(Language.Options_PlaySounds_Description);
|
||||
// Volume is stored as a 0-1 float but shown as 0-100% to match user
|
||||
// intuition. Full range — unlike opacity there is no unsafe floor.
|
||||
var customSoundVolumePercent = Mutable.CustomSoundVolume * 100f;
|
||||
if (
|
||||
ImGuiUtil.DragFloatVertical(
|
||||
HellionStrings.Settings_General_CustomSoundVolume_Name,
|
||||
ref customSoundVolumePercent,
|
||||
1f,
|
||||
0f,
|
||||
100f,
|
||||
$"{customSoundVolumePercent:N0}%%",
|
||||
ImGuiSliderFlags.AlwaysClamp
|
||||
)
|
||||
)
|
||||
{
|
||||
Mutable.CustomSoundVolume = customSoundVolumePercent / 100f;
|
||||
}
|
||||
ImGuiUtil.HelpMarker(HellionStrings.Settings_General_CustomSoundVolume_Description);
|
||||
|
||||
ImGui.Checkbox(Language.Options_ShowNoviceNetwork_Name, ref Mutable.ShowNoviceNetwork);
|
||||
ImGuiUtil.HelpMarker(Language.Options_ShowNoviceNetwork_Description);
|
||||
|
||||
@@ -234,7 +234,7 @@ internal sealed class Tabs : ISettingsTab
|
||||
}
|
||||
else
|
||||
{
|
||||
Plugin.CustomAudioPlayer.Play((int)previewId - 16);
|
||||
Plugin.CustomAudioPlayer.Play((int)previewId - 16, Mutable.CustomSoundVolume);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user