From 78c554be2d85b67c3b0a7484398ebce1f47e4eb8 Mon Sep 17 00:00:00 2001 From: HorizonCode Date: Thu, 27 Oct 2022 06:38:58 +0200 Subject: [PATCH] add editing status --- app.js | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/app.js b/app.js index 226d85c..d88f5e6 100644 --- a/app.js +++ b/app.js @@ -40,7 +40,10 @@ const run = () => { const splitArray = [components.shift(), components.join(' - ')]; rpcOsuVersion = splitArray[0]; currentMap = splitArray[1]; - rpc.updateState("Playing..."); + if(currentMap.endsWith(".osu")){ + rpc.updateState("Editing..."); + currentMap = currentMap.substring(0, currentMap.length - 4); + } else rpc.updateState("Playing..."); } rpc.updateStatus(currentMap, rpcOsuVersion); @@ -79,7 +82,11 @@ const run = () => { const splitArray = [components.shift(), components.join(' - ')]; rpcOsuVersion = splitArray[0]; currentMap = splitArray[1]; - rpc.updateState("Playing..."); + if(currentMap.endsWith(".osu")){ + rpc.updateState("Editing..."); + currentMap = currentMap.substring(0, currentMap.length - 4); + } + else rpc.updateState("Playing..."); } rpc.updateStatus(currentMap, rpcOsuVersion); @@ -112,6 +119,15 @@ const run = () => { await tryLogin(mainWindow); await doUpdateCheck(mainWindow); if (platform === "linux") { + try{ + await terminalUtil.execCommand(`osu-stable -h`); + }catch(err){ + mainWindow.webContents.send('status_update', { + type: "package-issue", + message: "Seems like you dont have the osu AUR Package installed, please install it." + }); + return; + } /* mainWindow.webContents.send('status_update', { type: "info", message: "We detected that you are running the Launcher under Linux. It's currently just compatible with Arch and the osu AUR package!"