[fix] function call

This commit is contained in:
Purp1e
2025-03-13 00:25:09 +08:00
parent c4100120a4
commit d7234ddae9
10 changed files with 758 additions and 376 deletions

View File

@@ -1,8 +1,17 @@
import { TakeOff } from "@icon-park/react"
import { invoke } from "@tauri-apps/api/core"
import { Card, CardBody, CardHeader, CardIcon } from "../window/Card"
import { steamStore } from "@/store/steam"
import { toolStore } from "@/store/tool"
import { useSnapshot } from "valtio"
// import { addToast } from "@heroui/react"
const FastLaunch = () => {
void toolStore.start()
void steamStore.start()
const { launchOptions, launchIndex } = useSnapshot(toolStore.state)
const { dir } = useSnapshot(steamStore.state)
return (
<Card>
<CardHeader>
@@ -16,12 +25,12 @@ const FastLaunch = () => {
type="button"
onClick={() =>
invoke("launch_game", {
// steamPath: steam.dir + "/steam.exe",
// launchOption: launchOptions.value[launchIndex.value] || "",
steamPath: dir + "/steam.exe",
launchOption: launchOptions[launchIndex] || "",
server: "perfectworld",
})
}
className="px-5 font-medium py-1.5 transition bg-red-200 rounded-full"
className="px-5 font-medium py-1.5 transition bg-red-200 dark:bg-red-900/60 rounded-full"
>
</button>
@@ -29,12 +38,12 @@ const FastLaunch = () => {
type="button"
onClick={() =>
invoke("launch_game", {
// steamPath: steam.dir + "/steam.exe",
// launchOption: launchOptions.value[launchIndex.value] || "",
steamPath: dir + "/steam.exe",
launchOption: launchOptions[launchIndex] || "",
server: "worldwide",
})
}
className="px-5 font-medium py-1.5 transition bg-orange-200 rounded-full"
className="px-5 font-medium py-1.5 transition bg-orange-200 dark:bg-orange-900/60 rounded-full"
>
</button>

View File

@@ -15,14 +15,14 @@ const ForceQuit = () => {
<button
type="button"
onClick={() => invoke("kill_steam")}
className="px-5 font-medium py-1.5 transition bg-blue-200 rounded-full"
className="px-5 font-medium py-1.5 transition bg-blue-200 dark:bg-blue-900/60 rounded-full"
>
Steam
</button>
<button
type="button"
onClick={() => invoke("kill_game")}
className="px-5 font-medium py-1.5 transition bg-orange-200 rounded-full"
className="px-5 font-medium py-1.5 transition bg-orange-200 dark:bg-orange-900/60 rounded-full"
>
CS2
</button>