outfly/src/settings.rs

36 lines
779 B
Rust
Raw Normal View History

2024-03-16 21:20:23 +00:00
use bevy::prelude::*;
2024-03-17 17:26:44 +00:00
#[derive(Resource)]
2024-03-16 21:20:23 +00:00
pub struct Settings {
pub mute_sfx: bool,
pub mute_music: bool,
pub volume_sfx: u8,
pub volume_music: u8,
2024-03-17 19:31:16 +00:00
pub font_size_hud: f32,
pub font_size_conversations: f32,
2024-03-17 18:03:02 +00:00
pub key_togglehud: KeyCode,
pub hud_active: bool,
2024-03-16 21:20:23 +00:00
}
impl Default for Settings {
fn default() -> Self {
Settings {
2024-03-18 02:45:46 +00:00
mute_sfx: true,
mute_music: true,
2024-03-16 21:20:23 +00:00
volume_sfx: 100,
volume_music: 100,
2024-03-17 19:31:16 +00:00
font_size_hud: 32.0,
font_size_conversations: 32.0,
2024-03-17 18:03:02 +00:00
key_togglehud: KeyCode::Tab,
2024-03-18 01:15:44 +00:00
hud_active: false,
2024-03-16 21:20:23 +00:00
}
}
}
impl Settings {
pub fn reset(&mut self) {
println!("Resetting settings!");
*self = Self::default();
}
}