From 5b655418d86dfa5a4cf8c6b721afa48a0c2184ad Mon Sep 17 00:00:00 2001 From: varxxx Date: Wed, 29 Jun 2022 16:27:50 -0400 Subject: [PATCH] Quiet Slams/FX Fix Changed the range on the Volume Slider for Slams/FX to 200%. --- Main/include/SettingsPage.hpp | 1 + Main/src/SettingsPage.cpp | 19 +++++++++++++++++++ Main/src/SettingsScreen.cpp | 2 +- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/Main/include/SettingsPage.hpp b/Main/include/SettingsPage.hpp index 51b8a2f30..790b1b890 100644 --- a/Main/include/SettingsPage.hpp +++ b/Main/include/SettingsPage.hpp @@ -107,6 +107,7 @@ class SettingsPage float FloatInput(float val, const std::string_view& label, float min, float max, float step, float perPixel); bool FloatSetting(GameConfigKeys key, const std::string_view& label, float min, float max, float step = 0.01f); bool PercentSetting(GameConfigKeys key, const std::string_view& label); + bool HighPercentSetting(GameConfigKeys key, const std::string_view& label); Color ColorInput(const Color& val, const std::string_view& label, bool& useHSV); diff --git a/Main/src/SettingsPage.cpp b/Main/src/SettingsPage.cpp index f34f18d45..a8fca6970 100644 --- a/Main/src/SettingsPage.cpp +++ b/Main/src/SettingsPage.cpp @@ -240,6 +240,25 @@ bool SettingsPage::PercentSetting(GameConfigKeys key, const std::string_view& la } } +bool SettingsPage::HighPercentSetting(GameConfigKeys key, const std::string_view& label) +{ + float value = g_gameConfig.GetFloat(key); + const float prevValue = value; + + nk_labelf(m_nctx, nk_text_alignment::NK_TEXT_LEFT, label.data(), value * 100); + nk_slider_float(m_nctx, 0, &value, 2, 0.005f); + + if (value != prevValue) + { + g_gameConfig.Set(key, value); + return true; + } + else + { + return false; + } +} + Color SettingsPage::ColorInput(const Color& val, const std::string_view& label, bool& useHSV) { LayoutRowDynamic(1); Label(label); diff --git a/Main/src/SettingsScreen.cpp b/Main/src/SettingsScreen.cpp index 26c8b91f4..e554f002f 100644 --- a/Main/src/SettingsScreen.cpp +++ b/Main/src/SettingsScreen.cpp @@ -728,7 +728,7 @@ class SettingsPage_System : public SettingsPage SectionHeader("Audio"); PercentSetting(GameConfigKeys::MasterVolume, "Master volume (%.1f%%):"); - PercentSetting(GameConfigKeys::SlamVolume, "Slam/Clap volume (%.1f%%):"); + HighPercentSetting(GameConfigKeys::SlamVolume, "Slam/Clap volume (%.2f%%):"); ToggleSetting(GameConfigKeys::MuteUnfocused, "Mute the game when unfocused"); #ifdef _WIN32 ToggleSetting(GameConfigKeys::WASAPI_Exclusive, "WASAPI exclusive mode (requires restart)");