feat: implement persistant configuration
This commit is contained in:
parent
30b194619f
commit
8a02249845
5 changed files with 82 additions and 0 deletions
|
|
@ -5,6 +5,7 @@ import (
|
|||
"tetris/engine/audio"
|
||||
"tetris/engine/core"
|
||||
"tetris/engine/render"
|
||||
"tetris/game"
|
||||
"tetris/game/state"
|
||||
"tetris/game/ui"
|
||||
"tetris/game/ui/layouts"
|
||||
|
|
@ -24,6 +25,10 @@ func soundVolumeChanged(widget *widgets.Slider) {
|
|||
|
||||
audio.SetVolume(value)
|
||||
audio.Play(assets.SFX_MENU_SOUND_VOLUME_SELECT)
|
||||
|
||||
// Store in config and save
|
||||
game.Config.SoundVolume = byte(widget.Value)
|
||||
game.Config.Save()
|
||||
}
|
||||
|
||||
func NewOptionsMenu() *OptionsMenu {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue