-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switched out ps-node for lcu-connector
- Loading branch information
Showing
5 changed files
with
442 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,49 @@ | ||
const electron = require('electron'); | ||
const LCUConnector = require('lcu-connector'); | ||
|
||
const electron = require('electron'); | ||
const {app} = electron; | ||
const {BrowserWindow} = electron; | ||
const root = __dirname + '/app'; | ||
const connector = new LCUConnector(); | ||
const { app } = electron; | ||
const { BrowserWindow } = electron; | ||
const root = __dirname + '/app'; | ||
|
||
const UX = require('./lib/ux'); | ||
let mainWindow = null; | ||
|
||
let mainWindow = null; | ||
app.commandLine.appendSwitch('--ignore-certificate-errors'); | ||
|
||
app.commandLine.appendSwitch('--ignore-certificate-errors'); | ||
app.on('ready', () => { | ||
|
||
app.on('ready', () => { | ||
|
||
mainWindow = new BrowserWindow({ | ||
center: true, | ||
height: 720, | ||
show: false, | ||
title: 'League API', | ||
width: 1280 | ||
}); | ||
|
||
// Remove default menu | ||
mainWindow.setMenu(null); | ||
|
||
mainWindow.loadURL('file://' + root + '/index.html'); | ||
mainWindow = new BrowserWindow({ | ||
center: true, | ||
height: 720, | ||
show: false, | ||
title: 'Rift Explorer', | ||
width: 1280 | ||
}); | ||
|
||
// Check if dev env FIXME | ||
//mainWindow.openDevTools(); | ||
// Remove default menu | ||
mainWindow.setMenu(null); | ||
mainWindow.loadURL('file://' + root + '/index.html'); | ||
|
||
// Avoid white page on load. | ||
mainWindow.webContents.on('did-finish-load', () => { | ||
UX.getArguments() | ||
.then((result) => mainWindow.webContents.send('arguments-load', result)) | ||
.catch((error) => mainWindow.webContents.send('arguments-error', error.message)); | ||
// Check if dev env FIXME | ||
//mainWindow.openDevTools(); | ||
|
||
mainWindow.show(); | ||
// Avoid white page on load. | ||
mainWindow.webContents.on('did-finish-load', () => { | ||
connector.on('connect', (data) => { | ||
mainWindow.webContents.send('lcu-load', data); | ||
}); | ||
|
||
mainWindow.on('closed', () => { | ||
mainWindow = null; | ||
}); | ||
connector.start(); | ||
mainWindow.show(); | ||
}); | ||
|
||
app.on('window-all-closed', () => { | ||
if (process.platform !== 'darwin') { | ||
app.quit(); | ||
} | ||
mainWindow.on('closed', () => { | ||
mainWindow = null; | ||
}); | ||
}); | ||
|
||
app.on('window-all-closed', () => { | ||
if (process.platform !== 'darwin') { | ||
app.quit(); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "rift-explorer", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Explore the API of the League of Legends client", | ||
"main": "app.js", | ||
"scripts": { | ||
|
@@ -10,7 +10,7 @@ | |
"author": "Robert Manolea <[email protected]>", | ||
"license": "MIT", | ||
"dependencies": { | ||
"ps-node": "^0.1.1" | ||
"lcu-connector": "^1.0.0" | ||
}, | ||
"devDependencies": { | ||
"electron": "^1.7.9", | ||
|
@@ -19,5 +19,5 @@ | |
"build": { | ||
"productName": "Rift Explorer", | ||
"appId": "com.rift-explorer" | ||
} | ||
} | ||
} |
Oops, something went wrong.