mirror of
https://github.com/Zagrios/bs-manager.git
synced 2026-07-03 14:08:25 +02:00
[feat] defaultly open to the last version launched on startup
This commit is contained in:
@@ -21,6 +21,7 @@ import { OculusLauncherService } from "./oculus-launcher.service";
|
||||
import { BSVersion } from "shared/bs-version.interface";
|
||||
import { BsStore } from "../../../shared/models/bs-store.enum";
|
||||
import { LaunchMod, LaunchMods } from "shared/models/bs-launch/launch-option.interface";
|
||||
import { StaticConfigurationService } from "../static-configuration.service";
|
||||
|
||||
export class BSLauncherService {
|
||||
private static instance: BSLauncherService;
|
||||
@@ -32,6 +33,7 @@ export class BSLauncherService {
|
||||
private readonly remoteVersion: BSVersionLibService;
|
||||
private readonly steamLauncher: SteamLauncherService;
|
||||
private readonly oculusLauncher: OculusLauncherService;
|
||||
private readonly staticConfig: StaticConfigurationService;
|
||||
|
||||
public static getInstance(): BSLauncherService {
|
||||
if (!BSLauncherService.instance) {
|
||||
@@ -48,6 +50,7 @@ export class BSLauncherService {
|
||||
this.remoteVersion = BSVersionLibService.getInstance();
|
||||
this.steamLauncher = SteamLauncherService.getInstance();
|
||||
this.oculusLauncher = OculusLauncherService.getInstance();
|
||||
this.staticConfig = StaticConfigurationService.getInstance();
|
||||
|
||||
this.bsmProtocolService.on("launch", link => {
|
||||
log.info("Launch from bsm protocol", link.toString());
|
||||
@@ -73,6 +76,8 @@ export class BSLauncherService {
|
||||
return throwError(() => new Error("Unable to get launcher for the provided version"));
|
||||
}
|
||||
|
||||
this.staticConfig.set("last-version-launched", launchOptions.version);
|
||||
|
||||
return launcher.launch(launchOptions);
|
||||
}
|
||||
|
||||
|
||||
@@ -89,6 +89,7 @@ export interface StaticConfigKeyValues {
|
||||
"disable-hadware-acceleration": boolean;
|
||||
"use-symlinks": boolean;
|
||||
"use-system-proxy": boolean;
|
||||
"last-version-launched": BSVersion;
|
||||
|
||||
// Linux Specific static configs
|
||||
"proton-folder": string;
|
||||
|
||||
Reference in New Issue
Block a user