diff options
| author | xXJSONDeruloXx <danielhimebauch@gmail.com> | 2025-09-26 20:59:29 -0400 |
|---|---|---|
| committer | xXJSONDeruloXx <danielhimebauch@gmail.com> | 2025-09-26 20:59:29 -0400 |
| commit | 1ff60fe98f2adeb4f19a5db5ae8b10ebc77a2749 (patch) | |
| tree | e6165de367e740b2b04bce35f30687ca51da4df5 | |
| parent | c22c11714150d53701016efe2daeb5cd02ae02a3 (diff) | |
| download | Decky-Framegen-1ff60fe98f2adeb4f19a5db5ae8b10ebc77a2749.tar.gz Decky-Framegen-1ff60fe98f2adeb4f19a5db5ae8b10ebc77a2749.zip | |
ui cleanup and hide on mode change to manual
| -rw-r--r-- | src/components/CustomPathOverride.tsx | 12 | ||||
| -rw-r--r-- | src/components/OptiScalerControls.tsx | 17 |
2 files changed, 22 insertions, 7 deletions
diff --git a/src/components/CustomPathOverride.tsx b/src/components/CustomPathOverride.tsx index 26e5c8f..efae9de 100644 --- a/src/components/CustomPathOverride.tsx +++ b/src/components/CustomPathOverride.tsx @@ -3,6 +3,7 @@ import { ButtonItem, Field, PanelSectionRow, ToggleField } from "@decky/ui"; import { FileSelectionType, openFilePicker } from "@decky/api"; import { getPathDefaults, runManualPatch, runManualUnpatch } from "../api"; import type { ApiResponse } from "../types/index"; +import { SmartClipboardButton } from "./SmartClipboardButton"; interface PathDefaults { home: string; @@ -34,6 +35,7 @@ const ensureDirectory = (value: string) => { interface ManualPatchControlsProps { isAvailable: boolean; + onManualModeChange?: (enabled: boolean) => void; } interface PickerState { @@ -54,7 +56,7 @@ const formatResultMessage = (result: ApiResponse | null) => { return result.message || result.output || "Operation failed."; }; -export const ManualPatchControls = ({ isAvailable }: ManualPatchControlsProps) => { +export const ManualPatchControls = ({ isAvailable, onManualModeChange }: ManualPatchControlsProps) => { const [isEnabled, setEnabled] = useState(false); const [defaults, setDefaults] = useState<PathDefaults>(INITIAL_DEFAULTS); const [pickerState, setPickerState] = useState<PickerState>(INITIAL_PICKER_STATE); @@ -96,8 +98,9 @@ export const ManualPatchControls = ({ isAvailable }: ManualPatchControlsProps) = setPickerState(INITIAL_PICKER_STATE); setOperationResult(null); setLastOperation(null); + onManualModeChange?.(false); } - }, [isAvailable]); + }, [isAvailable, onManualModeChange]); const canInteract = isAvailable && isEnabled; const selectedPath = pickerState.selectedPath; @@ -184,6 +187,7 @@ export const ManualPatchControls = ({ isAvailable }: ManualPatchControlsProps) = } setEnabled(value); + onManualModeChange?.(value); if (!value) { setPickerState(INITIAL_PICKER_STATE); setOperationResult(null); @@ -211,6 +215,10 @@ export const ManualPatchControls = ({ isAvailable }: ManualPatchControlsProps) = {canInteract && ( <> + <SmartClipboardButton + command='WINEDLLOVERRIDES="dxgi=n,b" SteamDeck=0 %command%' + buttonText="Manual launch cmd" + /> <PanelSectionRow> <ButtonItem layout="below" diff --git a/src/components/OptiScalerControls.tsx b/src/components/OptiScalerControls.tsx index 3a288e8..468683c 100644 --- a/src/components/OptiScalerControls.tsx +++ b/src/components/OptiScalerControls.tsx @@ -22,6 +22,7 @@ export function OptiScalerControls({ pathExists, setPathExists }: OptiScalerCont const [uninstalling, setUninstalling] = useState(false); const [installResult, setInstallResult] = useState<OperationResult | null>(null); const [uninstallResult, setUninstallResult] = useState<OperationResult | null>(null); + const [manualModeEnabled, setManualModeEnabled] = useState(false); useEffect(() => { if (installResult) { return createAutoCleanupTimer(() => setInstallResult(null), TIMEOUTS.resultDisplay); @@ -76,12 +77,18 @@ export function OptiScalerControls({ pathExists, setPathExists }: OptiScalerCont <OptiScalerHeader pathExists={pathExists} /> - <ManualPatchControls isAvailable={pathExists === true} /> + <ManualPatchControls + isAvailable={pathExists === true} + onManualModeChange={setManualModeEnabled} + /> - <ClipboardCommands pathExists={pathExists} /> - - <InstructionCard pathExists={pathExists} /> - + {!manualModeEnabled && ( + <> + <ClipboardCommands pathExists={pathExists} /> + + <InstructionCard pathExists={pathExists} /> + </> + )} <OptiScalerWiki pathExists={pathExists} /> <UninstallButton |
