[fix] game launch panic + adjust select-none styles
This commit is contained in:
@@ -13,7 +13,7 @@ pub fn launch_game(
|
|||||||
server: &str,
|
server: &str,
|
||||||
) -> Result<(), Box<dyn Error>> {
|
) -> Result<(), Box<dyn Error>> {
|
||||||
// 判断路径是否存在
|
// 判断路径是否存在
|
||||||
if !std::path::Path::new("/etc/hosts").exists() {
|
if !std::path::Path::new(steam_path).exists() {
|
||||||
return Err(Box::new(std::io::Error::new(
|
return Err(Box::new(std::io::Error::new(
|
||||||
std::io::ErrorKind::NotFound,
|
std::io::ErrorKind::NotFound,
|
||||||
"Steam path not found",
|
"Steam path not found",
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ const RoundedButton = ({ children }: RoundedButtonProps) => {
|
|||||||
return (
|
return (
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="flex items-center justify-center px-3 py-1 transition rounded-full min-w-fit active:scale-95 hover:bg-black/10 text-zinc-700 dark:text-zinc-100 bg-black/5"
|
className="flex items-center justify-center px-3 py-1 transition rounded-full select-none min-w-fit active:scale-95 hover:bg-black/10 text-zinc-700 dark:text-zinc-100 bg-black/5"
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ const FastLaunch = () => {
|
|||||||
server: "perfectworld",
|
server: "perfectworld",
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
className="px-5 font-medium py-1.5 transition bg-red-200 dark:bg-red-900/60 rounded-full"
|
className="px-5 font-medium py-1.5 transition bg-red-200 dark:bg-red-900/60 rounded-full select-none"
|
||||||
>
|
>
|
||||||
启动国服
|
启动国服
|
||||||
</button>
|
</button>
|
||||||
@@ -43,7 +43,7 @@ const FastLaunch = () => {
|
|||||||
server: "worldwide",
|
server: "worldwide",
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
className="px-5 font-medium py-1.5 transition bg-orange-200 dark:bg-orange-900/60 rounded-full"
|
className="px-5 font-medium py-1.5 transition bg-orange-200 dark:bg-orange-900/60 rounded-full select-none"
|
||||||
>
|
>
|
||||||
启动国际服
|
启动国际服
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -15,14 +15,14 @@ const ForceQuit = () => {
|
|||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => invoke("kill_steam")}
|
onClick={() => invoke("kill_steam")}
|
||||||
className="px-5 font-medium py-1.5 transition bg-blue-200 dark:bg-blue-900/60 rounded-full"
|
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"
|
type="button"
|
||||||
onClick={() => invoke("kill_game")}
|
onClick={() => invoke("kill_game")}
|
||||||
className="px-5 font-medium py-1.5 transition bg-orange-200 dark:bg-orange-900/60 rounded-full"
|
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>
|
||||||
|
|||||||
@@ -22,21 +22,21 @@ const PowerPlan = () => {
|
|||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => invoke("set_power_plan", { index: 1 })}
|
onClick={() => invoke("set_power_plan", { index: 1 })}
|
||||||
className="flex-1 px-2 py-1 transition rounded-full bg-black/5"
|
className="flex-1 px-2 py-1 transition rounded-full select-none bg-black/5"
|
||||||
>
|
>
|
||||||
高性能
|
高性能
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => invoke("set_power_plan", { index: 2 })}
|
onClick={() => invoke("set_power_plan", { index: 2 })}
|
||||||
className="flex-1 px-2 py-1 transition rounded-full"
|
className="flex-1 px-2 py-1 transition rounded-full select-none"
|
||||||
>
|
>
|
||||||
平衡
|
平衡
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => invoke("set_power_plan", { index: 3 })}
|
onClick={() => invoke("set_power_plan", { index: 3 })}
|
||||||
className="flex-1 px-2 py-1 transition rounded-full"
|
className="flex-1 px-2 py-1 transition rounded-full select-none"
|
||||||
>
|
>
|
||||||
节能
|
节能
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ const SmartTransfer = () => {
|
|||||||
</CardTool>
|
</CardTool>
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
<CardBody>
|
<CardBody>
|
||||||
<div className="flex flex-col items-center justify-center w-full h-full p-5 text-lg font-medium transition rounded-lg cursor-pointer bg-black/5 hover:bg-black/10">
|
<div className="flex flex-col items-center justify-center w-full h-full p-5 text-lg font-medium transition rounded-lg cursor-pointer select-none bg-black/5 hover:bg-black/10">
|
||||||
<p>点击或拖拽</p>
|
<p>点击或拖拽</p>
|
||||||
<p>智能中转 .dem .cfg</p>
|
<p>智能中转 .dem .cfg</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ const Card = ({ children }: CardProps) => {
|
|||||||
|
|
||||||
const CardHeader = ({ children }: CardProps) => {
|
const CardHeader = ({ children }: CardProps) => {
|
||||||
return (
|
return (
|
||||||
<div className="flex items-center gap-1.5 tracking-wide">{children}</div>
|
<div className="flex items-center gap-1.5 tracking-wide select-none">{children}</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user