Skip to content

Commit d844438

Browse files
Remove cycling deps check
1 parent 94496fb commit d844438

File tree

8 files changed

+48
-46
lines changed

8 files changed

+48
-46
lines changed

.vscode/settings.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"css.lint.unknownAtRules": "ignore",
3-
"editor.formatOnSave": true,
4-
"editor.codeActionsOnSave": {
5-
"source.organizeImports": "always"
6-
}
2+
"css.lint.unknownAtRules": "ignore"
3+
// "editor.formatOnSave": true,
4+
// "editor.codeActionsOnSave": {
5+
// "source.organizeImports": "always"
6+
// }
77
}

bun.lockb

-984 Bytes
Binary file not shown.

frontend/src/windows/main/ts/roblox/fflags.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { filesystem } from '@neutralinojs/lib';
22
import path from 'path-browserify';
33
import { toast } from 'svelte-sonner';
4-
import Roblox from '.';
54
import { getAllProfiles, getSelectedProfile, type Profile } from '../../components/flag-editor';
65
import { getConfigPath, getValue, loadSettings } from '../../components/settings';
76
import type { SelectElement, SettingsOutput } from '../../components/settings/types';
87
import { Notification } from '../tools/notifications';
98
import shellFS from '../tools/shellfs';
109
import { curlGet } from '../utils';
10+
import { robloxPath } from './path';
1111

1212
const FLAGS_WHITELIST = ['FFlagUserIsBloxstrap', 'FFlagUserAllowsWindowMovement'];
1313

@@ -467,7 +467,7 @@ export class RobloxFFlags {
467467
};
468468
}
469469
static async writeClientAppSettings() {
470-
const filePath = path.join(Roblox.path, 'Contents/MacOS/ClientSettings/ClientAppSettings.json');
470+
const filePath = path.join(robloxPath, 'Contents/MacOS/ClientSettings/ClientAppSettings.json');
471471
if (await shellFS.exists(filePath)) {
472472
await filesystem.remove(filePath);
473473
}

frontend/src/windows/main/ts/roblox/instance.ts

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
import { filesystem, os } from '@neutralinojs/lib';
22
import path from 'path-browserify';
3-
import Roblox from '.';
43
import { getValue } from '../../components/settings';
54
import { libraryPath } from '../libraries';
65
import { Notification } from '../tools/notifications';
76
import { shell, spawn, type SpawnEventEmitter } from '../tools/shell';
87
import { isProcessAlive, sleep } from '../utils';
8+
import { RobloxDelegate } from './delegate';
9+
import { robloxPath } from './path';
10+
import { RobloxUtils } from './utils';
911

1012
// Export value to be able to set it from other code
1113
let restartWatcher = false;
12-
export const setRestartWatcherVar = (value: boolean) => (restartWatcher = value);
1314

1415
type EventHandler = (data?: any) => void;
1516
type Event = 'exit' | 'gameInfo' | 'gameEvent';
@@ -134,7 +135,7 @@ export class RobloxInstance {
134135

135136
/** Initalize class values */
136137
public async init() {
137-
if (!(await Roblox.Utils.hasRoblox())) return;
138+
if (!(await RobloxUtils.hasRoblox())) return;
138139
}
139140

140141
/** Starts the Roblox Instance */
@@ -152,16 +153,16 @@ export class RobloxInstance {
152153

153154
// Launch Roblox
154155
if (url) {
155-
await Roblox.Delegate.toggle(false);
156+
await RobloxDelegate.toggle(false);
156157
await shell('open', [url]);
157158
} else {
158-
await shell('open', [Roblox.path]);
159+
await shell('open', [robloxPath]);
159160
}
160161

161162
await sleep(1000); // Give time for Roblox to open
162163
// "If block" because settings can be edited and maybe it will not be boolean
163164
if ((await getValue<boolean>('roblox.launching.delegate')) === true) {
164-
await Roblox.Delegate.toggle(true);
165+
await RobloxDelegate.toggle(true);
165166
}
166167

167168
// We find every roblox processes and get the RobloxPlayer one

frontend/src/windows/main/ts/roblox/launch.ts

+26-25
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import beautify from 'json-beautify';
22
import path from 'path-browserify';
33
import { toast } from 'svelte-sonner';
4-
import Roblox from '.';
54
import { getValue } from '../../components/settings';
65
import { Notification } from '../tools/notifications';
76
import { RPCController } from '../tools/rpc';
@@ -11,6 +10,10 @@ import { sleep } from '../utils';
1110
import { focusWindow, setWindowVisibility } from '../window';
1211
import onGameEvent from './events';
1312
import { RobloxInstance } from './instance';
13+
import { RobloxFFlags } from './fflags';
14+
import { robloxPath } from './path';
15+
import { RobloxUtils } from './utils';
16+
import { RobloxMods } from './mods';
1417

1518
let rbxInstance: RobloxInstance | null = null;
1619

@@ -44,28 +47,28 @@ export async function launchRoblox(
4447
try {
4548
console.info('[Launch] Launching Roblox');
4649
setLaunchingRoblox(true);
47-
if (!(await Roblox.Utils.hasRoblox())) {
50+
if (!(await RobloxUtils.hasRoblox())) {
4851
console.info('[Launch] Roblox is not installed. Exiting launch process.');
4952
setLaunchingRoblox(false);
5053
return;
5154
}
5255

5356
// Fast Flags
5457
setLaunchProgress(20);
55-
if (await shellFS.exists(path.join(Roblox.path, 'Contents/MacOS/ClientSettings/ClientAppSettings.json'))) {
58+
if (await shellFS.exists(path.join(robloxPath, 'Contents/MacOS/ClientSettings/ClientAppSettings.json'))) {
5659
console.info(
57-
`[Launch] Removing current ClientAppSettings.json file in "${path.join(Roblox.path, 'Contents/MacOS/ClientSettings/ClientAppSettings.json"')}`
60+
`[Launch] Removing current ClientAppSettings.json file in "${path.join(robloxPath, 'Contents/MacOS/ClientSettings/ClientAppSettings.json"')}`
5861
);
59-
await shellFS.remove(path.join(Roblox.path, 'Contents/MacOS/ClientSettings/'));
62+
await shellFS.remove(path.join(robloxPath, 'Contents/MacOS/ClientSettings/'));
6063
setLaunchText('Removing current ClientAppSettings...');
6164
}
6265

6366
setLaunchProgress(30);
6467
setLaunchText('Copying fast flags...');
6568
console.info('[Launch] Copying fast flags...');
66-
await shellFS.createDirectory(path.join(Roblox.path, 'Contents/MacOS/ClientSettings'));
69+
await shellFS.createDirectory(path.join(robloxPath, 'Contents/MacOS/ClientSettings'));
6770
console.info('[Launch] Parsing saved FFlags...');
68-
const presetFlags = await Roblox.FFlags.parseFlags(true);
71+
const presetFlags = await RobloxFFlags.parseFlags(true);
6972
// Invalid presets
7073
if (
7174
Object.keys(presetFlags.invalidFlags).length > 0 &&
@@ -82,7 +85,7 @@ export async function launchRoblox(
8285
return;
8386
}
8487
}
85-
const editorFlags = await Roblox.FFlags.parseFlags(false);
88+
const editorFlags = await RobloxFFlags.parseFlags(false);
8689
// Invalid selected profile flags
8790
if (
8891
Object.keys(editorFlags.invalidFlags).length > 0 &&
@@ -126,29 +129,29 @@ export async function launchRoblox(
126129
};
127130
console.info('[Launch] FastFlags: ', fflags);
128131
await shellFS.writeFile(
129-
path.join(Roblox.path, 'Contents/MacOS/ClientSettings/ClientAppSettings.json'),
132+
path.join(robloxPath, 'Contents/MacOS/ClientSettings/ClientAppSettings.json'),
130133
JSON.stringify(fflags)
131134
);
132135
console.info(
133-
`[Launch] Wrote FFlags to "${path.join(Roblox.path, 'Contents/MacOS/ClientSettings/ClientAppSettings.json')}"`
136+
`[Launch] Wrote FFlags to "${path.join(robloxPath, 'Contents/MacOS/ClientSettings/ClientAppSettings.json')}"`
134137
);
135138

136139
// Mods
137140
if (constSettings.areModsEnabled) {
138141
setLaunchProgress(40);
139142
setLaunchText('Copying Mods...');
140143

141-
await Roblox.Mods.copyToFiles();
144+
await RobloxMods.copyToFiles();
142145
}
143-
await Roblox.Mods.applyCustomFont();
146+
await RobloxMods.applyCustomFont();
144147

145148
setLaunchProgress(60);
146149
setTimeout(async () => {
147150
try {
151+
await RobloxMods.toggleHighRes(!constSettings.fixResolution);
148152
if (constSettings.areModsEnabled && constSettings.fixResolution) {
149153
setLaunchText('Disabling Retina resolution...');
150154
setLaunchProgress(80);
151-
await Roblox.Mods.toggleHighRes(false);
152155
}
153156
const robloxInstance = new RobloxInstance(true);
154157
await robloxInstance.init();
@@ -170,17 +173,15 @@ export async function launchRoblox(
170173
subtitle: 'Quitting the app may corrupt Roblox',
171174
timeout: 5,
172175
}).show();
173-
Roblox.Mods.restoreRobloxFolders()
176+
RobloxMods.restoreRobloxFolders()
174177
.catch(console.error)
175178
.then(async () => {
176-
console.info(
177-
`[Launch] Removed mod files from "${path.join(Roblox.path, 'Contents/Resources/')}"`
178-
);
179+
console.info(`[Launch] Removed mod files from "${path.join(robloxPath, 'Contents/Resources/')}"`);
179180
// Use if block because checking if high resolution is enabled require file operations, so it's more optimized that way.
180181
if (constSettings.fixResolution) {
181-
await Roblox.Mods.toggleHighRes(true);
182+
await RobloxMods.toggleHighRes(true);
182183
}
183-
await Roblox.Mods.removeCustomFont();
184+
await RobloxMods.removeCustomFont();
184185
});
185186
}
186187
RPCController.stop();
@@ -191,17 +192,17 @@ export async function launchRoblox(
191192
});
192193
} catch (err) {
193194
if (constSettings.areModsEnabled) {
194-
await Roblox.Mods.restoreRobloxFolders()
195+
await RobloxMods.restoreRobloxFolders()
195196
.catch(console.error)
196197
.then(() => {
197-
console.info(`[Launch] Removed mod files from "${path.join(Roblox.path, 'Contents/Resources/')}"`);
198+
console.info(`[Launch] Removed mod files from "${path.join(robloxPath, 'Contents/Resources/')}"`);
198199
});
199200
}
200201
console.error(err);
201202
setLaunchingRoblox(false);
202203
toast.error('An error occured while starting Roblox.');
203-
await shellFS.remove(path.join(Roblox.path, 'Contents/MacOS/ClientSettings/'));
204-
console.info(`[Launch] Deleted "${path.join(Roblox.path, 'Contents/MacOS/ClientSettings/')}"`);
204+
await shellFS.remove(path.join(robloxPath, 'Contents/MacOS/ClientSettings/'));
205+
console.info(`[Launch] Deleted "${path.join(robloxPath, 'Contents/MacOS/ClientSettings/')}"`);
205206
return;
206207
}
207208

@@ -210,8 +211,8 @@ export async function launchRoblox(
210211
setWindowVisibility(false);
211212
setTimeout(() => {
212213
setLaunchingRoblox(false);
213-
shellFS.remove(path.join(Roblox.path, 'Contents/MacOS/ClientSettings/'));
214-
console.info(`[Launch] Deleted "${path.join(Roblox.path, 'Contents/MacOS/ClientSettings')}"`);
214+
shellFS.remove(path.join(robloxPath, 'Contents/MacOS/ClientSettings/'));
215+
console.info(`[Launch] Deleted "${path.join(robloxPath, 'Contents/MacOS/ClientSettings')}"`);
215216
}, 1000);
216217
}, 1000);
217218
} catch (err) {

frontend/src/windows/main/ts/roblox/utils.ts

+3-5
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,14 @@ import { sleep } from '@/windows/main/ts/utils';
33
import { filesystem, os } from '@neutralinojs/lib';
44
import path from 'path-browserify';
55
import { toast } from 'svelte-sonner';
6-
import Roblox from '.';
76
import { shell } from '../tools/shell';
87
import shellFS from '../tools/shellfs';
9-
import { setRestartWatcherVar } from './instance';
8+
import { robloxPath } from './path';
109

1110
export class RobloxUtils {
1211
/** Checks if roblox is installed, and if not show a popup */
1312
static async hasRoblox(popup = true): Promise<boolean> {
14-
if (await shellFS.exists(path.join(Roblox.path, 'Contents/MacOS/RobloxPlayer'))) {
13+
if (await shellFS.exists(path.join(robloxPath, 'Contents/MacOS/RobloxPlayer'))) {
1514
return true;
1615
}
1716
if (!popup) return false;
@@ -51,7 +50,7 @@ END`,
5150

5251
toast.info('Opening Roblox...', { duration: 1000 });
5352
console.info('[Roblox.Utils] Opening Roblox...');
54-
await shellFS.open(Roblox.path);
53+
await shellFS.open(robloxPath);
5554

5655
await sleep(1000);
5756

@@ -133,7 +132,6 @@ END`,
133132
}
134133

135134
static async killAll() {
136-
setRestartWatcherVar(false);
137135
await shell(`ps aux | grep -i roblox | grep -v grep | awk '{print $2}' | xargs kill -9`, [], {
138136
completeCommand: true,
139137
skipStderrCheck: true,

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
"typescript": "^5.3.3",
4545
"vite": "4.4.9",
4646
"vite-plugin-checker": "^0.7.2",
47-
"vite-plugin-circular-dependency": "^0.5.0",
4847
"vite-plugin-html": "^3.2.2"
4948
},
5049
"dependencies": {

vite.config.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@ import { svelte } from '@sveltejs/vite-plugin-svelte';
22
import * as path from 'node:path';
33
import { defineConfig } from 'vite';
44
import checker from 'vite-plugin-checker';
5-
import circleDependency from 'vite-plugin-circular-dependency';
65
import neutralino from './scripts/package/vite-plugin';
76

87
// https://vitejs.dev/config/
98
export default defineConfig({
109
root: 'frontend',
11-
plugins: [svelte(), checker({ typescript: true }), neutralino(), circleDependency()],
10+
plugins: [
11+
svelte(),
12+
checker({ typescript: true }),
13+
neutralino(),
14+
],
1215
build: {
1316
outDir: path.resolve('./frontend/dist'),
1417
rollupOptions: {

0 commit comments

Comments
 (0)