summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxXJSONDeruloXx <danielhimebauch@gmail.com>2026-09-10 10:33:08 -0400
committerxXJSONDeruloXx <danielhimebauch@gmail.com>2026-09-10 10:33:08 -0400
commit209ab92cc3baeb15ce808fc53ce9041a761d8df4 (patch)
treeec87f5598cc3bf471e9b66e8704678035f170469
parente6efa4f0ff32d520982860180a29472068aab8e2 (diff)
downloaddecky-lsfg-vk-209ab92cc3baeb15ce808fc53ce9041a761d8df4.tar.gz
decky-lsfg-vk-209ab92cc3baeb15ce808fc53ce9041a761d8df4.zip
only warn quit on real steam games
-rw-r--r--src/components/ConfigurationTab.tsx30
-rw-r--r--src/types.d.ts1
2 files changed, 28 insertions, 3 deletions
diff --git a/src/components/ConfigurationTab.tsx b/src/components/ConfigurationTab.tsx
index 8150819..5ae4a87 100644
--- a/src/components/ConfigurationTab.tsx
+++ b/src/components/ConfigurationTab.tsx
@@ -1,4 +1,4 @@
-import { ButtonItem, DialogButton, Focusable, PanelSection, PanelSectionRow, gamepadDialogClasses } from "@decky/ui";
+import { ButtonItem, ConfirmModal, DialogButton, Focusable, PanelSection, PanelSectionRow, gamepadDialogClasses, showModal } from "@decky/ui";
import { useCallback, useEffect, useRef, useState } from "react";
import { FaArrowLeft } from "react-icons/fa";
import { ConfigurationData } from "../config/configSchema";
@@ -91,13 +91,37 @@ export function ConfigurationTab({
const profileDescription = selectedTarget
? `${profileTransport} · App ID ${selectedTarget.appid} · ${selectedTarget.configured ? "LSFG-VK Enabled" : "LSFG-VK not enabled"}`
: "Game is no longer available";
+ const enableProfile = async (appid: string, quitRunningGame = false) => {
+ if (!(await onEnable(appid))) return;
+ if (quitRunningGame) SteamClient.Apps.TerminateApp(appid, false);
+ setFocusFpsMultiplier(true);
+ };
const handleProfileAction = async () => {
if (selectedTarget?.configured) {
await onReset();
setFocusConfiguredToggle(true);
closeDetails();
- } else if (detailAppId && await onEnable(detailAppId)) {
- setFocusFpsMultiplier(true);
+ } else if (detailAppId) {
+ const isRunningUnconfigured = runningGame?.appid === detailAppId
+ && runningGame.nonSteam === false
+ && runningGame.transport.kind === "host"
+ && selectedTarget?.nonSteam === false
+ && selectedTarget?.transport.kind === "host"
+ && !runningGame.configured;
+ if (isRunningUnconfigured) {
+ showModal(
+ <ConfirmModal
+ strTitle="Game is running"
+ strDescription="Quit the game now so LSFG-VK is used on its next launch?"
+ strOKButtonText="Quit and enable"
+ strCancelButtonText="Enable without quitting"
+ onOK={() => void enableProfile(detailAppId, true)}
+ onCancel={() => void enableProfile(detailAppId)}
+ />,
+ );
+ } else {
+ await enableProfile(detailAppId);
+ }
}
};
diff --git a/src/types.d.ts b/src/types.d.ts
index df433e0..e5db40d 100644
--- a/src/types.d.ts
+++ b/src/types.d.ts
@@ -32,6 +32,7 @@ interface SteamApps {
SetAppLaunchOptions(appId: number, options: string): void | Promise<void>;
SetShortcutLaunchOptions(appId: number, options: string): void | Promise<void>;
SetShortcutExe(appId: number, executable: string): void | Promise<void>;
+ TerminateApp(appId: string, param1: boolean): void;
GetAllShortcuts?(): Promise<unknown[]>;
}