Add: global factor controlling fps base interval

This commit is contained in:
DaZuo0122
2026-02-15 09:40:51 +08:00
parent e5417b6799
commit f20ed1fd9d
12 changed files with 289 additions and 52 deletions

View File

@@ -159,6 +159,7 @@ pub enum FrontendBackend {
pub struct FrontendConfig {
pub backend: FrontendBackend,
pub debug_overlay_visible: bool,
pub tauri_animation_slowdown_factor: u8,
}
impl Default for FrontendConfig {
@@ -166,6 +167,7 @@ impl Default for FrontendConfig {
Self {
backend: FrontendBackend::Bevy,
debug_overlay_visible: false,
tauri_animation_slowdown_factor: 3,
}
}
}
@@ -225,11 +227,13 @@ mod tests {
config.window.x = 42.0;
config.frontend.backend = super::FrontendBackend::Tauri;
config.frontend.debug_overlay_visible = true;
config.frontend.tauri_animation_slowdown_factor = 7;
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);
assert_eq!(loaded.frontend.tauri_animation_slowdown_factor, 7);
}
}