mirror of
https://github.com/an-anime-team/an-anime-game-launcher.git
synced 2025-01-01 22:47:19 +03:00
Fixed actions execution issues in the launcher's core libraries
This commit is contained in:
parent
6257c7fab4
commit
081a330830
5 changed files with 25 additions and 20 deletions
|
@ -11,7 +11,7 @@
|
||||||
"check": "svelte-check --tsconfig ./tsconfig.json"
|
"check": "svelte-check --tsconfig ./tsconfig.json"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@empathize/framework": "^1.4.2",
|
"@empathize/framework": "^1.4.3",
|
||||||
"js-md5": "^0.7.3",
|
"js-md5": "^0.7.3",
|
||||||
"semver": "^7.3.5",
|
"semver": "^7.3.5",
|
||||||
"svelte-i18n": "^3.3.13",
|
"svelte-i18n": "^3.3.13",
|
||||||
|
|
|
@ -3,8 +3,8 @@ import { Configs, promisify } from './empathize';
|
||||||
import constants from './ts/Constants';
|
import constants from './ts/Constants';
|
||||||
import Locales from './ts/launcher/Locales';
|
import Locales from './ts/launcher/Locales';
|
||||||
|
|
||||||
promisify(async () => {
|
export default new Promise<void>(async (resolve) => {
|
||||||
Configs.defaults({
|
await Configs.defaults({
|
||||||
lang: {
|
lang: {
|
||||||
launcher: await Locales.system(),
|
launcher: await Locales.system(),
|
||||||
voice: [
|
voice: [
|
||||||
|
@ -199,4 +199,6 @@ promisify(async () => {
|
||||||
launcher: '5d'
|
launcher: '5d'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
resolve();
|
||||||
});
|
});
|
||||||
|
|
|
@ -17,16 +17,6 @@
|
||||||
import GearActive from './assets/images/gear-active.png';
|
import GearActive from './assets/images/gear-active.png';
|
||||||
import Download from './assets/images/cloud-download.png';
|
import Download from './assets/images/cloud-download.png';
|
||||||
|
|
||||||
constants.paths.launcherDir.then((dir) => {
|
|
||||||
// Create launcher folder if it doesn't exist
|
|
||||||
Neutralino.filesystem.getStats(dir)
|
|
||||||
.catch(() => Neutralino.filesystem.createDirectory(dir));
|
|
||||||
|
|
||||||
// Create logs folder if it doesn't exist
|
|
||||||
Neutralino.filesystem.getStats(`${dir}/logs`)
|
|
||||||
.catch(() => Neutralino.filesystem.createDirectory(`${dir}/logs`));
|
|
||||||
});
|
|
||||||
|
|
||||||
const launcher = new Launcher(onMount);
|
const launcher = new Launcher(onMount);
|
||||||
|
|
||||||
Neutralino.events.on('ready', () => {
|
Neutralino.events.on('ready', () => {
|
||||||
|
|
|
@ -5,8 +5,6 @@ declare const Neutralino;
|
||||||
|
|
||||||
Neutralino.init();
|
Neutralino.init();
|
||||||
|
|
||||||
Neutralino.events.on('ready', () => import('../defaultSettings'));
|
|
||||||
|
|
||||||
const app = new App({
|
const app = new App({
|
||||||
target: document.getElementById('app')!
|
target: document.getElementById('app')!
|
||||||
});
|
});
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { locale } from 'svelte-i18n';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
Windows, Process, Tray,
|
Windows, Process, Tray,
|
||||||
Configs, Debug, IPC
|
Configs, Debug, IPC, fs, path
|
||||||
} from '../empathize';
|
} from '../empathize';
|
||||||
|
|
||||||
import constants from './Constants';
|
import constants from './Constants';
|
||||||
|
@ -36,11 +36,26 @@ export default class Launcher
|
||||||
this.tray = new Tray(`/public/icons/256x256.png`);
|
this.tray = new Tray(`/public/icons/256x256.png`);
|
||||||
this.tray.update();
|
this.tray.update();
|
||||||
|
|
||||||
this.updateDiscordRPC('in-launcher');
|
onMount(async () => {
|
||||||
|
const launcherDir = await constants.paths.launcherDir;
|
||||||
|
|
||||||
onMount(() => {
|
// Create launcher folder if it doesn't exist
|
||||||
this.progressBar = new ProgressBar(this);
|
if (!await fs.exists(launcherDir))
|
||||||
this.state = new State(this);
|
await fs.mkdir(launcherDir);
|
||||||
|
|
||||||
|
// Create logs folder if it doesn't exist
|
||||||
|
if (!await fs.exists(path.join(launcherDir, 'logs')))
|
||||||
|
await fs.mkdir(path.join(launcherDir, 'logs'));
|
||||||
|
|
||||||
|
// Applying default settings
|
||||||
|
const defaultSetings = (await import('../defaultSettings')).default;
|
||||||
|
|
||||||
|
defaultSetings.then(() => {
|
||||||
|
this.updateDiscordRPC('in-launcher');
|
||||||
|
|
||||||
|
this.progressBar = new ProgressBar(this);
|
||||||
|
this.state = new State(this);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue