optim fpstest ui and try to fix steam path related crash
This commit is contained in:
@@ -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> {
|
||||
|
||||
Reference in New Issue
Block a user