mirror of
https://github.com/MasterAcnolo/Freedom-Loader.git
synced 2026-07-29 18:25:47 +02:00
Feat: Add Configuration Button. user can edit config.json as wanted. Linked and IPC
This commit is contained in:
10
main.js
10
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
|
||||
|
||||
@@ -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")
|
||||
});
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
<button id="logs-btn" title="Logs">Logs</button>
|
||||
<button id="website-btn" title="Website">Website</button>
|
||||
<button id="wiki-btn" title="Wiki">Wiki</button>
|
||||
<button id="config-btn" title="Configuration">Configuration</button>
|
||||
</div>
|
||||
<div class="window-controls">
|
||||
<button id="minimize-btn" title="Réduire"><img src="assets/icon/minimize.svg"></button>
|
||||
|
||||
@@ -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();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user