[fix] game launch panic + adjust select-none styles
This commit is contained in:
@@ -13,7 +13,7 @@ pub fn launch_game(
|
||||
server: &str,
|
||||
) -> 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(
|
||||
std::io::ErrorKind::NotFound,
|
||||
"Steam path not found",
|
||||
|
||||
@@ -9,7 +9,7 @@ const RoundedButton = ({ children }: RoundedButtonProps) => {
|
||||
return (
|
||||
<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}
|
||||
</button>
|
||||
|
||||
@@ -30,7 +30,7 @@ const FastLaunch = () => {
|
||||
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>
|
||||
@@ -43,7 +43,7 @@ const FastLaunch = () => {
|
||||
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>
|
||||
|
||||
@@ -15,14 +15,14 @@ const ForceQuit = () => {
|
||||
<button
|
||||
type="button"
|
||||
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
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
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
|
||||
</button>
|
||||
|
||||
@@ -22,21 +22,21 @@ const PowerPlan = () => {
|
||||
<button
|
||||
type="button"
|
||||
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
|
||||
type="button"
|
||||
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
|
||||
type="button"
|
||||
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>
|
||||
|
||||
@@ -16,7 +16,7 @@ const SmartTransfer = () => {
|
||||
</CardTool>
|
||||
</CardHeader>
|
||||
<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>智能中转 .dem .cfg</p>
|
||||
</div>
|
||||
|
||||
@@ -21,7 +21,7 @@ const Card = ({ children }: CardProps) => {
|
||||
|
||||
const CardHeader = ({ children }: CardProps) => {
|
||||
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