dev-prepare #2
@@ -3,7 +3,8 @@ import { useToolStore } from "@/store/tool"
|
|||||||
import { TakeOff } from "@icon-park/react"
|
import { TakeOff } from "@icon-park/react"
|
||||||
import { invoke } from "@tauri-apps/api/core"
|
import { invoke } from "@tauri-apps/api/core"
|
||||||
import { Card, CardBody, CardHeader, CardIcon } from "../window/Card"
|
import { Card, CardBody, CardHeader, CardIcon } from "../window/Card"
|
||||||
// import { addToast } from "@heroui/react"
|
import { addToast, Button } from "@heroui/react"
|
||||||
|
import { title } from "process"
|
||||||
|
|
||||||
const FastLaunch = () => {
|
const FastLaunch = () => {
|
||||||
const steam = useSteamStore()
|
const steam = useSteamStore()
|
||||||
@@ -18,32 +19,34 @@ const FastLaunch = () => {
|
|||||||
</CardHeader>
|
</CardHeader>
|
||||||
<CardBody>
|
<CardBody>
|
||||||
<div className="flex gap-2">
|
<div className="flex gap-2">
|
||||||
<button
|
<Button
|
||||||
type="button"
|
size="sm"
|
||||||
onClick={() =>
|
onPress={async () => {
|
||||||
invoke("launch_game", {
|
invoke("launch_game", {
|
||||||
steamPath: `${steam.state.steamDir}/steam.exe`,
|
steamPath: `${steam.state.steamDir}/steam.exe`,
|
||||||
launchOption: tool.state.launchOptions[tool.state.launchIndex] || "",
|
launchOption: tool.state.launchOptions[tool.state.launchIndex] || "",
|
||||||
server: "perfectworld",
|
server: "perfectworld",
|
||||||
})
|
})
|
||||||
}
|
addToast({ title: "启动国服成功" })
|
||||||
|
}}
|
||||||
className="px-5 font-medium py-1.5 transition bg-red-200 dark:bg-red-900/60 rounded-full select-none"
|
className="px-5 font-medium py-1.5 transition bg-red-200 dark:bg-red-900/60 rounded-full select-none"
|
||||||
>
|
>
|
||||||
启动国服
|
启动国服
|
||||||
</button>
|
</Button>
|
||||||
<button
|
<Button
|
||||||
type="button"
|
size="sm"
|
||||||
onClick={() =>
|
onPress={async () => {
|
||||||
invoke("launch_game", {
|
invoke("launch_game", {
|
||||||
steamPath: `${steam.state.steamDir}/steam.exe`,
|
steamPath: `${steam.state.steamDir}/steam.exe`,
|
||||||
launchOption: tool.state.launchOptions[tool.state.launchIndex] || "",
|
launchOption: tool.state.launchOptions[tool.state.launchIndex] || "",
|
||||||
server: "worldwide",
|
server: "worldwide",
|
||||||
})
|
})
|
||||||
}
|
addToast({ title: "启动国际服成功" })
|
||||||
|
}}
|
||||||
className="px-5 font-medium py-1.5 transition bg-orange-200 dark:bg-orange-900/60 rounded-full select-none"
|
className="px-5 font-medium py-1.5 transition bg-orange-200 dark:bg-orange-900/60 rounded-full select-none"
|
||||||
>
|
>
|
||||||
启动国际服
|
启动国际服
|
||||||
</button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</CardBody>
|
</CardBody>
|
||||||
</Card>
|
</Card>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { Power } from "@icon-park/react"
|
import { Power } from "@icon-park/react"
|
||||||
import { invoke } from "@tauri-apps/api/core"
|
import { invoke } from "@tauri-apps/api/core"
|
||||||
import { Card, CardBody, CardHeader, CardIcon } from "../window/Card"
|
import { Card, CardBody, CardHeader, CardIcon } from "../window/Card"
|
||||||
|
import { addToast, Button } from "@heroui/react"
|
||||||
|
|
||||||
const ForceQuit = () => {
|
const ForceQuit = () => {
|
||||||
return (
|
return (
|
||||||
@@ -12,20 +13,26 @@ const ForceQuit = () => {
|
|||||||
</CardHeader>
|
</CardHeader>
|
||||||
<CardBody>
|
<CardBody>
|
||||||
<div className="flex gap-2">
|
<div className="flex gap-2">
|
||||||
<button
|
<Button
|
||||||
type="button"
|
size="sm"
|
||||||
onClick={() => invoke("kill_steam")}
|
onPress={async () => {
|
||||||
|
await invoke("kill_steam")
|
||||||
|
addToast({ title: "已关闭Steam" })
|
||||||
|
}}
|
||||||
className="px-5 font-medium py-1.5 transition bg-blue-200 dark:bg-blue-900/60 rounded-full select-none"
|
className="px-5 font-medium py-1.5 transition bg-blue-200 dark:bg-blue-900/60 rounded-full select-none"
|
||||||
>
|
>
|
||||||
关闭Steam
|
关闭Steam
|
||||||
</button>
|
</Button>
|
||||||
<button
|
<Button
|
||||||
type="button"
|
size="sm"
|
||||||
onClick={() => invoke("kill_game")}
|
onPress={async () => {
|
||||||
|
await invoke("kill_game")
|
||||||
|
addToast({ title: "已关闭CS2" })
|
||||||
|
}}
|
||||||
className="px-5 font-medium py-1.5 transition bg-orange-200 dark:bg-orange-900/60 rounded-full select-none"
|
className="px-5 font-medium py-1.5 transition bg-orange-200 dark:bg-orange-900/60 rounded-full select-none"
|
||||||
>
|
>
|
||||||
关闭CS2
|
关闭CS2
|
||||||
</button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</CardBody>
|
</CardBody>
|
||||||
</Card>
|
</Card>
|
||||||
|
|||||||
Reference in New Issue
Block a user