Skip to content

Commit

Permalink
Various fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
OrigamingWasTaken committed Oct 16, 2024
1 parent ed9fee5 commit 0227a31
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
12 changes: 5 additions & 7 deletions frontend/src/windows/main/ts/roblox/launch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ export async function launchRoblox(
};

if (rbxInstance || (await shell('pgrep', ['-f', 'RobloxPlayer'], { skipStderrCheck: true })).stdOut.trim().length > 2) {
setLaunchText('Roblox is already open');
setLaunchingRoblox(false);
toast.error('Due to technical reasons, you must close all instances of Roblox before launching from AppleBlox.');
return;
setLaunchText('Roblox is already open');
setLaunchingRoblox(false);
toast.error('Due to technical reasons, you must close all instances of Roblox before launching from AppleBlox.');
return;
}
try {
console.info('[Launch] Launching Roblox');
Expand Down Expand Up @@ -172,9 +172,7 @@ export async function launchRoblox(
.then(async () => {
console.info(`[Launch] Removed mod files from "${path.join(robloxPath, 'Contents/Resources/')}"`);
// Use if block because checking if high resolution is enabled require file operations, so it's more optimized that way.
if (constSettings.fixResolution) {
await RobloxMods.toggleHighRes(true);
}
await RobloxMods.toggleHighRes(true);
await RobloxMods.removeCustomFont();
});
}
Expand Down
16 changes: 8 additions & 8 deletions frontend/src/windows/main/ts/roblox/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@ END`,
if (!savePath) {
return;
}
if (await shellFS.exists(path.join(savePath, 'Launch Roblox.app'))) {
await filesystem.remove(path.join(savePath, 'Launch Roblox.app'));
if (await shellFS.exists(path.join(savePath, 'Play Roblox.app'))) {
await filesystem.remove(path.join(savePath, 'Play Roblox.app'));
}
await filesystem.createDirectory(path.join(savePath, 'Launch Roblox.app/Contents/MacOS'));
await filesystem.createDirectory(path.join(savePath, 'Launch Roblox.app/Contents/Resources'));
await filesystem.createDirectory(path.join(savePath, 'Play Roblox.app/Contents/MacOS'));
await filesystem.createDirectory(path.join(savePath, 'Play Roblox.app/Contents/Resources'));
await filesystem.writeFile(
path.join(savePath, 'Launch Roblox.app/Contents/Info.plist'),
path.join(savePath, 'Play Roblox.app/Contents/Info.plist'),
`<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
Expand All @@ -120,14 +120,14 @@ END`,
const response = await fetch(AppIcon);
const blob = await response.blob();
await filesystem.writeBinaryFile(
path.join(savePath, 'Launch Roblox.app/Contents/Resources/icon.icns'),
path.join(savePath, 'Play Roblox.app/Contents/Resources/icon.icns'),
await blob.arrayBuffer()
);
await shellFS.writeFile(
path.join(savePath, 'Launch Roblox.app/Contents/MacOS/launch'),
path.join(savePath, 'Play Roblox.app/Contents/MacOS/launch'),
'#!/bin/bash\nopen appleblox://launch'
);
const shortcutPath = path.join(savePath, 'Launch Roblox.app');
const shortcutPath = path.join(savePath, 'Play Roblox.app');
await shellFS.chmod(path.join(shortcutPath, 'Contents/MacOS/launch'), '+x');
toast.success(`Created a shortcut at "${shortcutPath}"`);
await shellFS.open(shortcutPath, { reveal: true });
Expand Down

0 comments on commit 0227a31

Please sign in to comment.