diff --git a/forge.config.js b/forge.config.js index ee9da32..f431f27 100644 --- a/forge.config.js +++ b/forge.config.js @@ -1,9 +1,13 @@ +const path = require("path"); + module.exports = { packagerConfig: { extraResource: [ "./resources/server.properties", "./resources/fabric-installer.jar", + "./img/icons/icon_main.png", ], + icon: "./img/icons/icon_main", }, makers: [ { @@ -11,7 +15,6 @@ module.exports = { config: { name: "multiserver", setupIcon: "./img/icons/icon_setup.ico", - iconUrl: `file://${__dirname}/img/icons/icon_main.ico`, }, }, { diff --git a/img/icons/icon_main.icns b/img/icons/icon_main.icns new file mode 100644 index 0000000..460c221 Binary files /dev/null and b/img/icons/icon_main.icns differ diff --git a/src/index.ts b/src/index.ts index cc82541..5159d55 100644 --- a/src/index.ts +++ b/src/index.ts @@ -11,6 +11,7 @@ import { runInstance } from "#lib/instances/runInstance"; import { getAvatar } from "#lib/avatar"; import * as settings from "#lib/settings"; import type { InstanceEditOptions } from "#types"; +import { resourcesPath } from "#lib/constants"; // declarations for webpack magic constants for built react code declare const MAIN_WINDOW_WEBPACK_ENTRY: string; @@ -39,6 +40,10 @@ const createWindow = () => { webPreferences: { preload: MAIN_WINDOW_PRELOAD_WEBPACK_ENTRY, }, + icon: + process.platform === "linux" + ? `${process.resourcesPath}/icon_main.png` + : undefined, }); if (app.isPackaged) mainWindow.removeMenu(); @@ -74,11 +79,15 @@ app.on("activate", () => { ipcMain.on("newInstanceWindow", () => { const newInstanceWindow = new BrowserWindow({ - height: 500, + height: 550, width: 400, webPreferences: { preload: NEW_INSTANCE_WINDOW_PRELOAD_WEBPACK_ENTRY, }, + icon: + process.platform === "linux" + ? `${process.resourcesPath}/icon_main.png` + : undefined, }); if (app.isPackaged) newInstanceWindow.removeMenu(); @@ -93,6 +102,10 @@ ipcMain.on("editInstanceWindow", async (e, name: string) => { webPreferences: { preload: EDIT_INSTANCE_WINDOW_PRELOAD_WEBPACK_ENTRY, }, + icon: + process.platform === "linux" + ? `${process.resourcesPath}/icon_main.png` + : undefined, }); if (app.isPackaged) editWindow.removeMenu(); @@ -136,6 +149,10 @@ ipcMain.on("runInstance", (e, name: string) => { webPreferences: { preload: RUN_WINDOW_PRELOAD_WEBPACK_ENTRY, }, + icon: + process.platform === "linux" + ? `${process.resourcesPath}/icon_main.png` + : undefined, }); if (app.isPackaged) runWindow.removeMenu(); @@ -183,6 +200,10 @@ ipcMain.on("settingsWindow", () => { webPreferences: { preload: SETTINGS_WINDOW_PRELOAD_WEBPACK_ENTRY, }, + icon: + process.platform === "linux" + ? `${process.resourcesPath}/icon_main.png` + : undefined, }); if (app.isPackaged) settingsWindow.removeMenu(); diff --git a/src/windows/NewInstanceWindow.tsx b/src/windows/NewInstanceWindow.tsx index 6a2b933..1636644 100644 --- a/src/windows/NewInstanceWindow.tsx +++ b/src/windows/NewInstanceWindow.tsx @@ -82,7 +82,7 @@ const NewInstanceWindow = () => {

New Instance

{ value={name} onChange={(e) => onNameChange(e.target.value)} /> - {savePath && ( + {savePath ? ( Will be saved as{" "} {savePath} + ) : ( +
// empty space to cover text location )}