2.2.0 (pre-release 2)

- added analytics window
- reworked `Checkbox`'s `tooltip` property
- added `LeftCheckbox` component
- added `constants.uri.analytics` field
- updated French and Hungarian
This commit is contained in:
Observer KRypt0n_ 2022-02-19 21:24:26 +02:00
parent 6d54a53d5e
commit e0a093237d
No known key found for this signature in database
GPG key ID: 844DA47BA25FE1E2
22 changed files with 462 additions and 70 deletions

View file

@ -159,11 +159,11 @@ This is our current roadmap goals. You can find older ones [here](repository/pag
* <s>ToS Violation Window</s> *(2.1.0)* * <s>ToS Violation Window</s> *(2.1.0)*
* <s>Add `latest.log` file generation</s> *(2.1.2)* * <s>Add `latest.log` file generation</s> *(2.1.2)*
* <s>Add an option to show terminal with the wine's log of the game</s> *(7375c743, released in 2.1.3)* * <s>Add an option to show terminal with the wine's log of the game</s> *(7375c743, released in 2.1.3)*
* <s>Statistics window</s>
* Add Chinese game's version support (due to changes in the Krock's patch) * Add Chinese game's version support (due to changes in the Krock's patch)
* Implement manual config flushing functionality from the Empathize's API * Implement manual config flushing functionality from the Empathize's API
* Add analytics window * Add analytics window
* Dark progress bar design * Dark progress bar design
* Statistics window
* Changelog window * Changelog window
* Screenshots explorer * Screenshots explorer
* Add Patch category in settings menu with * Add Patch category in settings menu with

View file

@ -5,6 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" lang="sass" href="/src/sass/analytics.sass" /> <link rel="stylesheet" lang="sass" href="/src/sass/analytics.sass" />
<link rel="stylesheet" href="/src/css/hint.min.css" />
</head> </head>
<body data-theme="light"> <body data-theme="light">

View file

@ -11,7 +11,7 @@
"check": "svelte-check --tsconfig ./tsconfig.json" "check": "svelte-check --tsconfig ./tsconfig.json"
}, },
"dependencies": { "dependencies": {
"@empathize/framework": "^1.4.6", "@empathize/framework": "^1.4.8",
"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",

View file

@ -323,3 +323,22 @@ tos_violation:
tooltip: Sie sollten diesen Text wirklich lesen, Er ist sehr wichtig. tooltip: Sie sollten diesen Text wirklich lesen, Er ist sehr wichtig.
cancel: Abbrechen cancel: Abbrechen
discord: Unser Discord Server discord: Unser Discord Server
# Analytics window
analytics:
title: Yanfeis Kommission...
header: Teilnahme an der anonymen Datenerhebung
body:
- Um die aktive Nutzerbasis für Linux zu zählen, möchte Yanfei bei jedem Update des Spiels Ihre IP-Adresse erfassen
- Die IP-Adresse wird zu Sicherheitszwecken gehasht
actions:
share_country:
title: Land teilen
hint: Erlauben Sie Yanfei das Land zu speichern das Ihre IP-Adresse anzeigt, um die Statistiken detaillierter zu gestalten.
Es werden keine anderen Daten als das Land gespeichert
participate: Teilnehmen
skip: Überspringen
skip_forever: Überspringen und nicht mehr nach fragen

View file

@ -323,3 +323,21 @@ tos_violation:
tooltip: You really should read this text above. It's important tooltip: You really should read this text above. It's important
cancel: Cancel cancel: Cancel
discord: Our discord server discord: Our discord server
# Analytics window
analytics:
title: Yanfei's commission...
header: Participate in anonymous data collection
body:
- To count the active user base for Linux, Yanfei would like to collect your IP address everytime the game updates
- The IP address will be hashed for security purpose
actions:
share_country:
title: Share country
hint: Allow Yanfei to store the country your IP address registered in to make statistics more detailed. No other data than the country will be stored
participate: Participate
skip: Skip
skip_forever: Skip and don't ask again

View file

@ -321,3 +321,21 @@ tos_violation:
tooltip: Realmente deberías leer el texto de arriba. Es importante. tooltip: Realmente deberías leer el texto de arriba. Es importante.
cancel: Cancelar cancel: Cancelar
discord: Nuestro servidor de Discord discord: Nuestro servidor de Discord
# Analytics window
analytics:
title: Yanfei's commission...
header: Participate in anonymous data collection
body:
- To count the active user base for Linux, Yanfei would like to collect your IP address everytime the game updates
- The IP address will be hashed for security purpose
actions:
share_country:
title: Share country
hint: Allow Yanfei to store the country your IP address registered in to make statistics more detailed. No other data than the country will be stored
participate: Participate
skip: Skip
skip_forever: Skip and don't ask again

View file

@ -23,7 +23,7 @@ launcher:
game: game:
downloading: Téléchargement du jeu... downloading: Téléchargement du jeu...
unpacking: Décompression du jeu... unpacking: Décompression du jeu...
applying_changes: Applying changes... applying_changes: Application des changements...
deleting_outdated: Suppression des fichiers non à jour... deleting_outdated: Suppression des fichiers non à jour...
# Voice packages installation # Voice packages installation
@ -42,12 +42,14 @@ launcher:
update: Mise à jour update: Mise à jour
apply_changes: apply_changes:
title: Apply changes # There you may want to do it with a line break "Appliquer" may look better ?
hint: Apply hdiff changes to the game files title: Appliquer les changements
hint: Appliquer le patch hdiff sur les fichiers du jeu
remove_outdated: remove_outdated:
title: Remove outdated # Same as "Appliquer" to keep a consistency if the previous one has a line break this one should else none but welcome long button I guess.
hint: Remove outdated game files title: Supprimer les obsolètes
hint: Supprimer les fichiers du jeu qui sont devenus obsolètes
# When the game should be patched # When the game should be patched
patching: patching:
@ -310,8 +312,8 @@ notifications:
# HDiffPatch couldn't successfully apply game files changes # HDiffPatch couldn't successfully apply game files changes
game_changes_applying_error: game_changes_applying_error:
title: An error occurred during game updating title: Une erreur a été détectée pendant la mise à jour du jeu
body: '{files} files couldn''t be updated by the hdiff patch' body: '{files} fichiers n''ont pas pu être mise à jour avec le patch hdiff'
# ToS violation warning window # ToS violation warning window
tos_violation: tos_violation:
@ -331,3 +333,22 @@ tos_violation:
tooltip: Vous devriez réellement lire le texte ci-dessus, c'est important. tooltip: Vous devriez réellement lire le texte ci-dessus, c'est important.
cancel: Annuler cancel: Annuler
discord: Notre serveur discord discord: Notre serveur discord
# Analytics window
analytics:
title: Commission de Yanfei...
header: Participer a la collecte des données anonymement
body:
- Pour comptabiliser le nombre d'utilisateurs sur Linux, Yanfei aimerait collecter votre adresse IP à chaque mise à jour du jeu
- Votre adresse IP sera cryptée (méthode Hash) pour des raisons de sécurités
actions:
share_country:
title: Partage du Pays
hint: Autoriser Yanfei a sauvegardé votre Pays avec votre IP pour rendre les statistiques plus détaillées.
Aucune autre donnée que votre pays sera sauvegardé
participate: Participer
skip: Passer
skip_forever: Passer et ne plus demander

View file

@ -23,7 +23,7 @@ launcher:
game: game:
downloading: Játék letöltése folyamatban... downloading: Játék letöltése folyamatban...
unpacking: Játék kibontása folyamatban... unpacking: Játék kibontása folyamatban...
applying_changes: Applying changes... applying_changes: Változások alkalmazása...
deleting_outdated: Lejárt fájlok kitörlése... deleting_outdated: Lejárt fájlok kitörlése...
# Voice packages installation # Voice packages installation
@ -42,12 +42,12 @@ launcher:
update: Frissítés update: Frissítés
apply_changes: apply_changes:
title: Apply changes title: Változások alkalmazása
hint: Apply hdiff changes to the game files hint: Hdiff változások alkalmazása a játékfájlokra
remove_outdated: remove_outdated:
title: Remove outdated title: Elavultak törlése
hint: Remove outdated game files hint: Elavult játékfájlok törlése
# When the game should be patched # When the game should be patched
patching: patching:
@ -302,8 +302,8 @@ notifications:
# HDiffPatch couldn't successfully apply game files changes # HDiffPatch couldn't successfully apply game files changes
game_changes_applying_error: game_changes_applying_error:
title: An error occurred during game updating title: Hiba történt a játék frissítése közben
body: '{files} files couldn''t be updated by the hdiff patch' body: '{files} fájlt nem lehetett frissíteni a hdiff patch-el'
# ToS violation warning window # ToS violation warning window
tos_violation: tos_violation:
@ -323,3 +323,21 @@ tos_violation:
tooltip: A fenti szöveget ajánlott elolvasnod. Tényleg fontos. tooltip: A fenti szöveget ajánlott elolvasnod. Tényleg fontos.
cancel: Mégse cancel: Mégse
discord: 'Discord szerverünk:' discord: 'Discord szerverünk:'
# Analytics window
analytics:
title: Yanfei jussa...
header: Részvétel anoním adatgyűjtésben
body:
- Hogy számon tartsuk az aktív Linux felhasználók számát, Yanfei szeretné elkérni az IP-det minden játékfrissítésnél
- Az IP-d hashelve lesz biztonsági okokból
actions:
share_country:
title: Ország megosztása
hint: Engedély Yanfei-nek hogy tárolja az IP címed regisztrált országát, hogy részletesebbek lehessenek a statisztikák. Más adat nem lesz tárolva
participate: Részvétel
skip: Átugrás
skip_forever: Átugrás és többet ne kérdezd

View file

@ -323,3 +323,21 @@ tos_violation:
tooltip: Kamu harus benar benar membaca teks diatas. Sangat Penting tooltip: Kamu harus benar benar membaca teks diatas. Sangat Penting
cancel: Batalkan cancel: Batalkan
discord: Peladen Discord kami discord: Peladen Discord kami
# Analytics window
analytics:
title: Yanfei's commission...
header: Participate in anonymous data collection
body:
- To count the active user base for Linux, Yanfei would like to collect your IP address everytime the game updates
- The IP address will be hashed for security purpose
actions:
share_country:
title: Share country
hint: Allow Yanfei to store the country your IP address registered in to make statistics more detailed. No other data than the country will be stored
participate: Participate
skip: Skip
skip_forever: Skip and don't ask again

View file

@ -321,3 +321,21 @@ tos_violation:
tooltip: Dovresti davvero leggere il testo sopra. È importante tooltip: Dovresti davvero leggere il testo sopra. È importante
cancel: Annulla cancel: Annulla
discord: Il nostro server Discord discord: Il nostro server Discord
# Analytics window
analytics:
title: Yanfei's commission...
header: Participate in anonymous data collection
body:
- To count the active user base for Linux, Yanfei would like to collect your IP address everytime the game updates
- The IP address will be hashed for security purpose
actions:
share_country:
title: Share country
hint: Allow Yanfei to store the country your IP address registered in to make statistics more detailed. No other data than the country will be stored
participate: Participate
skip: Skip
skip_forever: Skip and don't ask again

View file

@ -323,3 +323,21 @@ tos_violation:
tooltip: Du burde virkelig lese teksten over. Det er viktig tooltip: Du burde virkelig lese teksten over. Det er viktig
cancel: Avbryt cancel: Avbryt
discord: Vår discord server discord: Vår discord server
# Analytics window
analytics:
title: Yanfei's commission...
header: Participate in anonymous data collection
body:
- To count the active user base for Linux, Yanfei would like to collect your IP address everytime the game updates
- The IP address will be hashed for security purpose
actions:
share_country:
title: Share country
hint: Allow Yanfei to store the country your IP address registered in to make statistics more detailed. No other data than the country will be stored
participate: Participate
skip: Skip
skip_forever: Skip and don't ask again

View file

@ -322,3 +322,22 @@ tos_violation:
tooltip: Вы действительно должны прочитать этот текст сверху. Это важно tooltip: Вы действительно должны прочитать этот текст сверху. Это важно
cancel: Отменить cancel: Отменить
discord: Наш Discord сервер discord: Наш Discord сервер
# Analytics window
analytics:
title: Просьба Янь Фэй...
header: Примите участие в анонимном сборе данных
body:
- Чтобы посчитать число активных игроков на Linux, Янь Фэй просит их поделиться IP адресом после каждого обновления игры
- IP адрес будет хэширован для обеспечения его безопасности
actions:
share_country:
title: Поделиться названием страны
hint: Разрешить Янь Фэй хранить название страны, к которой привязан ваш IP адрес, чтобы сделать статистику более детальной.
Никаких других данных кроме названия страны сохранено не будет
participate: Участвовать
skip: Пропустить
skip_forever: Пропустить и больше не спрашивать

View file

@ -322,3 +322,21 @@ tos_violation:
tooltip: You really should read this text above. It's important tooltip: You really should read this text above. It's important
cancel: Cancel cancel: Cancel
discord: Our discord server discord: Our discord server
# Analytics window
analytics:
title: Yanfei's commission...
header: Participate in anonymous data collection
body:
- To count the active user base for Linux, Yanfei would like to collect your IP address everytime the game updates
- The IP address will be hashed for security purpose
actions:
share_country:
title: Share country
hint: Allow Yanfei to store the country your IP address registered in to make statistics more detailed. No other data than the country will be stored
participate: Participate
skip: Skip
skip_forever: Skip and don't ask again

View file

@ -6,14 +6,31 @@
import { onMount } from 'svelte'; import { onMount } from 'svelte';
import { _, locale } from 'svelte-i18n'; import { _, locale } from 'svelte-i18n';
import { Configs, Windows } from './empathize'; import { Configs, Windows, fetch, IPC } from './empathize';
import constants from './ts/Constants';
import YanfeiIcon from './assets/images/yanfei.png';
import LeftCheckbox from './components/LeftCheckbox.svelte';
import Button from './components/Button.svelte';
onMount(() => { onMount(() => {
Windows.current.show(); Windows.current.show();
Windows.current.center(); Windows.current.center(700, 460);
}); });
Neutralino.events.on('windowClose', () => { let shareCountry = true;
const closeWindow = async () => {
await Neutralino.filesystem.removeFile(`${await constants.paths.launcherDir}/.analytics`);
Neutralino.app.exit();
};
Neutralino.events.on('windowClose', async () => {
await IPC.write('analytics-close');
Neutralino.app.exit(); Neutralino.app.exit();
}); });
@ -28,6 +45,56 @@
{#if typeof $locale === 'string'} {#if typeof $locale === 'string'}
<main> <main>
<div class="header">
<img src={YanfeiIcon} alt="">
<h2>{$_('analytics.header')}</h2>
</div>
<p>{$_('analytics.body.0')}</p>
<p>{$_('analytics.body.1')}</p>
<div class="footer">
<LeftCheckbox
lang="analytics.actions.share_country.title"
tooltip={{
lang: 'analytics.actions.share_country.hint',
direction: 'top',
size: 'large'
}}
valueChanged={(value) => shareCountry = value}
/>
<div class="actions">
<!-- svelte-ignore missing-declaration -->
<Button
lang="analytics.actions.participate"
primary={true}
click={async () => {
await fetch(`${constants.uri.analytics}/${shareCountry ? '' : '?hide-geo'}`);
closeWindow();
}}
/>
<div class="actions-right">
<!-- svelte-ignore missing-declaration -->
<Button
lang="analytics.actions.skip"
click={closeWindow}
/>
<!-- svelte-ignore missing-declaration -->
<Button
lang="analytics.actions.skip_forever"
click={async () => {
await Configs.set('skip_analytics', true);
closeWindow();
}}
/>
</div>
</div>
</div>
</main> </main>
{/if} {/if}

View file

@ -1,6 +1,8 @@
<script lang="ts"> <script lang="ts">
import { _ } from 'svelte-i18n'; import { _ } from 'svelte-i18n';
import type { Tooltip } from '../ts/types/Tooltip';
import { Configs } from '../empathize'; import { Configs } from '../empathize';
export let active: boolean = false; export let active: boolean = false;
@ -8,7 +10,7 @@
export let prop: string = ''; export let prop: string = '';
export let lang: string = ''; export let lang: string = '';
export let tooltip: string = ''; export let tooltip: Tooltip|undefined = undefined;
export let valueChanged: (value: boolean) => void = () => {}; export let valueChanged: (value: boolean) => void = () => {};
@ -30,10 +32,9 @@
<div class="checkbox" class:checkbox-active={active} class:checkbox-disabled={disabled}> <div class="checkbox" class:checkbox-active={active} class:checkbox-disabled={disabled}>
<span <span
class:hint--bottom={tooltip !== ''} class="{tooltip === undefined ? '' : `hint--${tooltip.direction ?? 'bottom'} hint--${tooltip.size ?? 'medium'}`}"
class:hint--medium={tooltip !== ''} aria-label={tooltip ? $_(tooltip.lang) : null}
aria-label={$_(tooltip)} >{$_(lang)}</span>
>{ $_(lang) }</span>
<div class="checkbox-mark" on:click={updateCheckbox}> <div class="checkbox-mark" on:click={updateCheckbox}>
<!-- svelte-ignore a11y-missing-attribute --> <!-- svelte-ignore a11y-missing-attribute -->

View file

@ -0,0 +1,49 @@
<script lang="ts">
import { _ } from 'svelte-i18n';
import type { Tooltip } from '../ts/types/Tooltip';
import { Configs } from '../empathize';
export let active: boolean = false;
export let disabled: boolean = false;
export let prop: string = '';
export let lang: string = '';
export let tooltip: Tooltip|undefined = undefined;
export let valueChanged: (value: boolean) => void = () => {};
import Checkmark from '../assets/svgs/checkmark.svg';
Configs.get(prop).then((value) => active = value as boolean);
async function updateCheckbox()
{
active = !active;
if (prop)
await Configs.set(prop, active);
if (valueChanged)
valueChanged(active);
}
</script>
<div class="checkbox" class:checkbox-active={active} class:checkbox-disabled={disabled}>
<div class="checkbox-mark" on:click={updateCheckbox}>
<!-- svelte-ignore a11y-missing-attribute -->
<img src={Checkmark} />
</div>
<span
class="{tooltip === undefined ? '' : `hint--${tooltip.direction ?? 'bottom'} hint--${tooltip.size ?? 'medium'}`}"
aria-label={tooltip ? $_(tooltip.lang) : null}
>{$_(lang)}</span>
</div>
<style lang="sass">
.checkbox-mark
margin-left: 0 !important
margin-right: 16px !important
</style>

View file

@ -222,7 +222,14 @@ export default new Promise<void>(async (resolve) => {
* @default "5d" * @default "5d"
*/ */
launcher: '5d' launcher: '5d'
} },
/**
* Skip analytics window
*
* @default false
*/
skip_analytics: false
}); });
resolve(); resolve();

View file

@ -1,37 +1,57 @@
@use "sass:map"
@import "basic" @import "basic"
body @import "components/button"
padding: 32px 64px @import "components/checkbox"
.header @mixin themable($theme-name, $theme-map)
display: inline-flex body[data-theme=#{$theme-name}]
padding: 32px 64px
img background-color: map.get($theme-map, "background")
width: 96px
height: 96px
margin-right: 32px
.footer color: map.get($theme-map, "text")
position: absolute
bottom: 0 p, span, div
margin-bottom: 32px color: map.get($theme-map, "text")
width: calc(100% - 128px) main
.header
display: inline-flex
> div img
width: 100% width: 96px
height: 96px
margin-right: 32px
div.checkbox .footer
font-size: medium position: absolute
.actions bottom: 0
display: inline-flex margin-bottom: 32px
margin-top: 48px width: calc(100% - 128px)
.actions-right > div
margin-left: auto width: 100%
.button:not(:last-child) div.checkbox
margin-right: 12px font-size: medium
.actions
display: inline-flex
margin-top: 48px
.actions-right
margin-left: auto
.button:not(:last-child)
margin-right: 12px
@import "themes/light"
@import "themes/dark"
@include themable(light, $light)
@include themable(dark, $dark)

View file

@ -329,7 +329,9 @@
<Checkbox <Checkbox
lang="settings.enhancements.wine.items.fsr.title" lang="settings.enhancements.wine.items.fsr.title"
tooltip="settings.enhancements.wine.items.fsr.tooltip" tooltip={{
lang: 'settings.enhancements.wine.items.fsr.tooltip'
}}
prop="wine.fsr" prop="wine.fsr"
disabled={winevdSettings['enabled']} disabled={winevdSettings['enabled']}
/> />
@ -347,19 +349,25 @@
<Checkbox <Checkbox
lang="settings.enhancements.game.items.gamemode.title" lang="settings.enhancements.game.items.gamemode.title"
prop="gamemode" prop="gamemode"
tooltip={gamemode.tooltip} tooltip={{
lang: gamemode.tooltip
}}
disabled={gamemode.disabled} disabled={gamemode.disabled}
/> />
<Checkbox <Checkbox
lang="settings.enhancements.game.items.borderless_window.title" lang="settings.enhancements.game.items.borderless_window.title"
tooltip="settings.enhancements.game.items.borderless_window.tooltip" tooltip={{
lang: 'settings.enhancements.game.items.borderless_window.tooltip'
}}
prop="borderless_window" prop="borderless_window"
/> />
<Checkbox <Checkbox
lang="settings.enhancements.game.items.fps_unlocker.title" lang="settings.enhancements.game.items.fps_unlocker.title"
tooltip="settings.enhancements.game.items.fps_unlocker.tooltip" tooltip={{
lang: 'settings.enhancements.game.items.fps_unlocker.tooltip'
}}
prop="fps_unlocker" prop="fps_unlocker"
disabled={!fpsUnlockerAvailable} disabled={!fpsUnlockerAvailable}
valueChanged={async (checked) => { valueChanged={async (checked) => {
@ -374,7 +382,9 @@
<Checkbox <Checkbox
lang="settings.enhancements.game.items.use_terminal.title" lang="settings.enhancements.game.items.use_terminal.title"
tooltip="settings.enhancements.game.items.use_terminal.tooltip" tooltip={{
lang: 'settings.enhancements.game.items.use_terminal.tooltip'
}}
prop="use_terminal" prop="use_terminal"
/> />
@ -382,7 +392,9 @@
<Checkbox <Checkbox
lang="settings.enhancements.launcher.items.purge_logs.game.title" lang="settings.enhancements.launcher.items.purge_logs.game.title"
tooltip="settings.enhancements.launcher.items.purge_logs.game.tooltip" tooltip={{
lang: 'settings.enhancements.launcher.items.purge_logs.game.tooltip'
}}
prop="purge_logs.game" prop="purge_logs.game"
/> />
@ -406,7 +418,9 @@
<Checkbox <Checkbox
lang="settings.runners.items.recommended.title" lang="settings.runners.items.recommended.title"
tooltip="settings.runners.items.recommended.tooltip" tooltip={{
lang: 'settings.runners.items.recommended.tooltip'
}}
valueChanged={(value) => runnersRecommendable = value} valueChanged={(value) => runnersRecommendable = value}
/> />
@ -418,7 +432,9 @@
<Checkbox <Checkbox
lang="settings.dxvks.items.recommended.title" lang="settings.dxvks.items.recommended.title"
tooltip="settings.dxvks.items.recommended.tooltip" tooltip={{
lang: 'settings.dxvks.items.recommended.tooltip'
}}
valueChanged={(value) => dxvkRecommendable = value} valueChanged={(value) => dxvkRecommendable = value}
/> />

View file

@ -231,7 +231,8 @@ export default class constants
fpsunlock: { fpsunlock: {
unlocker: `https://github.com/34736384/${this.placeholders.lowercase.first}-fps-unlock/releases/download/v1.4.2/unlockfps.exe`, unlocker: `https://github.com/34736384/${this.placeholders.lowercase.first}-fps-unlock/releases/download/v1.4.2/unlockfps.exe`,
bat: 'https://dev.kaifa.ch/Maroxy/an-anime-game-aur/raw/branch/fpsunlock/fpsunlock.bat' bat: 'https://dev.kaifa.ch/Maroxy/an-anime-game-aur/raw/branch/fpsunlock/fpsunlock.bat'
} },
analytics: 'https://aagl.launcher.moe/stat/'
}; };
// TODO: cache drops at that dates instead of the 7 days period // TODO: cache drops at that dates instead of the 7 days period

View file

@ -107,7 +107,6 @@ export default class State
title: 'ToS violation warning', title: 'ToS violation warning',
width: 700, width: 700,
height: 500, height: 500,
alwaysOnTop: true,
exitProcessOnClose: false exitProcessOnClose: false
}); });
@ -140,6 +139,46 @@ export default class State
}); });
} }
// If there's analytics window waits for its time
else if (await fs.exists(path.join(await constants.paths.launcherDir, '.analytics')))
{
Windows.open('analytics', {
title: Locales.translate('analytics.title') as string,
width: 700,
height: 460,
exitProcessOnClose: false
});
await new Promise<void>((resolve) => {
const analyticsWaiter = async () => {
let closed = false;
for (const record of await IPC.read())
if (record.data == 'analytics-close')
{
closed = true;
record.pop();
break;
}
if (closed)
resolve();
else
{
if (await fs.exists(path.join(await constants.paths.launcherDir, '.analytics')))
setTimeout(analyticsWaiter, 1000);
else resolve();
}
};
setTimeout(analyticsWaiter, 1000);
});
}
// Show launcher's window // Show launcher's window
await Windows.current.show(); await Windows.current.show();
await Windows.current.center(1280, 700); await Windows.current.center(1280, 700);

View file

@ -1,10 +1,13 @@
import type Launcher from '../../Launcher'; import type Launcher from '../../Launcher';
import { promisify, Configs } from '../../../empathize';
import Game from '../../Game'; import Game from '../../Game';
import Prefix from '../../core/Prefix'; import Prefix from '../../core/Prefix';
import constants from '../../Constants'; import constants from '../../Constants';
import Locales from '../Locales'; import Locales from '../Locales';
import { promisify } from '@empathize/framework';
declare const Neutralino;
export default (launcher: Launcher): Promise<void> => { export default (launcher: Launcher): Promise<void> => {
return new Promise(async (resolve) => { return new Promise(async (resolve) => {
@ -103,6 +106,9 @@ export default (launcher: Launcher): Promise<void> => {
] ]
}); });
if (!await Configs.get('skip_analytics'))
await Neutralino.filesystem.writeFile(`${await constants.paths.launcherDir}/.analytics`, '');
// Download voice package when the game itself has been installed // Download voice package when the game itself has been installed
import('./InstallVoice').then((module) => { import('./InstallVoice').then((module) => {
module.default(launcher).then(() => resolve()); module.default(launcher).then(() => resolve());