diff --git a/electron/osuUtil.js b/electron/osuUtil.js index 0cbecaa..a3112e3 100644 --- a/electron/osuUtil.js +++ b/electron/osuUtil.js @@ -9,7 +9,6 @@ const checkUpdateURL = "https://osu.ppy.sh/web/check-updates.php?action=check&stream="; const ignoredOsuEntities = [ "osu!auth.dll", - "osu!.exe" ]; const osuEntities = [ "avcodec-51.dll", @@ -267,7 +266,7 @@ async function getPatcherUpdates(osuPath) { ).digest("hex"); if ( latestPatchFileHash.trim().toLowerCase() != - localPatchFileHash.trim().toLowerCase() + localPatchFileHash.trim().toLowerCase() ) filesToDownload.push(patcherFile); } else filesToDownload.push(patcherFile); } @@ -332,7 +331,7 @@ async function getUIFiles(osuPath) { ).digest("hex"); if ( latestPatchFileHash.trim().toLowerCase() != - localPatchFileHash.trim().toLowerCase() + localPatchFileHash.trim().toLowerCase() ) filesToDownload.push(uiFile); } else filesToDownload.push(uiFile); } @@ -417,8 +416,6 @@ async function findOsuInstallation() { return undefined; } - - async function updateOsuConfigHashes(osuPath) { const osuCfg = path.join(osuPath, "osu!.cfg"); const fileStream = await fs.promises.readFile(osuCfg, "utf-8"); @@ -435,7 +432,9 @@ async function updateOsuConfigHashes(osuPath) { const filePath = path.join(osuPath, fileName); if (!fs.existsSync(filePath)) continue; const binaryFileContents = await fs.promises.readFile(filePath); - const existingFileMD5 = crypto.createHash("md5").update(binaryFileContents).digest("hex"); + const existingFileMD5 = crypto.createHash("md5").update( + binaryFileContents, + ).digest("hex"); if (value == existingFileMD5) newLines.push(line); else newLines.push(`${key} = ${existingFileMD5}`); } else if (line.startsWith("u_UpdaterAutoStart")) { @@ -448,7 +447,7 @@ async function updateOsuConfigHashes(osuPath) { } } - await fs.promises.writeFile(osuCfg, newLines.join("\n"), 'utf-8'); + await fs.promises.writeFile(osuCfg, newLines.join("\n"), "utf-8"); } module.exports = { @@ -465,5 +464,5 @@ module.exports = { getUIFiles, replaceUIFile, findOsuInstallation, - updateOsuConfigHashes + updateOsuConfigHashes, }; diff --git a/main.js b/main.js index 9103aad..044e71c 100644 --- a/main.js +++ b/main.js @@ -369,8 +369,9 @@ function registerIPCPipes() { progress: Math.ceil(data.progress), }); mainWindow.webContents.send("ezpplauncher:launchstatus", { - status: `Downloading ${data.fileName}(${formatBytes(data.loaded)}/${formatBytes(data.total) - })...`, + status: `Downloading ${data.fileName}(${formatBytes(data.loaded)}/${ + formatBytes(data.total) + })...`, }); }); await uiDownloader.startDownload(); @@ -399,8 +400,9 @@ function registerIPCPipes() { progress: Math.ceil(data.progress), }); mainWindow.webContents.send("ezpplauncher:launchstatus", { - status: `Downloading ${data.fileName}(${formatBytes(data.loaded)}/${formatBytes(data.total) - })...`, + status: `Downloading ${data.fileName}(${formatBytes(data.loaded)}/${ + formatBytes(data.total) + })...`, }); }); await updateDownloader.startDownload(); @@ -445,8 +447,9 @@ function registerIPCPipes() { progress: Math.ceil(data.progress), }); mainWindow.webContents.send("ezpplauncher:launchstatus", { - status: `Downloading ${data.fileName}(${formatBytes(data.loaded)}/${formatBytes(data.total) - })...`, + status: `Downloading ${data.fileName}(${formatBytes(data.loaded)}/${ + formatBytes(data.total) + })...`, }); }); await patcherDownloader.startDownload(); @@ -477,7 +480,11 @@ function registerIPCPipes() { const userConfig = getUserConfig(osuPath); richPresence.updateVersion(await userConfig.get("LastVersion")); richPresence.update(); + await userConfig.set("ShowInterfaceDuringRelax", "1"); if (currentUser) { + await userConfig.set("CredentialEndpoint", "ez-pp.farm"); + await userConfig.set("SavePassword", "1"); + await userConfig.set("SaveUsername", "1"); await userConfig.set("Username", currentUser.username); await userConfig.set("Password", currentUser.password); } @@ -559,12 +566,13 @@ function createWindow() { registerIPCPipes(); const presenceEnabled = config.get("presence"); - if (presenceEnabled == undefined) + if (presenceEnabled == undefined) { richPresence.connect(); - else { + } else { console.log(presenceEnabled); - if (presenceEnabled == "true") + if (presenceEnabled == "true") { richPresence.connect(); + } } // Uncomment the following line of code when app is ready to be packaged. // loadURL(mainWindow); diff --git a/src/App.svelte b/src/App.svelte index b85f0cb..6b662c6 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -150,9 +150,15 @@ /> {#if $currentUser && $currentUser.id == 1001} - + - + {/if}