[fix] game launch panic + adjust select-none styles

This commit is contained in:
Purp1e
2025-03-13 02:55:56 +08:00
parent bfcf519894
commit 103e700a17
7 changed files with 11 additions and 11 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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