add editing status

This commit is contained in:
HorizonCode 2022-10-27 06:38:58 +02:00
parent 586857146c
commit 78c554be2d
1 changed files with 18 additions and 2 deletions

20
app.js
View File

@ -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!"