mirror of
https://github.com/an-anime-team/an-anime-game-launcher.git
synced 2024-12-29 21:18:17 +03:00
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:
parent
f3de899ba5
commit
e52b87bbb5
7 changed files with 44 additions and 11 deletions
|
@ -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/",
|
||||
|
|
|
@ -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": {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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':
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue