From 163faec2213a82be1fbd64e00716692e7cac42a1 Mon Sep 17 00:00:00 2001 From: MasterAcnolo <68693319+MasterAcnolo@users.noreply.github.com> Date: Thu, 15 Jan 2026 16:01:24 +0100 Subject: [PATCH] Feat: Add Configuration Button. user can edit config.json as wanted. Linked and IPC --- main.js | 10 ++++++++++ preload.js | 3 ++- public/index.html | 1 + public/script/topbar.js | 2 ++ 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/main.js b/main.js index c690b5e..daa1923 100644 --- a/main.js +++ b/main.js @@ -11,6 +11,13 @@ const { startRPC } = require("./server/discordRPC"); let mainWindow; const logsFolderPath = logDir; + +const basePath = config.localMode + ? path.join(__dirname, "config") + : path.join(path.dirname(process.execPath), "resources"); + +const configFolderPath = path.join(basePath, "config.json"); + const defaultDownloadPath = path.join(os.homedir(), "Downloads", "Freedom Loader"); app.setAppUserModelId("com.masteracnolo.freedomloader"); // pour notifications Windows @@ -176,6 +183,9 @@ ipcMain.on("open-website", () => { ipcMain.on("open-wiki", () => { shell.openExternal("https://masteracnolo.github.io/FreedomLoader/pages/wiki.html"); }); +ipcMain.on("open-config", () => { + if (configFolderPath) shell.openPath(configFolderPath); +}); // App ready diff --git a/preload.js b/preload.js index 150ec42..aacdf74 100644 --- a/preload.js +++ b/preload.js @@ -17,5 +17,6 @@ contextBridge.exposeInMainWorld("topbarAPI", { openDevTools: () => ipcRenderer.send("open-devtools"), openLogs: () => ipcRenderer.send("open-logs"), openWebsite: () => ipcRenderer.send("open-website"), - openWiki: () => ipcRenderer.send("open-wiki") + openWiki: () => ipcRenderer.send("open-wiki"), + openConfig: () => ipcRenderer.send("open-config") }); diff --git a/public/index.html b/public/index.html index ebafd10..d517673 100644 --- a/public/index.html +++ b/public/index.html @@ -23,6 +23,7 @@ +
diff --git a/public/script/topbar.js b/public/script/topbar.js index 2221667..be7f584 100644 --- a/public/script/topbar.js +++ b/public/script/topbar.js @@ -10,6 +10,7 @@ function setupTopbarListeners() { const logsBtn = document.getElementById('logs-btn'); const websiteBtn = document.getElementById('website-btn'); const wikiBtn = document.getElementById('wiki-btn'); + const configBtn = document.getElementById('config-btn'); if (minBtn) minBtn.onclick = () => topbarAPI.minimize(); if (maxBtn) maxBtn.onclick = () => topbarAPI.maximize(); @@ -18,6 +19,7 @@ function setupTopbarListeners() { if (logsBtn) logsBtn.onclick = () => topbarAPI.openLogs(); if (websiteBtn) websiteBtn.onclick = () => topbarAPI.openWebsite(); if (wikiBtn) wikiBtn.onclick = () => topbarAPI.openWiki(); + if (configBtn) configBtn.onclick = () => topbarAPI.openConfig(); }); }