File tree Expand file tree Collapse file tree 6 files changed +12
-7
lines changed
r2mm/launching/instructions Expand file tree Collapse file tree 6 files changed +12
-7
lines changed Original file line number Diff line number Diff line change 1
1
import { computed } from "vue" ;
2
2
import path from "../../providers/node/path/path" ;
3
3
import PathResolver from "../../r2mm/manager/PathResolver" ;
4
+ import appWindow from '../../providers/node/app/app_window' ;
4
5
5
- export const ComputedWrapperLaunchArguments = computed ( ( ) => `"${ path . join ( PathResolver . MOD_ROOT , process . platform === 'darwin' ? 'macos_proxy' : 'linux_wrapper.sh' ) } " %command%` ) ;
6
+ export const ComputedWrapperLaunchArguments = computed ( ( ) => `"${ path . join ( PathResolver . MOD_ROOT , appWindow . getPlatform ( ) === 'darwin' ? 'macos_proxy' : 'linux_wrapper.sh' ) } " %command%` ) ;
Original file line number Diff line number Diff line change @@ -110,6 +110,7 @@ import {State} from '../store';
110
110
import {getDeterminedLaunchType } from " ../utils/LaunchUtils" ;
111
111
import {ComputedWrapperLaunchArguments } from " ../components/computed/WrapperArguments" ;
112
112
import {getLaunchType , LaunchType } from " ../model/real_enums/launch/LaunchType" ;
113
+ import appWindow from ' ../providers/node/app/app_window' ;
113
114
114
115
const store = getStore <State >();
115
116
@@ -122,7 +123,7 @@ const launchArgs = ref("");
122
123
watchEffect (async () => {
123
124
const loaderArgs = doorstopTarget .value ;
124
125
const prerequisiteText = ComputedWrapperLaunchArguments .value ;
125
- if (process . platform === ' win32' ) {
126
+ if (appWindow . getPlatform () === ' win32' ) {
126
127
launchArgs .value = loaderArgs ;
127
128
return ;
128
129
}
Original file line number Diff line number Diff line change @@ -24,12 +24,13 @@ import { State } from '../store';
24
24
import VueRouter , {useRouter } from ' vue-router' ;
25
25
import {ComputedWrapperLaunchArguments } from " ../components/computed/WrapperArguments" ;
26
26
import InteractionProviderImpl from " ../r2mm/system/InteractionProviderImpl" ;
27
+ import appWindow from ' ../providers/node/app/app_window' ;
27
28
28
29
const store = getStore <State >();
29
30
let router = useRouter ();
30
31
31
32
const activeGame = computed (() => store .state .activeGame .displayName );
32
- const platformName = computed <string >(() => process . platform === ' darwin' ? ' macOS' : process . platform );
33
+ const platformName = computed <string >(() => appWindow . getPlatform () === ' darwin' ? ' macOS' : appWindow . getPlatform () );
33
34
34
35
function copy(){
35
36
let range = document .createRange ();
Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ export default class GameInstructionParser {
82
82
83
83
private static async bepInExRendererPreloaderPath ( game : Game , profile : Profile ) : Promise < string | R2Error > {
84
84
try {
85
- if ( [ 'linux' ] . includes ( process . platform . toLowerCase ( ) ) ) {
85
+ if ( [ 'linux' ] . includes ( appWindow . getPlatform ( ) . toLowerCase ( ) ) ) {
86
86
const isProton = await isProtonRequired ( game ) ;
87
87
const corePath = await FsProvider . instance . realpath ( profile . joinToProfilePath ( 'BepInEx' , 'core' ) ) ;
88
88
const preloaderPath = path . join ( corePath ,
Original file line number Diff line number Diff line change @@ -6,12 +6,13 @@ import FsProvider from '../../../../../providers/generic/file/FsProvider';
6
6
import { DynamicGameInstruction } from '../../DynamicGameInstruction' ;
7
7
import { GameInstanceType } from '../../../../../model/schema/ThunderstoreSchema' ;
8
8
import path from 'path' ;
9
+ import appWindow from 'src/providers/node/app/app_window' ;
9
10
10
11
export default class BepisLoaderGameInstructions extends GameInstructionGenerator {
11
12
12
13
public async generate ( game : Game , profile : Profile ) : Promise < GameInstruction > {
13
14
let extraArguments = "" ;
14
- if ( [ "linux" , "darwin" ] . includes ( process . platform . toLowerCase ( ) ) ) {
15
+ if ( [ "linux" , "darwin" ] . includes ( appWindow . getPlatform ( ) . toLowerCase ( ) ) ) {
15
16
extraArguments += ` --r2profile "${ DynamicGameInstruction . PROFILE_NAME } "` ;
16
17
if ( game . instanceType === GameInstanceType . SERVER ) {
17
18
extraArguments += ` --server` ;
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import LinuxGameDirectoryResolver from '../r2mm/manager/linux/GameDirectoryResol
11
11
import { LaunchType } from "../model/real_enums/launch/LaunchType" ;
12
12
import path from "../providers/node/path/path" ;
13
13
import PathResolver from "../r2mm/manager/PathResolver" ;
14
+ import appWindow from '../providers/node/app/app_window' ;
14
15
15
16
export enum LaunchMode { VANILLA , MODDED } ;
16
17
@@ -71,7 +72,7 @@ export const throwIfNoGameDir = async (game: Game): Promise<void> => {
71
72
} ;
72
73
73
74
export async function isProtonRequired ( activeGame : Game ) {
74
- if ( process . platform !== 'linux' ) {
75
+ if ( appWindow . getPlatform ( ) !== 'linux' ) {
75
76
return false ;
76
77
}
77
78
return [ Platform . STEAM , Platform . STEAM_DIRECT ] . includes ( activeGame . activePlatform . storePlatform )
@@ -97,5 +98,5 @@ export async function areWrapperArgumentsProvided(game: Game): Promise<boolean>
97
98
}
98
99
99
100
export async function getWrapperLaunchArgs ( ) : Promise < string > {
100
- return `"${ path . join ( PathResolver . MOD_ROOT , process . platform === 'darwin' ? 'macos_proxy' : 'linux_wrapper.sh' ) } " %command%` ;
101
+ return `"${ path . join ( PathResolver . MOD_ROOT , appWindow . getPlatform ( ) === 'darwin' ? 'macos_proxy' : 'linux_wrapper.sh' ) } " %command%` ;
101
102
}
You can’t perform that action at this time.
0 commit comments