4 Commits

Author SHA1 Message Date
769a88521e fix tray logo 2023-06-02 12:42:12 +02:00
f5287b6378 bump back version, apply fix version to appinfo 2023-06-02 12:30:57 +02:00
dd6866f680 change exe output file 2023-06-02 12:29:21 +02:00
cb1a05d58c titlebar fixes 2023-06-02 12:22:28 +02:00
5 changed files with 593 additions and 581 deletions

17
app.js
View File

@@ -1,15 +1,17 @@
const { app, BrowserWindow, ipcMain, dialog, Tray, Menu } = require('electron');
const { setupTitlebar, attachTitlebarToWindow } = require('custom-electron-titlebar/main');
const { setupTitlebar } = require('custom-electron-titlebar/main');
const windowManager = require('./ui/windowManager');
const osuUtil = require('./osuUtil');
const ezppUtil = require('./ezppUtil');
const config = require('./config');
const fs = require('fs');
const path = require('path');
const rpc = require('./discordPresence');
const windowName = require('get-window-by-name');
const terminalUtil = require('./terminalUtil');
const osUtil = require('./osUtil');
const appInfo = require('./appInfo');
const { DownloaderHelper } = require('node-downloader-helper');
let tempOsuPath;
let osuWindowInfo;
@@ -121,9 +123,15 @@ const run = () => {
let mainWindow;
let tray = null
app.whenReady().then(() => {
tray = new Tray('./assets/logo.png');
app.whenReady().then(async () => {
const logoFile = path.join(config.configFolder, "logo.png");
if (!fs.existsSync(logoFile)) {
const logoDownload = new DownloaderHelper("https://ez-pp.farm/assets/img/icon.png", config.configFolder, {
fileName: "logo.png",
})
await logoDownload.start();
}
tray = new Tray(logoFile);
const trayMenuTemplate = [
{
label: `EZPPLauncher ${appInfo.appVersion}`,
@@ -376,7 +384,6 @@ function createWindow() {
win.loadFile('./html/index.html');
attachTitlebarToWindow(win);
win.webContents.setWindowOpenHandler(() => "deny");
win.webContents.on('did-finish-load', function () {
if (win.webContents.getZoomFactor() != 0.9)

View File

@@ -68,4 +68,4 @@ async function remove(key) {
await fs.promises.writeFile(configLocation, arr.join('\n'));
}
module.exports = { get, set, remove }
module.exports = { get, set, remove, configFolder }

View File

@@ -22,7 +22,7 @@
"runAfterFinish": true
},
"portable": {
"artifactName": "EZPPLauncher.exe"
"artifactName": "ezpplauncher-${version}.exe"
}
},
"frontend": {

View File

@@ -1,16 +1,16 @@
const { ipcRenderer, shell } = require('electron');
const { Titlebar, Color } = require('custom-electron-titlebar');
const { Titlebar, TitlebarColor } = require('custom-electron-titlebar');
const appInfo = require('../appInfo');
let titlebar;
let currentPage = "loading";
let loggedIn = false;
window.addEventListener('DOMContentLoaded', () => {
titlebar = new Titlebar({
backgroundColor: Color.fromHex("#24283B"),
itemBackgroundColor: Color.fromHex("#121212"),
const titlebar = new Titlebar({
backgroundColor: TitlebarColor.fromHex("#24283B"),
itemBackgroundColor: TitlebarColor.fromHex("#121212"),
menu: null,
maximizable: false
enableMnemonics: false,
maximizable: false,
});
titlebar.updateTitle(`${appInfo.appName} ${appInfo.appVersion}`);

View File

@@ -1,6 +1,6 @@
const path = require("path");
const appInfo = require('../appInfo');
const { BrowserWindow } = require('electron');
const { BrowserWindow, Menu } = require('electron');
const { attachTitlebarToWindow } = require('custom-electron-titlebar/main');
module.exports = {
@@ -26,6 +26,10 @@ module.exports = {
},
icon: './assets/logo.png'
})
const menu = Menu.buildFromTemplate([])
Menu.setApplicationMenu(menu);
window.hide();
window.webContents.once("did-finish-load", function (event, input) {
@@ -33,6 +37,7 @@ module.exports = {
});
window.webContents.setUserAgent(`${appInfo.appName} ${appInfo.appVersion}`);
attachTitlebarToWindow(window);
return window;