Fixes audio volume at boot if changed (#270)

* Fixes audio volume at boot if changed

* Update Settings refactor for settings we want to update in the future

* remove unused include

---------

Co-authored-by: MelonSpeedruns <melonspeedruns@stratobox.net>
This commit is contained in:
MelonSpeedruns
2026-04-07 13:56:23 -04:00
committed by GitHub
parent f58342ef12
commit ee5ab7978e
5 changed files with 17 additions and 4 deletions
+8 -1
View File
@@ -15,6 +15,7 @@
#include "JSystem/JUtility/JUTGamePad.h"
#include "dusk/config.hpp"
#include "dusk/settings.h"
#include "dusk/audio/DuskAudioSystem.h"
#if _WIN32
#define NOMINMAX
@@ -178,13 +179,19 @@ namespace dusk {
ImGuiConsole::ImGuiConsole() {}
void ImGuiConsole::UpdateSettings() {
dusk::audio::SetMasterVolume(dusk::getSettings().audio.masterVolume / 100.0f);
dusk::audio::SetEnableReverb(dusk::getSettings().audio.enableReverb);
getTransientSettings().skipFrameRateLimit = getSettings().game.enableTurboKeybind && ImGui::IsKeyDown(ImGuiKey_Tab);
}
void ImGuiConsole::PreDraw() {
if (!m_isLaunchInitialized) {
m_toasts.emplace_back("Press F1 to toggle menu"s, 5.f);
m_isLaunchInitialized = true;
}
getTransientSettings().skipFrameRateLimit = getSettings().game.enableTurboKeybind && ImGui::IsKeyDown(ImGuiKey_Tab);
UpdateSettings();
if ((ImGui::IsKeyDown(ImGuiKey_LeftCtrl) || ImGui::IsKeyDown(ImGuiKey_RightCtrl)) &&
ImGui::IsKeyPressed(ImGuiKey_R))