mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Re-enable music/sounds when volume cvars are changed
This commit is contained in:
parent
c11c7bcbbd
commit
375d87255e
2 changed files with 22 additions and 2 deletions
|
|
@ -318,8 +318,10 @@ consvar_t cv_controlperkey = Player("controlperkey", "One").values({{1, "One"},
|
||||||
// actual general (maximum) sound & music volume, saved into the config
|
// actual general (maximum) sound & music volume, saved into the config
|
||||||
// Volume scale is 0-100 in new mixer. 100 is treated as -0dB or 100% gain. No more weirdness to work around SDL_mixer
|
// Volume scale is 0-100 in new mixer. 100 is treated as -0dB or 100% gain. No more weirdness to work around SDL_mixer
|
||||||
// problems
|
// problems
|
||||||
consvar_t cv_digmusicvolume = Player("musicvolume", "80").min_max(0, 100);
|
void DigMusicVolume_OnChange(void);
|
||||||
consvar_t cv_soundvolume = Player("soundvolume", "80").min_max(0, 100);
|
void SoundVolume_OnChange(void);
|
||||||
|
consvar_t cv_digmusicvolume = Player("musicvolume", "80").min_max(0, 100).onchange_noinit(DigMusicVolume_OnChange);
|
||||||
|
consvar_t cv_soundvolume = Player("soundvolume", "80").min_max(0, 100).onchange_noinit(SoundVolume_OnChange);
|
||||||
|
|
||||||
#ifdef HAVE_DISCORDRPC
|
#ifdef HAVE_DISCORDRPC
|
||||||
void DRPC_UpdatePresence(void);
|
void DRPC_UpdatePresence(void);
|
||||||
|
|
|
||||||
|
|
@ -2540,3 +2540,21 @@ void PlaySoundIfUnfocused_OnChange(void)
|
||||||
if (window_notinfocus && !cv_playsoundifunfocused.value)
|
if (window_notinfocus && !cv_playsoundifunfocused.value)
|
||||||
S_StopSounds();
|
S_StopSounds();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DigMusicVolume_OnChange(void);
|
||||||
|
void DigMusicVolume_OnChange(void)
|
||||||
|
{
|
||||||
|
if (!cv_gamedigimusic.value)
|
||||||
|
{
|
||||||
|
CV_SetValue(&cv_gamedigimusic, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void SoundVolume_OnChange(void);
|
||||||
|
void SoundVolume_OnChange(void)
|
||||||
|
{
|
||||||
|
if (!cv_gamesounds.value)
|
||||||
|
{
|
||||||
|
CV_SetValue(&cv_gamesounds, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue