Add: config for controlling debug overlay visibility of tauri

This commit is contained in:
DaZuo0122
2026-02-13 22:31:22 +08:00
parent 875bc54c4f
commit e5e123cc84
9 changed files with 148 additions and 26 deletions

View File

@@ -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);
}
}