[feat/663] + changing to skipsteam

This commit is contained in:
LiamillionSS
2024-11-27 01:30:48 +11:00
15 changed files with 33 additions and 33 deletions
@@ -106,7 +106,7 @@ export class BSLauncherService {
desktop: params.desktopMode === "true",
debug: params.debug === "true",
additionalArgs: params.additionalArgs,
skipVR: params.skipVR === "true",
skipSteam: params.skipSteam === "true",
};
return res;
@@ -124,7 +124,7 @@ export class BSLauncherService {
if(launchOptions.desktop){ res.desktopMode = "true"; }
if(launchOptions.debug){ res.debug = "true"; }
if(launchOptions.additionalArgs){ res.additionalArgs = launchOptions.additionalArgs; }
if(launchOptions.skipVR){ res.skipVR = "true"; }
if(launchOptions.skipSteam){ res.skipSteam = "true"; }
return res;
}
@@ -241,7 +241,7 @@ type ShortcutParams = {
desktopMode?: string;
debug?: string;
additionalArgs?: string[];
skipVR?: string;
skipSteam?: string;
version: string;
versionName?: string;
versionIno?: string;
@@ -77,10 +77,10 @@ export class SteamLauncherService extends AbstractLauncherService implements Sto
throw CustomError.fromError(new Error(`Path not exist : ${exePath}`), BSLaunchError.BS_NOT_FOUND);
}
const skipVR: boolean = launchOptions.skipVR ?? false;
const skipSteam: boolean = launchOptions.skipSteam ?? false;
// Open Steam if not running
if(!skipVR && !(await this.steam.steamRunning())){
if(!skipSteam && !(await this.steam.steamRunning())){
obs.next({type: BSLaunchEvent.STEAM_LAUNCHING});
await this.steam.openSteam().then(() => {
@@ -90,7 +90,7 @@ export class SteamLauncherService extends AbstractLauncherService implements Sto
obs.next({type: BSLaunchWarning.UNABLE_TO_LAUNCH_STEAM});
});
}
else if (launchOptions.skipVR) {
else if (launchOptions.skipSteam) {
obs.next({ type: BSLaunchEvent.SKIPPING_STEAM_LAUNCH});
}
@@ -63,7 +63,7 @@ export function BsVersionItem(props: { version: BSVersion }) {
oculus: !!configService.get<boolean>(LaunchMods.OCULUS_MOD),
desktop: !!configService.get<boolean>(LaunchMods.DESKTOP_MOD),
debug: !!configService.get<boolean>(LaunchMods.DEBUG_MOD),
skipVR: !!configService.get<boolean>(LaunchMods.SKIPVR_MOD),
skipSteam: !!configService.get<boolean>(LaunchMods.SKIPSTEAM_MOD),
});
return lastValueFrom(launch$).catch(() => {});
};
@@ -35,7 +35,7 @@ export function LaunchSlide({ version }: Props) {
const [debugMode, setDebugMode] = useState(!!configService.get<boolean>(LaunchMods.DEBUG_MOD));
const [advancedLaunch, setAdvancedLaunch] = useState(false);
const [additionalArgsString, setAdditionalArgsString] = useState<string>(configService.get<string>("additionnal-args") || "");
const [skipVRMode, setSkipVRMode] = useState(!!configService.get<boolean>(LaunchMods.SKIPVR_MOD));
const [skipSteamMode, setSkipSteamMode] = useState(!!configService.get<boolean>(LaunchMods.SKIPSTEAM_MOD));
const versionDownloading = useObservable(() => bsDownloader.downloadingVersion$);
const versionRunning = useObservable(() => bsLauncherService.versionRunning$);
@@ -57,8 +57,8 @@ export function LaunchSlide({ version }: Props) {
setOculusMode(value);
} else if (mode === LaunchMods.DESKTOP_MOD) {
setDesktopMode(value);
} else if (mode === LaunchMods.SKIPVR_MOD) {
setSkipVRMode(value);
} else if (mode === LaunchMods.SKIPSTEAM_MOD) {
setSkipSteamMode(value);
}
configService.set(mode, value);
};
@@ -74,7 +74,7 @@ export function LaunchSlide({ version }: Props) {
desktop: desktopMode,
debug: debugMode,
additionalArgs: advancedLaunch ? additionalArgs : [],
skipVR: skipVRMode,
skipSteam: skipSteamMode,
});
return lastValueFrom(launch$).catch(() => {});
@@ -121,7 +121,7 @@ export function LaunchSlide({ version }: Props) {
<input className="w-[calc(100%-12px)] h-[calc(100%-12px)] bg-light-main-color-1 dark:bg-main-color-1 text-black dark:text-white rounded-full outline-none text-center" type="text" placeholder={t("pages.version-viewer.launch-mods.advanced-launch.placeholder")} value={additionalArgsString} onChange={handleAdditionalArgsChange} />
</div>
<div className="grid grid-cols-3 gap-3 transition-all duration-300 ease-in-out origin-top" style={{ scale: advancedLaunch ? "75% 75%" : "0% 0%" }}>
{advancedLaunch && !(version.oculus || version.metadata?.store === BsStore.OCULUS) && <LaunchModToogle infoText="pages.version-viewer.launch-mods.skipvr-description" icon="null" onClick={() => setMode(LaunchMods.SKIPVR_MOD, !skipVRMode)} active={skipVRMode} text="pages.version-viewer.launch-mods.skipvr" />}
{advancedLaunch && !(version.oculus || version.metadata?.store === BsStore.OCULUS) && <LaunchModToogle infoText="pages.version-viewer.launch-mods.skipsteam-description" icon="null" onClick={() => setMode(LaunchMods.SKIPSTEAM_MOD, !skipSteamMode)} active={skipSteamMode} text="pages.version-viewer.launch-mods.skipsteam" />}
</div>
</div>
<div className='grow flex justify-center items-center'>
+2 -2
View File
@@ -51,7 +51,7 @@ export class BSLauncherService {
desktop: this.config.get(LaunchMods.DESKTOP_MOD),
debug: this.config.get(LaunchMods.DEBUG_MOD),
additionalArgs: (this.config.get<string>("additionnal-args") || "").split(";").map(arg => arg.trim()).filter(arg => arg.length > 0),
skipVR: this.config.get(LaunchMods.SKIPVR_MOD),
skipSteam: this.config.get(LaunchMods.SKIPSTEAM_MOD),
}
}
@@ -129,5 +129,5 @@ export enum LaunchMods {
OCULUS_MOD = "LAUNCH_OCULUS_MOD",
DESKTOP_MOD = "LAUNCH_DESKTOP_MOD",
DEBUG_MOD = "LAUNCH_DEBUG_MOD",
SKIPVR_MOD = "LAUNCH_SKIPVR_MOD",
SKIPSTEAM_MOD = "LAUNCH_SKIPSTEAM_MOD",
}
@@ -7,5 +7,5 @@ export interface LaunchOption {
debug?: boolean,
additionalArgs?: string[],
admin?: boolean,
skipVR?: boolean
skipSteam?: boolean
}