mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-19 06:43:51 +02:00
Electron hot reload
This commit is contained in:
@@ -56,6 +56,7 @@ const noInstall = args.includes('--no-install');
|
||||
const x11 = args.includes('--x11');
|
||||
const noDesktop = args.includes('--no-desktop');
|
||||
const startup = args.includes('--startup');
|
||||
const debug = args.includes('--hot-reload');
|
||||
const noUpdater =
|
||||
args.includes('--no-updater') ||
|
||||
fs.existsSync(path.join(rootDir, '.no-updater'));
|
||||
@@ -327,6 +328,10 @@ function createWindow() {
|
||||
applyWindowState();
|
||||
const indexPath = path.join(rootDir, 'build/html/index.html');
|
||||
mainWindow.loadFile(indexPath);
|
||||
if (debug) {
|
||||
mainWindow.loadURL('http://localhost:9000/index.html');
|
||||
mainWindow.webContents.openDevTools();
|
||||
}
|
||||
|
||||
// add proxy config, doesn't work, thanks electron
|
||||
// const proxy = VRCXStorage.Get('VRCX_Proxy');
|
||||
@@ -436,7 +441,10 @@ function createWristOverlayWindowOffscreen() {
|
||||
});
|
||||
wristOverlayWindow.webContents.setFrameRate(2);
|
||||
|
||||
const indexPath = path.join(rootDir, 'build/html/vr.html');
|
||||
let indexPath = path.join(rootDir, 'build/html/vr.html');
|
||||
if (debug) {
|
||||
indexPath = 'http://localhost:9000/vr.html';
|
||||
}
|
||||
const fileUrl = `file://${indexPath}?wrist`;
|
||||
wristOverlayWindow.loadURL(fileUrl, { userAgent: version });
|
||||
|
||||
@@ -499,7 +507,10 @@ function createHmdOverlayWindowOffscreen() {
|
||||
});
|
||||
hmdOverlayWindow.webContents.setFrameRate(48);
|
||||
|
||||
const indexPath = path.join(rootDir, 'build/html/vr.html');
|
||||
let indexPath = path.join(rootDir, 'build/html/vr.html');
|
||||
if (debug) {
|
||||
indexPath = 'http://localhost:9000/vr.html';
|
||||
}
|
||||
const fileUrl = `file://${indexPath}?hmd`;
|
||||
hmdOverlayWindow.loadURL(fileUrl, { userAgent: version });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user