mirror of
https://github.com/an-anime-team/an-anime-game-launcher.git
synced 2025-01-01 22:47:19 +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",
|
"applicationId": "com.krypt0nn.an-anime-game-launcher",
|
||||||
"version": "2.0.0-beta-5",
|
"version": "2.0.0-beta-6",
|
||||||
"defaultMode": "window",
|
"defaultMode": "window",
|
||||||
"port": 0,
|
"port": 0,
|
||||||
"documentRoot": "/bundle/",
|
"documentRoot": "/bundle/",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "an-anime-game-launcher",
|
"name": "an-anime-game-launcher",
|
||||||
"version": "2.0.0-beta-5",
|
"version": "2.0.0-beta-6",
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
@ -39,7 +39,7 @@ const bundler = new Bundler({
|
||||||
output: path.join(__dirname, '../dist/An Anime Game Launcher.AppImage'),
|
output: path.join(__dirname, '../dist/An Anime Game Launcher.AppImage'),
|
||||||
|
|
||||||
// Application version
|
// Application version
|
||||||
version: '2.0.0-beta-5'
|
version: '2.0.0-beta-6'
|
||||||
});
|
});
|
||||||
|
|
||||||
// Bundle project
|
// Bundle project
|
||||||
|
|
|
@ -273,7 +273,7 @@ export default class Patch
|
||||||
* @returns null if the latest available patch in preparation state
|
* @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
|
* @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({
|
Debug.log({
|
||||||
function: 'Patch.install',
|
function: 'Patch.install',
|
||||||
|
@ -281,7 +281,7 @@ export default class Patch
|
||||||
});
|
});
|
||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
this.latest
|
Promise.resolve((patch ?? this.latest))
|
||||||
.then((patch) => {
|
.then((patch) => {
|
||||||
if (patch.state === 'preparation')
|
if (patch.state === 'preparation')
|
||||||
resolve(null);
|
resolve(null);
|
||||||
|
|
|
@ -108,6 +108,9 @@ export default class State
|
||||||
this.launcher.progressBar!.hide();
|
this.launcher.progressBar!.hide();
|
||||||
this.predownloadButton.style['display'] = 'none';
|
this.predownloadButton.style['display'] = 'none';
|
||||||
|
|
||||||
|
this.launchButton.classList.remove('button-blue');
|
||||||
|
this.launchButton.setAttribute('aria-label', '');
|
||||||
|
|
||||||
switch(state)
|
switch(state)
|
||||||
{
|
{
|
||||||
case 'runner-installation-required':
|
case 'runner-installation-required':
|
||||||
|
|
|
@ -11,14 +11,14 @@ export default (launcher: Launcher): Promise<void> => {
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
launcher.progressBar?.init({
|
launcher.progressBar?.init({
|
||||||
label: 'Applying patch...',
|
label: 'Downloading patch...',
|
||||||
showSpeed: false,
|
showSpeed: false,
|
||||||
showEta: false,
|
showEta: false,
|
||||||
showPercents: false,
|
showPercents: true,
|
||||||
showTotals: false
|
showTotals: true
|
||||||
});
|
});
|
||||||
|
|
||||||
Patch.install().then((stream) => {
|
Patch.install(patch).then((stream) => {
|
||||||
if (stream === null)
|
if (stream === null)
|
||||||
resolve();
|
resolve();
|
||||||
|
|
||||||
|
@ -26,6 +26,36 @@ export default (launcher: Launcher): Promise<void> => {
|
||||||
{
|
{
|
||||||
stream.downloadStart(() => launcher.progressBar?.show());
|
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(() => {
|
stream.patchFinish(() => {
|
||||||
launcher.progressBar?.hide();
|
launcher.progressBar?.hide();
|
||||||
|
|
||||||
|
|
|
@ -28,8 +28,8 @@ export default (launcher: Launcher): Promise<void> => {
|
||||||
label: `Deleting voice packages...`,
|
label: `Deleting voice packages...`,
|
||||||
showSpeed: false,
|
showSpeed: false,
|
||||||
showEta: false,
|
showEta: false,
|
||||||
showPercents: false,
|
showPercents: true,
|
||||||
showTotals: true
|
showTotals: false
|
||||||
});
|
});
|
||||||
|
|
||||||
launcher.progressBar?.show();
|
launcher.progressBar?.show();
|
||||||
|
|
Loading…
Reference in a new issue