mirror of
https://github.com/LCE-Hub/LCE-Emerald-Launcher.git
synced 2026-09-23 08:32:51 +00:00
feat: stop game button
This commit is contained in:
@@ -18,6 +18,8 @@ const HomeView = memo(function HomeView() {
|
|||||||
installs,
|
installs,
|
||||||
toggleInstall,
|
toggleInstall,
|
||||||
downloadingId,
|
downloadingId,
|
||||||
|
isGameRunning,
|
||||||
|
stopGame,
|
||||||
} = useGame();
|
} = useGame();
|
||||||
|
|
||||||
const isFocusedSection = focusSection === "menu";
|
const isFocusedSection = focusSection === "menu";
|
||||||
@@ -33,19 +35,23 @@ const HomeView = memo(function HomeView() {
|
|||||||
{
|
{
|
||||||
label: !hasAnyInstall
|
label: !hasAnyInstall
|
||||||
? "Install a version"
|
? "Install a version"
|
||||||
: isDownloading
|
: isGameRunning
|
||||||
? "Installation in progress..."
|
? "Stop Game"
|
||||||
: isInstalled
|
: isDownloading
|
||||||
? "Play Game"
|
? "Installation in progress..."
|
||||||
: `Download ${selectedVersionName}`,
|
: isInstalled
|
||||||
|
? "Play Game"
|
||||||
|
: `Download ${selectedVersionName}`,
|
||||||
action: !hasAnyInstall
|
action: !hasAnyInstall
|
||||||
? () => setActiveView("versions")
|
? () => setActiveView("versions")
|
||||||
: isDownloading
|
: isGameRunning
|
||||||
? () => {}
|
? stopGame
|
||||||
: isInstalled
|
: isDownloading
|
||||||
? handleLaunch
|
? () => {}
|
||||||
: () => toggleInstall(profile),
|
: isInstalled
|
||||||
isDanger: false,
|
? handleLaunch
|
||||||
|
: () => toggleInstall(profile),
|
||||||
|
isDanger: isGameRunning,
|
||||||
disabled: isDownloading,
|
disabled: isDownloading,
|
||||||
},
|
},
|
||||||
{ label: "Help & Options", action: () => setActiveView("settings"), disabled: false },
|
{ label: "Help & Options", action: () => setActiveView("settings"), disabled: false },
|
||||||
@@ -62,6 +68,8 @@ const HomeView = memo(function HomeView() {
|
|||||||
toggleInstall,
|
toggleInstall,
|
||||||
profile,
|
profile,
|
||||||
setActiveView,
|
setActiveView,
|
||||||
|
isGameRunning,
|
||||||
|
stopGame,
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user