[feat] solve common dir

todo: local cfg dir after resolving steam users
This commit is contained in:
Purp1e
2025-03-21 18:00:16 +08:00
parent 2e18fbdffd
commit e7a416dfec
10 changed files with 1170 additions and 754 deletions

View File

@@ -50,7 +50,7 @@ const CommonDir = () => {
<RoundedButton
onClick={async () => {
await invoke("open_path", {
path: path.join(steam.state.cs2Dir, "game", "csgo", "cfg"),
path: steam.cs2BaseDir(),
})
addToast({ title: "CS2游戏目录" })
}}
@@ -60,7 +60,7 @@ const CommonDir = () => {
<RoundedButton
onClick={async () => {
await invoke("open_path", {
path: path.join(steam.state.cs2Dir, "game", "csgo", "maps"),
path: path.resolve(steam.cs2BaseDir(), "game", "csgo", "maps"),
})
addToast({ title: "地图文件" })
}}
@@ -70,7 +70,7 @@ const CommonDir = () => {
<RoundedButton
onClick={async () => {
await invoke("open_path", {
path: path.join(steam.state.cs2Dir, "game", "csgo", "cfg"),
path: path.resolve(steam.cs2BaseDir(), "game", "csgo", "cfg"),
})
addToast({ title: "游戏CFG目录" })
}}
@@ -80,7 +80,8 @@ const CommonDir = () => {
<RoundedButton
onClick={async () => {
await invoke("open_path", {
path: path.join(steam.state.steamDir, "userdata"),
// TODO 导航到 steamid32/730/local/cfg
path: path.resolve(steam.state.steamDir, "userdata"),
})
addToast({ title: "个人CFG目录" })
}}
@@ -89,8 +90,7 @@ const CommonDir = () => {
</RoundedButton>
<RoundedButton
onClick={async () => {
const appDataDirPath = await configDir()
await invoke("open_path", { path: `${appDataDirPath}/Wmpvp/demo` })
await invoke("open_path", { path: `%appdata%/Wmpvp/demo` })
addToast({ title: "完美平台录像" })
}}
>
@@ -98,8 +98,7 @@ const CommonDir = () => {
</RoundedButton>
<RoundedButton
onClick={async () => {
const appDataDirPath = await configDir()
await invoke("open_path", { path: `${appDataDirPath}/5E对战平台/demo` })
await invoke("open_path", { path: `%appdata%/5E对战平台/demo` })
addToast({ title: "5E平台录像" })
}}
>

View File

@@ -66,7 +66,7 @@ const Avatar = () => {
const SideBar = () => {
const app = useAppStore()
getVersion().then((Value) => {
void getVersion().then((Value) => {
app.setVersion(Value)
})