2024-09-21 02:25:23 +08:00
|
|
|
|
"use client"
|
|
|
|
|
|
|
2025-03-17 11:48:30 +08:00
|
|
|
|
import { useSteamStore } from "@/store/steam"
|
2025-03-13 22:25:06 +08:00
|
|
|
|
import { useEffect, useState } from "react"
|
2024-09-21 01:05:40 +08:00
|
|
|
|
export default function Page() {
|
2025-03-17 11:48:30 +08:00
|
|
|
|
const steam = useSteamStore()
|
2025-03-21 02:42:49 +08:00
|
|
|
|
const [steamDir, setSteamDir] = useState(steam.state.steamDir)
|
|
|
|
|
|
const [cs2Dir, setCs2Dir] = useState(steam.state.cs2Dir)
|
2025-03-13 22:25:06 +08:00
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
2025-03-21 02:42:49 +08:00
|
|
|
|
setSteamDir(steam.state.steamDir)
|
|
|
|
|
|
setCs2Dir(steam.state.cs2Dir)
|
|
|
|
|
|
}, [steam.state.steamDir, steam.state.cs2Dir])
|
2025-03-13 22:25:06 +08:00
|
|
|
|
|
2024-09-21 01:05:40 +08:00
|
|
|
|
return (
|
|
|
|
|
|
<div
|
2024-09-27 11:20:48 +08:00
|
|
|
|
className="flex flex-col items-center justify-center w-full h-screen gap-6"
|
2024-09-21 01:05:40 +08:00
|
|
|
|
data-tauri-drag-region
|
|
|
|
|
|
>
|
2025-03-13 22:25:06 +08:00
|
|
|
|
<h1 className="text-4xl font-bold tracking-wide">CS工具箱</h1>
|
2024-09-21 01:05:40 +08:00
|
|
|
|
<p>准备环节</p>
|
2024-09-21 02:25:23 +08:00
|
|
|
|
|
2025-03-13 22:25:06 +08:00
|
|
|
|
<div className="flex flex-col w-full gap-2 p-5 border rounded-lg bg-white/40">
|
|
|
|
|
|
<p>Steam所在文件夹</p>
|
2024-09-21 02:25:23 +08:00
|
|
|
|
<input
|
2025-03-13 22:25:06 +08:00
|
|
|
|
className="px-2 py-1 mb-2 rounded-lg"
|
|
|
|
|
|
value={steamDir}
|
|
|
|
|
|
onChange={(e) => {
|
|
|
|
|
|
setSteamDir(e.target.value)
|
2025-03-17 11:48:30 +08:00
|
|
|
|
steam.setDir(e.target.value)
|
2025-03-13 22:25:06 +08:00
|
|
|
|
}}
|
2024-09-21 02:25:23 +08:00
|
|
|
|
/>
|
2025-03-13 22:25:06 +08:00
|
|
|
|
<p>CS2所在文件夹</p>
|
2024-09-21 02:25:23 +08:00
|
|
|
|
<input
|
2025-03-13 22:25:06 +08:00
|
|
|
|
className="px-2 py-1 mb-2 rounded-lg"
|
|
|
|
|
|
value={cs2Dir}
|
|
|
|
|
|
onChange={(e) => {
|
|
|
|
|
|
setCs2Dir(e.target.value)
|
2025-03-17 11:48:30 +08:00
|
|
|
|
steam.setCsDir(e.target.value)
|
2025-03-13 22:25:06 +08:00
|
|
|
|
}}
|
2024-09-21 02:25:23 +08:00
|
|
|
|
/>
|
2025-03-17 11:48:30 +08:00
|
|
|
|
<p>当前用户64位SteamID:{steam.currentUser().steamID64}</p>
|
2024-09-21 02:25:23 +08:00
|
|
|
|
</div>
|
2024-09-21 01:05:40 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
)
|
|
|
|
|
|
}
|