mirror of
https://github.com/open-goal/launcher.git
synced 2024-10-20 04:57:38 -04:00
added ipc code to main electron js file
This commit is contained in:
parent
0421c32c0c
commit
13386f2e59
1554
package-lock.json
generated
1554
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -44,7 +44,9 @@
|
|||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"async": "^3.2.3",
|
||||
"bootstrap": "^5.1.3",
|
||||
"download-git-repo": "^3.0.2",
|
||||
"electron-squirrel-startup": "^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
18
src/index.js
18
src/index.js
|
@ -1,6 +1,7 @@
|
|||
const { app, BrowserWindow } = require('electron');
|
||||
const { app, BrowserWindow, ipcMain } = require('electron');
|
||||
const path = require('path');
|
||||
const isDev = !app.isPackaged;
|
||||
const { launchGame, buildGame, isoSeries, fetchLatestCommit } = require('./js/utils/utils.js');
|
||||
|
||||
// Handle creating/removing shortcuts on Windows when installing/uninstalling.
|
||||
if (require('electron-squirrel-startup')) {
|
||||
|
@ -57,3 +58,18 @@ app.on('activate', () => {
|
|||
|
||||
// In this file you can include the rest of your app's specific main process
|
||||
// code. You can also put them in separate files and import them here.
|
||||
|
||||
// IPC STUFF HERE
|
||||
ipcMain.on('getISO', isoSeries);
|
||||
|
||||
ipcMain.handle('checkUpdates', async () => {
|
||||
let response = await fetchLatestCommit();
|
||||
return response;
|
||||
});
|
||||
|
||||
ipcMain.on('build', buildGame);
|
||||
ipcMain.on('launch', launchGame);
|
||||
|
||||
app.on('status', (status) => {
|
||||
win.webContents.send('status', status);
|
||||
});
|
Loading…
Reference in a new issue