diff --git a/neutralino.config.json b/neutralino.config.json index e2695ea..6b6a643 100644 --- a/neutralino.config.json +++ b/neutralino.config.json @@ -1,6 +1,6 @@ { "applicationId": "com.krypt0nn.an-anime-game-launcher", - "version": "2.0.0-beta-5", + "version": "2.0.0-beta-6", "defaultMode": "window", "port": 0, "documentRoot": "/bundle/", diff --git a/package.json b/package.json index 5d1d5be..9a3887d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "an-anime-game-launcher", - "version": "2.0.0-beta-5", + "version": "2.0.0-beta-6", "license": "GPL-3.0", "type": "module", "scripts": { diff --git a/scripts/bundle-appimage.cjs b/scripts/bundle-appimage.cjs index 408a71e..cf4d635 100644 --- a/scripts/bundle-appimage.cjs +++ b/scripts/bundle-appimage.cjs @@ -39,7 +39,7 @@ const bundler = new Bundler({ output: path.join(__dirname, '../dist/An Anime Game Launcher.AppImage'), // Application version - version: '2.0.0-beta-5' + version: '2.0.0-beta-6' }); // Bundle project diff --git a/src/ts/Patch.ts b/src/ts/Patch.ts index 573e100..9438137 100644 --- a/src/ts/Patch.ts +++ b/src/ts/Patch.ts @@ -273,7 +273,7 @@ export default class Patch * @returns null if the latest available patch in preparation state * @returns rejects Error object if the patch's repositories are unreachable or they responded with an error */ - public static install(): Promise + public static install(patch: PatchInfo|null = null): Promise { Debug.log({ function: 'Patch.install', @@ -281,7 +281,7 @@ export default class Patch }); return new Promise((resolve, reject) => { - this.latest + Promise.resolve((patch ?? this.latest)) .then((patch) => { if (patch.state === 'preparation') resolve(null); diff --git a/src/ts/launcher/State.ts b/src/ts/launcher/State.ts index ac7a9da..191e480 100644 --- a/src/ts/launcher/State.ts +++ b/src/ts/launcher/State.ts @@ -108,6 +108,9 @@ export default class State this.launcher.progressBar!.hide(); this.predownloadButton.style['display'] = 'none'; + this.launchButton.classList.remove('button-blue'); + this.launchButton.setAttribute('aria-label', ''); + switch(state) { case 'runner-installation-required': diff --git a/src/ts/launcher/states/ApplyPatch.ts b/src/ts/launcher/states/ApplyPatch.ts index 665ab9c..8980dc7 100644 --- a/src/ts/launcher/states/ApplyPatch.ts +++ b/src/ts/launcher/states/ApplyPatch.ts @@ -11,14 +11,14 @@ export default (launcher: Launcher): Promise => { else { launcher.progressBar?.init({ - label: 'Applying patch...', + label: 'Downloading patch...', showSpeed: false, showEta: false, - showPercents: false, - showTotals: false + showPercents: true, + showTotals: true }); - Patch.install().then((stream) => { + Patch.install(patch).then((stream) => { if (stream === null) resolve(); @@ -26,6 +26,36 @@ export default (launcher: Launcher): Promise => { { stream.downloadStart(() => launcher.progressBar?.show()); + stream.downloadProgress((current: number, total: number, difference: number) => { + launcher.progressBar?.update(current, total, difference); + }); + + stream.unpackStart(() => { + launcher.progressBar?.init({ + label: 'Unpacking patch...', + showSpeed: false, + showEta: false, + showPercents: true, + showTotals: true + }); + + launcher.progressBar?.show(); + }); + + stream.unpackProgress((current: number, total: number, difference: number) => { + launcher.progressBar?.update(current, total, difference); + }); + + stream.unpackFinish(() => { + launcher.progressBar?.init({ + label: 'Applying patch...', + showSpeed: false, + showEta: false, + showPercents: false, + showTotals: false + }); + }); + stream.patchFinish(() => { launcher.progressBar?.hide(); diff --git a/src/ts/launcher/states/InstallVoice.ts b/src/ts/launcher/states/InstallVoice.ts index a666bca..b3d4681 100644 --- a/src/ts/launcher/states/InstallVoice.ts +++ b/src/ts/launcher/states/InstallVoice.ts @@ -28,8 +28,8 @@ export default (launcher: Launcher): Promise => { label: `Deleting voice packages...`, showSpeed: false, showEta: false, - showPercents: false, - showTotals: true + showPercents: true, + showTotals: false }); launcher.progressBar?.show();