optim fpstest ui and try to fix steam path related crash

This commit is contained in:
2025-11-06 23:11:41 +08:00
parent 9f29857fd3
commit f7c9e455f7
9 changed files with 354 additions and 183 deletions

View File

@@ -156,6 +156,22 @@ pub fn check_path(path: &str) -> Result<bool, String> {
Ok(std::path::Path::new(&path).exists())
}
#[tauri::command]
pub fn check_steam_dir_valid(steam_dir: &str) -> Result<bool, String> {
use std::path::Path;
let path = Path::new(steam_dir);
if !path.exists() {
return Ok(false);
}
// 检查是否存在 steam.exe 或 config 目录(至少有一个即可)
let steam_exe = path.join("steam.exe");
let config_dir = path.join("config");
Ok(steam_exe.exists() || config_dir.exists())
}
///// 录像
#[tauri::command]
pub async fn analyze_replay(app: tauri::AppHandle, path: &str) -> Result<String, String> {