preperations for the patch method

This commit is contained in:
HorizonCode 2022-10-27 13:58:15 +02:00
parent 67a53fdd2d
commit 89cdc8f316

7
app.js
View File

@ -14,6 +14,7 @@ let osuWindowInfo;
let isIngame; let isIngame;
const platform = process.platform; const platform = process.platform;
let linuxWMCtrlFound = false; let linuxWMCtrlFound = false;
let osuLoaded = false;
const run = () => { const run = () => {
const gotTheLock = app.requestSingleInstanceLock() const gotTheLock = app.requestSingleInstanceLock()
@ -28,6 +29,10 @@ const run = () => {
const firstInstance = osuWindowInfo[0]; const firstInstance = osuWindowInfo[0];
if (firstInstance) { if (firstInstance) {
if (firstInstance.processTitle && firstInstance.processTitle.length > 0) { if (firstInstance.processTitle && firstInstance.processTitle.length > 0) {
if (!osuLoaded) {
osuLoaded = true;
//TODO: do patch
}
const windowTitle = firstInstance.processTitle; const windowTitle = firstInstance.processTitle;
let rpcOsuVersion = ""; let rpcOsuVersion = "";
let currentMap = undefined; let currentMap = undefined;
@ -48,10 +53,12 @@ const run = () => {
rpc.updateStatus(currentMap, rpcOsuVersion); rpc.updateStatus(currentMap, rpcOsuVersion);
} else { } else {
if (osuLoaded) osuLoaded = false;
rpc.updateState("Idle in Launcher..."); rpc.updateState("Idle in Launcher...");
rpc.updateStatus(undefined, undefined); rpc.updateStatus(undefined, undefined);
} }
} else { } else {
if (osuLoaded) osuLoaded = false;
rpc.updateState("Idle in Launcher..."); rpc.updateState("Idle in Launcher...");
rpc.updateStatus(undefined, undefined); rpc.updateStatus(undefined, undefined);
} }