OctoLauncher 1.3.1

Manifest-based CDN updater and mod manager for the OctoWoW 1.12.1 client:
launcher-owned realmlist, torrent-backed content sync with bundled aria2c,
antivirus and Defender exclusion handling, hardware-aware render distance,
optional client tweaks and mods, and the in-launcher news feed.
This commit is contained in:
OctoWoW
2026-08-14 01:45:50 +00:00
commit 5dca94a3fc
124 changed files with 24276 additions and 0 deletions
+53
View File
@@ -0,0 +1,53 @@
import { Tray, Menu, nativeImage, app } from 'electron';
import Logger from 'electron-log/main';
import icon from '~build/icon.png?asset';
import { mainWindow } from '~main/index';
let tray: Tray | null = null;
let isMinimizedToTray = false;
const restoreWindow = () => {
if (!mainWindow) return;
mainWindow.show();
if (mainWindow.isMinimized()) mainWindow.restore();
mainWindow.focus();
isMinimizedToTray = false;
};
const ensureTray = () => {
if (tray) return tray;
const trayIcon = nativeImage.createFromPath(icon).resize({ width: 16, height: 16 });
tray = new Tray(trayIcon);
tray.setToolTip('OctoLauncher');
tray.setContextMenu(
Menu.buildFromTemplate([
{ label: 'Show launcher', click: restoreWindow },
{ type: 'separator' },
{ label: 'Quit', click: () => app.quit() }
])
);
tray.on('click', restoreWindow);
return tray;
};
export const minimizeToTray = () => {
if (!mainWindow) return;
ensureTray();
mainWindow.hide();
isMinimizedToTray = true;
Logger.info('Minimized to tray');
};
export const restoreFromTray = () => {
if (!isMinimizedToTray) return;
restoreWindow();
};
export const isInTray = () => isMinimizedToTray;
export const destroyTray = () => {
tray?.destroy();
tray = null;
};