Add: config for controlling debug overlay visibility of tauri
This commit is contained in:
@@ -158,12 +158,14 @@ pub enum FrontendBackend {
|
||||
#[serde(default)]
|
||||
pub struct FrontendConfig {
|
||||
pub backend: FrontendBackend,
|
||||
pub debug_overlay_visible: bool,
|
||||
}
|
||||
|
||||
impl Default for FrontendConfig {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
backend: FrontendBackend::Bevy,
|
||||
debug_overlay_visible: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -222,10 +224,12 @@ mod tests {
|
||||
let mut config = AppConfig::default();
|
||||
config.window.x = 42.0;
|
||||
config.frontend.backend = super::FrontendBackend::Tauri;
|
||||
config.frontend.debug_overlay_visible = true;
|
||||
|
||||
save(&path, &config).expect("save");
|
||||
let (_, loaded) = load_or_create_at(&path).expect("reload");
|
||||
assert!((loaded.window.x - 42.0).abs() < f32::EPSILON);
|
||||
assert_eq!(loaded.frontend.backend, super::FrontendBackend::Tauri);
|
||||
assert!(loaded.frontend.debug_overlay_visible);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user