diff --git a/frontend/src/windows/main/ts/roblox/launch.ts b/frontend/src/windows/main/ts/roblox/launch.ts index 1367c9a..d5355cd 100644 --- a/frontend/src/windows/main/ts/roblox/launch.ts +++ b/frontend/src/windows/main/ts/roblox/launch.ts @@ -32,12 +32,15 @@ export async function launchRoblox( fixResolution: (await getValue('mods.general.fix_res')) === true, }; - if (rbxInstance || (await shell('pgrep', ['-f', 'RobloxPlayer'], { skipStderrCheck: true })).stdOut.trim().length > 2) { + if (rbxInstance) { setLaunchText('Roblox is already open'); setLaunchingRoblox(false); - toast.error('Due to technical reasons, you must close all instances of Roblox before launching from AppleBlox.'); + toast.error('You are already running an instance from AppleBlox.'); return; } + if ((await shell('pgrep', ['-f', 'RobloxPlayer'], { skipStderrCheck: true })).stdOut.trim().length > 3) { + await shell('pkill', ['-9', '-f', 'RobloxPlayer'], { skipStderrCheck: true }); + } try { console.info('[Launch] Launching Roblox'); setLaunchingRoblox(true); @@ -70,7 +73,7 @@ export async function launchRoblox( ) { const isIgnored = await showFlagErrorPopup( 'Outdated presets', - "You are using presets which contain outdated flags. They may or may not work. To fix this, update to the latest version of the app or wait for a new one.", + 'You are using presets which contain outdated flags. They may or may not work. To fix this, update to the latest version of the app or wait for a new one.', presetFlags.nameMap.join(', ') ); if (!isIgnored) { @@ -87,7 +90,7 @@ export async function launchRoblox( ) { const isIgnored = await showFlagErrorPopup( 'Invalid flags in selected profile', - "You have one or several invalid flags in your selected profile:", + 'You have one or several invalid flags in your selected profile:', beautify(editorFlags.invalidFlags, null, 2, 100) ); if (!isIgnored) { @@ -104,7 +107,7 @@ export async function launchRoblox( ) { const isIgnored = await showFlagErrorPopup( 'Invalid flags in game profile(s)', - "You have one or several invalid flags in the following profiles:", + 'You have one or several invalid flags in the following profiles:', editorFlags.invalidProfileFlags .map((profile) => `${profile.name.toUpperCase()}:\n ${beautify(profile.flags, null, 2, 100)}`) .join('

')