prevent closing when ingame
This commit is contained in:
parent
37b7bbd2e3
commit
7ed7d3045f
5
app.js
5
app.js
|
@ -157,6 +157,9 @@ const run = () => {
|
||||||
tray.setContextMenu(trayMenu)
|
tray.setContextMenu(trayMenu)
|
||||||
|
|
||||||
mainWindow = createWindow();
|
mainWindow = createWindow();
|
||||||
|
mainWindow.on('close', (e) => {
|
||||||
|
if (isIngame) e.preventDefault();
|
||||||
|
});
|
||||||
mainWindow.once('show', async () => {
|
mainWindow.once('show', async () => {
|
||||||
await updateConfigVars(mainWindow);
|
await updateConfigVars(mainWindow);
|
||||||
await tryLogin(mainWindow);
|
await tryLogin(mainWindow);
|
||||||
|
@ -230,6 +233,7 @@ const run = () => {
|
||||||
await osuUtil.replaceUI(osuFolder, true);
|
await osuUtil.replaceUI(osuFolder, true);
|
||||||
rpc.updateState("Launching osu!...");
|
rpc.updateState("Launching osu!...");
|
||||||
isIngame = true;
|
isIngame = true;
|
||||||
|
mainWindow.closable = false;
|
||||||
if (mainWindow.isVisible()) mainWindow.hide();
|
if (mainWindow.isVisible()) mainWindow.hide();
|
||||||
const result = await osuUtil.startOsuWithDevServer(tempOsuPath, "ez-pp.farm", async () => {
|
const result = await osuUtil.startOsuWithDevServer(tempOsuPath, "ez-pp.farm", async () => {
|
||||||
if (!mainWindow.isVisible()) mainWindow.show();
|
if (!mainWindow.isVisible()) mainWindow.show();
|
||||||
|
@ -237,6 +241,7 @@ const run = () => {
|
||||||
isIngame = false;
|
isIngame = false;
|
||||||
await osuUtil.replaceUI(osuFolder, false);
|
await osuUtil.replaceUI(osuFolder, false);
|
||||||
await doUpdateCheck(mainWindow);
|
await doUpdateCheck(mainWindow);
|
||||||
|
mainWindow.closable = true;
|
||||||
}, 2000);
|
}, 2000);
|
||||||
});
|
});
|
||||||
return result;
|
return result;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user