update: force quit working

This commit is contained in:
purp1e
2024-09-21 01:42:16 +08:00
parent d00c90b0f6
commit 6625e0c57d
3 changed files with 29 additions and 8 deletions

View File

@@ -1,5 +1,6 @@
import { TakeOff } from "@icon-park/react";
import { Card, CardHeader, CardIcon, CardBody } from "../window/Card";
import { invoke } from "@tauri-apps/api/core"
const FastLaunch = () => {
return (
@@ -11,16 +12,34 @@ const FastLaunch = () => {
</CardHeader>
<CardBody>
<div className="flex gap-2">
<button className="px-5 font-medium py-1.5 transition bg-red-200 rounded-full">
<button
onClick={() =>
invoke("launch_game", {
// steamPath: steam.dir + "/steam.exe",
// launchOption: launchOptions.value[launchIndex.value] || "",
server: "perfectworld",
})
}
className="px-5 font-medium py-1.5 transition bg-red-200 rounded-full"
>
</button>
<button className="px-5 font-medium py-1.5 transition bg-orange-200 rounded-full">
<button
onClick={() =>
invoke("launch_game", {
// steamPath: steam.dir + "/steam.exe",
// launchOption: launchOptions.value[launchIndex.value] || "",
server: "worldwide",
})
}
className="px-5 font-medium py-1.5 transition bg-orange-200 rounded-full"
>
</button>
</div>
</CardBody>
</Card>
);
)
};
export default FastLaunch;

View File

@@ -1,5 +1,6 @@
import { Power } from "@icon-park/react";
import { Card, CardHeader, CardIcon, CardBody } from "../window/Card";
import { invoke } from "@tauri-apps/api/core";
const ForceQuit = () => {
return (
@@ -11,8 +12,8 @@ const ForceQuit = () => {
</CardHeader>
<CardBody>
<div className="flex gap-2">
<button className="px-5 font-medium py-1.5 transition bg-blue-200 rounded-full">Steam</button>
<button className="px-5 font-medium py-1.5 transition bg-orange-200 rounded-full">CS2</button>
<button onClick={() => invoke("kill_steam")} className="px-5 font-medium py-1.5 transition bg-blue-200 rounded-full">Steam</button>
<button onClick={() => invoke("kill_game")} className="px-5 font-medium py-1.5 transition bg-orange-200 rounded-full">CS2</button>
</div>
</CardBody>
</Card>

View File

@@ -1,6 +1,7 @@
import { BatteryCharge, Refresh } from "@icon-park/react";
import { Card, CardHeader, CardIcon, CardTool, CardBody } from "../window/Card";
import { ToolButton } from "../window/ToolButton";
import { invoke } from "@tauri-apps/api/core";
const PowerPlan = () => {
return (
@@ -18,9 +19,9 @@ const PowerPlan = () => {
</CardHeader>
<CardBody>
<div className="flex p-0.5 bg-black/5 gap-2 rounded-full">
<button className="flex-1 px-2 py-1 transition rounded-full bg-black/5"></button>
<button className="flex-1 px-2 py-1 transition rounded-full"></button>
<button className="flex-1 px-2 py-1 transition rounded-full"></button>
<button onClick={() => invoke("set_power_plan", {index: 1})} className="flex-1 px-2 py-1 transition rounded-full bg-black/5"></button>
<button onClick={() => invoke("set_power_plan", {index: 2})} className="flex-1 px-2 py-1 transition rounded-full"></button>
<button onClick={() => invoke("set_power_plan", {index: 3})} className="flex-1 px-2 py-1 transition rounded-full"></button>
</div>
</CardBody>
</Card>