[feat] follow launch command string even if its hidden

This commit is contained in:
silentrald
2025-01-28 20:58:24 +08:00
parent 1c2321b438
commit b94fe0a053
3 changed files with 5 additions and 11 deletions
@@ -31,13 +31,7 @@ export const CreateLaunchShortcutModal: ModalComponent<{ steamShortcut: boolean,
}, [data]);
const completeModal = () => {
if(advanced) {
launchOption.command = command.trim();
} else {
launchOption.command = "";
}
launchOption.command = command.trim();
resolver({exitCode: ModalExitCode.COMPLETED, data: { launchOption, steamShortcut }});
}
@@ -38,7 +38,7 @@ export function LaunchSlide({ version }: Props) {
const versions = useService(BSVersionManagerService);
const [advancedLaunch, setAdvancedLaunch] = useState(false);
const [command, setCommand] = useState<string>(configService.get<string>("additionnal-args") || "");
const [command, setCommand] = useState<string>(configService.get<string>("launch-command") || "");
const versionDownloading = useObservable(() => bsDownloader.downloadingVersion$);
const [activeLaunchMods, setActiveLaunchMods] = useState<LaunchMod[]>(configService.get("launch-mods") ?? []);
const [pinnedLaunchMods, setPinnedLaunchMods] = useState<LaunchMod[]>(configService.get("pinned-launch-mods" as DefaultConfigKey) ?? []);
@@ -46,7 +46,7 @@ export function LaunchSlide({ version }: Props) {
const versionRunning = useObservable(() => bsLauncherService.versionRunning$);
useEffect(() => {
configService.set("additionnal-args", command);
configService.set("launch-command", command);
}, [command]);
useEffect(() => {
@@ -149,7 +149,7 @@ export function LaunchSlide({ version }: Props) {
const launch$ = bsLauncherService.launch({
version,
launchMods: activeLaunchMods,
command: advancedLaunch ? command : "",
command,
});
return lastValueFrom(launch$).catch(() => {});
+1 -1
View File
@@ -40,7 +40,7 @@ export class BSLauncherService {
return {
version,
launchMods: this.config.get("launch-mods") ?? [],
command: this.config.get<string>("additionnal-args") || "",
command: this.config.get<string>("launch-command") || "",
}
}