From f811c79934c123450f562f2b548f979047714909 Mon Sep 17 00:00:00 2001 From: KayJann Date: Thu, 9 Apr 2026 23:28:43 +0200 Subject: [PATCH] feat: stop game button --- src/components/views/HomeView.tsx | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/src/components/views/HomeView.tsx b/src/components/views/HomeView.tsx index 498e26a..96f263d 100644 --- a/src/components/views/HomeView.tsx +++ b/src/components/views/HomeView.tsx @@ -18,6 +18,8 @@ const HomeView = memo(function HomeView() { installs, toggleInstall, downloadingId, + isGameRunning, + stopGame, } = useGame(); const isFocusedSection = focusSection === "menu"; @@ -33,19 +35,23 @@ const HomeView = memo(function HomeView() { { label: !hasAnyInstall ? "Install a version" - : isDownloading - ? "Installation in progress..." - : isInstalled - ? "Play Game" - : `Download ${selectedVersionName}`, + : isGameRunning + ? "Stop Game" + : isDownloading + ? "Installation in progress..." + : isInstalled + ? "Play Game" + : `Download ${selectedVersionName}`, action: !hasAnyInstall ? () => setActiveView("versions") - : isDownloading - ? () => {} - : isInstalled - ? handleLaunch - : () => toggleInstall(profile), - isDanger: false, + : isGameRunning + ? stopGame + : isDownloading + ? () => {} + : isInstalled + ? handleLaunch + : () => toggleInstall(profile), + isDanger: isGameRunning, disabled: isDownloading, }, { label: "Help & Options", action: () => setActiveView("settings"), disabled: false }, @@ -62,6 +68,8 @@ const HomeView = memo(function HomeView() { toggleInstall, profile, setActiveView, + isGameRunning, + stopGame, ], );