mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Merge branch 'desttinghim/no-audio-settings' into 'master'
Add field to disable audio into settings See merge request veloren/veloren!302
This commit is contained in:
commit
9977322ba6
@ -84,8 +84,14 @@ pub trait PlayState {
|
||||
fn main() {
|
||||
// Set up the global state.
|
||||
let settings = Settings::load();
|
||||
let audio = if settings.audio.audio_on {
|
||||
AudioFrontend::new()
|
||||
} else {
|
||||
AudioFrontend::no_audio()
|
||||
};
|
||||
|
||||
let mut global_state = GlobalState {
|
||||
audio: AudioFrontend::new(), // TODO: Provide `AudioFrontend::no_audio()` feature during initialisation, the config will be stored in `ron` object list.
|
||||
audio,
|
||||
window: Window::new(&settings).expect("Failed to create window!"),
|
||||
settings,
|
||||
};
|
||||
|
@ -144,6 +144,7 @@ pub struct AudioSettings {
|
||||
|
||||
/// Audio Device that Voxygen will use to play audio.
|
||||
pub audio_device: Option<String>,
|
||||
pub audio_on: bool,
|
||||
}
|
||||
|
||||
impl Default for AudioSettings {
|
||||
@ -153,6 +154,7 @@ impl Default for AudioSettings {
|
||||
music_volume: 0.5,
|
||||
sfx_volume: 0.5,
|
||||
audio_device: None,
|
||||
audio_on: true,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user