dev-prepare #2

Merged
purp1e merged 42 commits from dev-prepare into master 2025-03-24 02:16:40 +08:00
2 changed files with 29 additions and 19 deletions
Showing only changes of commit 42a3efb217 - Show all commits

View File

@@ -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>

View File

@@ -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>