Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slams/FX Volume Increase #602

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Main/include/SettingsPage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
19 changes: 19 additions & 0 deletions Main/src/SettingsPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion Main/src/SettingsScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)");
Expand Down