Skip to content
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
3 changes: 3 additions & 0 deletions core/src/com/unciv/ui/audio/MusicController.kt
Original file line number Diff line number Diff line change
Expand Up @@ -691,5 +691,8 @@ class MusicController {
overlay = null
}

fun setOverlayVolume(volume: Float) {
overlay?.setVolume(volume)
}
//endregion
}
3 changes: 2 additions & 1 deletion core/src/com/unciv/ui/components/extensions/MusicControls.kt
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ interface MusicControls {
settings.citySoundsVolume = it
}

fun Table.addVoicesVolumeSlider(settings: GameSettings) =
fun Table.addVoicesVolumeSlider(settings: GameSettings, music: MusicController) =
addVolumeSlider("Leader voices volume", settings.voicesVolume) {
settings.voicesVolume = it
music.setOverlayVolume(it)
}

fun Table.addMusicVolumeSlider(settings: GameSettings, music: MusicController) =
Expand Down
2 changes: 1 addition & 1 deletion core/src/com/unciv/ui/popups/options/SoundTab.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ internal class SoundTab(
addCitySoundsVolumeSlider(settings)

if (music.isVoicesAvailable())
addVoicesVolumeSlider(settings)
addVoicesVolumeSlider(settings, music)

if (music.isMusicAvailable())
addMusicControls(settings, music)
Expand Down
Loading