diff --git a/GSChaos/CFeatureExtremeGrieferJesus.cpp b/GSChaos/CFeatureExtremeGrieferJesus.cpp index 70651ffb..30ddbc42 100644 --- a/GSChaos/CFeatureExtremeGrieferJesus.cpp +++ b/GSChaos/CFeatureExtremeGrieferJesus.cpp @@ -13,21 +13,11 @@ void CFeatureExtremeGrieferJesus::ActivateFeature() m_bActivated = true; m_bSpawned = false; - if (!m_bMusicIsPlaying) // TODO: remove this logic because SoLoud handles that already - { - m_bMusicIsPlaying = true; - m_flMusicTime = gChaos.GetGlobalTime() + 192.0; // track duration (3:12) - ChaosLoud::EmitSound(MUSIC_JESUS); - } + ChaosLoud::EmitSound(MUSIC_JESUS); } void CFeatureExtremeGrieferJesus::OnFrame(double time) { - if (m_bMusicIsPlaying && gChaos.GetGlobalTime() > m_flMusicTime) - { - m_bMusicIsPlaying = false; - } - if (g_bDespawnJesus) { m_bSpawned = false; diff --git a/GSChaos/ChaosLoudManager.cpp b/GSChaos/ChaosLoudManager.cpp index 9db498f9..faaad735 100644 --- a/GSChaos/ChaosLoudManager.cpp +++ b/GSChaos/ChaosLoudManager.cpp @@ -4,10 +4,15 @@ namespace ChaosLoud { SoLoud::Wav g_wBank[SOUNDBANK_SIZE]; float g_flVolume = 0.0f; - cvar_t* volume; + cvar_t* volume, *chaos_volume_multiplier; void LoadSounds() { + if (chaos_volume_multiplier == nullptr) + { + chaos_volume_multiplier = pEngfuncs->pfnRegisterVariable("chaos_volume_multiplier", "8", 0); + } + g_wBank[MUSIC_JESUS].load("chaos/egj.mp3"); g_wBank[MUSIC_OPFOR01].load("chaos/opfor01.mp3"); g_wBank[SND_SLAP].load("chaos/slap.mp3"); @@ -65,13 +70,16 @@ namespace ChaosLoud void UpdateVolume() { + if (chaos_volume_multiplier) + chaos_volume_multiplier->value = std::clamp(chaos_volume_multiplier->value, 1.0f, 100.0f); // just for sanity + if (volume == nullptr) { volume = pEngfuncs->pfnGetCvarPointer("volume"); } else { - g_flVolume = std::clamp(volume->value, 0.0f, 2.0f) * 2.0f; + g_flVolume = std::clamp(volume->value, 0.0f, 2.0f) * (chaos_volume_multiplier ? chaos_volume_multiplier->value : 10.0f); for (int i = 0; i < SOUNDBANK_SIZE; i++) { diff --git a/README.md b/README.md index f598c6a5..d5f681a0 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ Additional info: - `chaos_draw_as_overlay` - if enabled, it draws Chaos UI as overlay and requires enabling 3rd-party overlays in OBS - `chaos_consistent_mode` - switches consistent mode. Consistent mode involves turning on certain effects for an unlimited amount of time without Chaos bar/timer. - `chaos_consistent_effects_add` - activate consistent effect (works only with consistent mode enabled) +- `chaos_volume_multiplier` - increases volume from SoLoud sounds (volume->value * chaos_volume_multiplier->value) ## Twitch voting integration (WIP) GSChaos supports Twitch chat voting. If you want to use it, then do some steps: