mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Save view distance, volume, and audio device to settings when changed
Former-commit-id: ac7db47520c6524b3f2d7a788907daabb73ad237
This commit is contained in:
parent
c8928587dd
commit
f52954971d
@ -191,13 +191,22 @@ impl PlayState for SessionState {
|
||||
return PlayStateResult::Shutdown;
|
||||
}
|
||||
HudEvent::AdjustViewDistance(view_distance) => {
|
||||
self.client.borrow_mut().set_view_distance(view_distance)
|
||||
self.client.borrow_mut().set_view_distance(view_distance);
|
||||
|
||||
global_state.settings.graphics.view_distance = view_distance;
|
||||
global_state.settings.save_to_file();
|
||||
}
|
||||
HudEvent::AdjustVolume(volume) => {
|
||||
global_state.audio.set_volume(volume);
|
||||
|
||||
global_state.settings.audio.music_volume = volume;
|
||||
global_state.settings.save_to_file();
|
||||
}
|
||||
HudEvent::ChangeAudioDevice(name) => {
|
||||
global_state.audio.set_device(name);
|
||||
global_state.audio.set_device(name.clone());
|
||||
|
||||
global_state.settings.audio.audio_device = name;
|
||||
global_state.settings.save_to_file();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user