blob: 58ccd02eed1c07e33dfd789d5333a6be32a9a904 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
import { ConfigurationData } from "../config/configSchema";
import type { GameTarget } from "../hooks/useGameConfiguration";
import { ConfigurationSection } from "./ConfigurationSection";
import { FpsMultiplierControl } from "./FpsMultiplierControl";
import { WorkaroundsSection } from "./WorkaroundsSection";
interface Props {
config: ConfigurationData;
onConfigChange: (fieldName: keyof ConfigurationData, value: boolean | number | string | string[]) => Promise<void>;
autoFocusFpsMultiplier?: boolean;
onFpsMultiplierFocused?: () => void;
showWorkarounds?: boolean;
workaroundTarget?: Pick<GameTarget, "appid" | "nonSteam">;
}
export function GameConfigurationControls({
config,
onConfigChange,
autoFocusFpsMultiplier,
onFpsMultiplierFocused,
showWorkarounds = false,
workaroundTarget,
}: Props) {
return (
<>
<FpsMultiplierControl
config={config}
onConfigChange={onConfigChange}
autoFocus={autoFocusFpsMultiplier}
onAutoFocus={onFpsMultiplierFocused}
/>
<ConfigurationSection config={config} onConfigChange={onConfigChange} />
{showWorkarounds && workaroundTarget && (
<WorkaroundsSection appId={workaroundTarget.appid} nonSteam={workaroundTarget.nonSteam} />
)}
</>
);
}
|