-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstephino-rpg-main.js
45 lines (39 loc) · 1.2 KB
/
stephino-rpg-main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/**
* Stephino_Rpg
*
* @title RPG
* @desc Entry point
* @copyright (c) 2021, Stephino
* @author Mark Jivko <stephino.team@gmail.com>
* @package stephino-rpg
* @license GPL v3+, https://gnu.org/licenses/gpl-3.0.txt
*/
const { app, BrowserWindow } = require('electron');
const stephinoRpg = require('./src/lib/stephino-rpg');
const core = require('./package.json');
const path = require('path');
const i18n = require('i18n');
// Singleton instance of i18n
i18n.configure({
locales: ['en', 'de', 'fr', 'it', 'es', 'pt', 'ru', 'ro'],
directory: path.join(__dirname, 'src/languages'),
register: stephinoRpg
});
// Uncaught exceptions
process.on('uncaughtException', (exc) => {
stephinoRpg.getGameWindow().webContents.send('ipc:error', exc.message);
core.config.stephino.debug && console.warn(exc);
});
// App ready
app.whenReady().then(() => {
stephinoRpg.navigate.index();
// Re-launch on macOS
app.on('activate', () => {
0 === BrowserWindow.getAllWindows().length && stephinoRpg.navigate.index();
});
});
// Quit when all windows are closed, except on macOS
app.on('window-all-closed', () => {
'darwin' !== process.platform && app.quit();
});
/*EOF*/