mirror of
https://github.com/Gabi-Zar/Silk-Fly-Launcher.git
synced 2026-04-17 05:26:04 +02:00
the latest mods from nexus is now on the online mods page
This commit is contained in:
36
main.js
36
main.js
@@ -27,8 +27,10 @@ const bepinexFiles = [
|
||||
let bepinexVersion
|
||||
let bepinexBackupVersion
|
||||
|
||||
let mainWindow
|
||||
|
||||
const createWindow = () => {
|
||||
const win = new BrowserWindow({
|
||||
mainWindow = new BrowserWindow({
|
||||
width: 1280,
|
||||
height: 720,
|
||||
webPreferences: {
|
||||
@@ -36,7 +38,7 @@ const createWindow = () => {
|
||||
}
|
||||
})
|
||||
|
||||
win.loadFile('renderer/index.html')
|
||||
mainWindow.loadFile('renderer/index.html')
|
||||
}
|
||||
|
||||
app.whenReady().then(() => {
|
||||
@@ -329,4 +331,32 @@ async function verifyNexusAPI() {
|
||||
if (await nexus.getValidationResult()) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ipcMain.handle('get-latest-mods', async () => {
|
||||
if (nexus == undefined) {
|
||||
return
|
||||
}
|
||||
|
||||
mods = await nexus.getLatestAdded()
|
||||
return mods
|
||||
})
|
||||
|
||||
ipcMain.handle('download-mod', async (event, link) => {
|
||||
if (nexus == undefined) {
|
||||
return
|
||||
}
|
||||
|
||||
const nexusWindow = new BrowserWindow({
|
||||
width: 1080,
|
||||
height: 720,
|
||||
modal: true,
|
||||
parent: mainWindow,
|
||||
webPreferences: {
|
||||
nodeIntegration: false,
|
||||
contextIsolation: true
|
||||
}
|
||||
})
|
||||
|
||||
nexusWindow.loadURL(link)
|
||||
})
|
||||
Reference in New Issue
Block a user