Reworked a bit windows opening

This commit is contained in:
Observer KRypt0n_ 2021-12-27 20:51:56 +02:00
parent bc8dfc0394
commit 25e4c3f6f2
No known key found for this signature in database
GPG key ID: DC5D4EC1303465DA
5 changed files with 23 additions and 12 deletions

View file

@ -22,7 +22,7 @@
"fullScreen": false,
"alwaysOnTop": false,
"icon": "/public/icons/64x64.png",
"enableInspector": true,
"enableInspector": false,
"borderless": false,
"maximize": false,
"hidden": true,

View file

@ -36,8 +36,6 @@
settingsButton!.onmouseleave = () => {
settingsButton?.classList.remove('hovered');
};
Window.current.show();
});
</script>

View file

@ -36,19 +36,20 @@ export default class Launcher
title: 'Settings',
width: 900,
height: 600,
enableInspector: true
enableInspector: false
});
if (window.status)
{
this.settingsMenu = new Process(window.data!.pid);
this.settingsMenu.runningInterval = null;
/*this.settingsMenu.finish(() => {
this.settingsMenu.finish(() => {
this.settingsMenu = undefined;
Window.current.show();
})
Window.current.hide();*/
Window.current.hide();
}
resolve(window.status);

View file

@ -1,9 +1,11 @@
import Game from '../Game';
import type Launcher from '../Launcher';
import Patch from '../Patch';
import type { LauncherState } from '../types/Launcher';
import Window from '../neutralino/Window';
import Game from '../Game';
import Patch from '../Patch';
export default class State
{
public launcher: Launcher;
@ -32,10 +34,18 @@ export default class State
this.launchButton.onclick = () => {
if (this.events[this._state])
this.events[this._state].then((event) => event.default(this.launcher));
{
this.events[this._state].then((event) => {
event.default(this.launcher).then(() => {
this.update();
});
});
}
};
this.update();
this.update().then(() => {
Window.current.show();
});
}
/**

View file

@ -5,6 +5,8 @@ import Prefix from '../../core/Prefix';
export default (launcher: Launcher): Promise<void> => {
return new Promise(async (resolve) => {
launcher.state!.launchButton!.style['display'] = 'none';
Prefix.exists().then((exists) => {
if (!exists)
{