mirror of
https://github.com/Gabi-Zar/Silk-Fly-Launcher.git
synced 2026-04-17 05:26:04 +02:00
add silksong path saving
This commit is contained in:
17
main.js
17
main.js
@@ -1,5 +1,8 @@
|
||||
const { app, BrowserWindow } = require('electron/main')
|
||||
const path = require('node:path')
|
||||
const { app, BrowserWindow , ipcMain} = require('electron/main');
|
||||
const path = require('node:path');
|
||||
const Store = require('electron-store').default;
|
||||
|
||||
const store = new Store();
|
||||
|
||||
const createWindow = () => {
|
||||
const win = new BrowserWindow({
|
||||
@@ -27,4 +30,12 @@ app.on('window-all-closed', () => {
|
||||
if (process.platform !== 'darwin') {
|
||||
app.quit()
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
ipcMain.handle('save-path', (event, path) => {
|
||||
store.set('silksong-path', path);
|
||||
});
|
||||
|
||||
ipcMain.handle('load-path', () => {
|
||||
return store.get('silksong-path');
|
||||
});
|
||||
Reference in New Issue
Block a user