2.0.0 beta 6

- added `patch` property to `Patch.install()` method to optimize it a bit
- added `button-blue` and `aria-label` thingies removing after test patch applying
- added some visual tweaks during patch applying
This commit is contained in:
Observer KRypt0n_ 2022-01-05 12:54:23 +02:00
parent f3de899ba5
commit e52b87bbb5
No known key found for this signature in database
GPG key ID: DC5D4EC1303465DA
7 changed files with 44 additions and 11 deletions

View file

@ -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/",

View file

@ -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": {

View file

@ -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

View file

@ -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<Stream|null>
public static install(patch: PatchInfo|null = null): Promise<Stream|null>
{
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);

View file

@ -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':

View file

@ -11,14 +11,14 @@ export default (launcher: Launcher): Promise<void> => {
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<void> => {
{
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();

View file

@ -28,8 +28,8 @@ export default (launcher: Launcher): Promise<void> => {
label: `Deleting voice packages...`,
showSpeed: false,
showEta: false,
showPercents: false,
showTotals: true
showPercents: true,
showTotals: false
});
launcher.progressBar?.show();