[feat] add notice to launch and quit button + using Button
This commit is contained in:
@@ -3,7 +3,8 @@ import { useToolStore } from "@/store/tool"
|
||||
import { TakeOff } from "@icon-park/react"
|
||||
import { invoke } from "@tauri-apps/api/core"
|
||||
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 steam = useSteamStore()
|
||||
@@ -18,32 +19,34 @@ const FastLaunch = () => {
|
||||
</CardHeader>
|
||||
<CardBody>
|
||||
<div className="flex gap-2">
|
||||
<button
|
||||
type="button"
|
||||
onClick={() =>
|
||||
<Button
|
||||
size="sm"
|
||||
onPress={async () => {
|
||||
invoke("launch_game", {
|
||||
steamPath: `${steam.state.steamDir}/steam.exe`,
|
||||
launchOption: tool.state.launchOptions[tool.state.launchIndex] || "",
|
||||
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"
|
||||
>
|
||||
启动国服
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() =>
|
||||
</Button>
|
||||
<Button
|
||||
size="sm"
|
||||
onPress={async () => {
|
||||
invoke("launch_game", {
|
||||
steamPath: `${steam.state.steamDir}/steam.exe`,
|
||||
launchOption: tool.state.launchOptions[tool.state.launchIndex] || "",
|
||||
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"
|
||||
>
|
||||
启动国际服
|
||||
</button>
|
||||
</Button>
|
||||
</div>
|
||||
</CardBody>
|
||||
</Card>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { Power } from "@icon-park/react"
|
||||
import { invoke } from "@tauri-apps/api/core"
|
||||
import { Card, CardBody, CardHeader, CardIcon } from "../window/Card"
|
||||
import { addToast, Button } from "@heroui/react"
|
||||
|
||||
const ForceQuit = () => {
|
||||
return (
|
||||
@@ -12,20 +13,26 @@ const ForceQuit = () => {
|
||||
</CardHeader>
|
||||
<CardBody>
|
||||
<div className="flex gap-2">
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => invoke("kill_steam")}
|
||||
<Button
|
||||
size="sm"
|
||||
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"
|
||||
>
|
||||
关闭Steam
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => invoke("kill_game")}
|
||||
</Button>
|
||||
<Button
|
||||
size="sm"
|
||||
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"
|
||||
>
|
||||
关闭CS2
|
||||
</button>
|
||||
</Button>
|
||||
</div>
|
||||
</CardBody>
|
||||
</Card>
|
||||
|
||||
Reference in New Issue
Block a user