add silksong path saving

This commit is contained in:
2026-01-16 10:09:04 +01:00
parent 9cff9dd24c
commit 57f9bfb8cb
7 changed files with 318 additions and 7 deletions

17
main.js
View File

@@ -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');
});