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>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>Statistics window</s>
* Add Chinese game's version support (due to changes in the Krock's patch)
* Implement manual config flushing functionality from the Empathize's API
* Add analytics window
* Dark progress bar design
* Statistics window
* Changelog window
* Screenshots explorer
* Add Patch category in settings menu with

View file

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

View file

@ -11,7 +11,7 @@
"check": "svelte-check --tsconfig ./tsconfig.json"
},
"dependencies": {
"@empathize/framework": "^1.4.6",
"@empathize/framework": "^1.4.8",
"js-md5": "^0.7.3",
"semver": "^7.3.5",
"svelte-i18n": "^3.3.13",

View file

@ -322,4 +322,23 @@ tos_violation:
title: Ich verstehe das Risiko
tooltip: Sie sollten diesen Text wirklich lesen, Er ist sehr wichtig.
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

@ -322,4 +322,22 @@ tos_violation:
title: I understand the risk
tooltip: You really should read this text above. It's important
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

@ -320,4 +320,22 @@ tos_violation:
title: Sí, entiendo el riesgo
tooltip: Realmente deberías leer el texto de arriba. Es importante.
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:
downloading: Téléchargement du jeu...
unpacking: Décompression du jeu...
applying_changes: Applying changes...
applying_changes: Application des changements...
deleting_outdated: Suppression des fichiers non à jour...
# Voice packages installation
@ -42,12 +42,14 @@ launcher:
update: Mise à jour
apply_changes:
title: Apply changes
hint: Apply hdiff changes to the game files
# There you may want to do it with a line break "Appliquer" may look better ?
title: Appliquer les changements
hint: Appliquer le patch hdiff sur les fichiers du jeu
remove_outdated:
title: Remove outdated
hint: Remove outdated game files
# 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.
title: Supprimer les obsolètes
hint: Supprimer les fichiers du jeu qui sont devenus obsolètes
# When the game should be patched
patching:
@ -310,8 +312,8 @@ notifications:
# HDiffPatch couldn't successfully apply game files changes
game_changes_applying_error:
title: An error occurred during game updating
body: '{files} files couldn''t be updated by the hdiff patch'
title: Une erreur a été détectée pendant la mise à jour du jeu
body: '{files} fichiers n''ont pas pu être mise à jour avec le patch hdiff'
# ToS violation warning window
tos_violation:
@ -330,4 +332,23 @@ tos_violation:
title: Je comprends les risques
tooltip: Vous devriez réellement lire le texte ci-dessus, c'est important.
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:
downloading: Játék letöltése 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...
# Voice packages installation
@ -42,12 +42,12 @@ launcher:
update: Frissítés
apply_changes:
title: Apply changes
hint: Apply hdiff changes to the game files
title: Változások alkalmazása
hint: Hdiff változások alkalmazása a játékfájlokra
remove_outdated:
title: Remove outdated
hint: Remove outdated game files
title: Elavultak törlése
hint: Elavult játékfájlok törlése
# When the game should be patched
patching:
@ -302,8 +302,8 @@ notifications:
# HDiffPatch couldn't successfully apply game files changes
game_changes_applying_error:
title: An error occurred during game updating
body: '{files} files couldn''t be updated by the hdiff patch'
title: Hiba történt a játék frissítése közben
body: '{files} fájlt nem lehetett frissíteni a hdiff patch-el'
# ToS violation warning window
tos_violation:
@ -322,4 +322,22 @@ tos_violation:
title: Megértem
tooltip: A fenti szöveget ajánlott elolvasnod. Tényleg fontos.
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

@ -322,4 +322,22 @@ tos_violation:
title: Saya mengerti risikonya
tooltip: Kamu harus benar benar membaca teks diatas. Sangat Penting
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
cancel: Annulla
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

@ -322,4 +322,22 @@ tos_violation:
title: Jeg forstår risikoen
tooltip: Du burde virkelig lese teksten over. Det er viktig
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

@ -321,4 +321,23 @@ tos_violation:
title: Я осознаю риск
tooltip: Вы действительно должны прочитать этот текст сверху. Это важно
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

@ -321,4 +321,22 @@ tos_violation:
title: I understand the risk
tooltip: You really should read this text above. It's important
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 { _, 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(() => {
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();
});
@ -28,6 +45,56 @@
{#if typeof $locale === 'string'}
<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>
{/if}

View file

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

View file

@ -1,37 +1,57 @@
@use "sass:map"
@import "basic"
body
padding: 32px 64px
@import "components/button"
@import "components/checkbox"
.header
display: inline-flex
@mixin themable($theme-name, $theme-map)
body[data-theme=#{$theme-name}]
padding: 32px 64px
img
width: 96px
height: 96px
margin-right: 32px
background-color: map.get($theme-map, "background")
.footer
position: absolute
color: map.get($theme-map, "text")
bottom: 0
margin-bottom: 32px
p, span, div
color: map.get($theme-map, "text")
width: calc(100% - 128px)
main
.header
display: inline-flex
> div
width: 100%
img
width: 96px
height: 96px
margin-right: 32px
div.checkbox
font-size: medium
.footer
position: absolute
.actions
display: inline-flex
bottom: 0
margin-bottom: 32px
margin-top: 48px
width: calc(100% - 128px)
.actions-right
margin-left: auto
> div
width: 100%
.button:not(:last-child)
margin-right: 12px
div.checkbox
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
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"
disabled={winevdSettings['enabled']}
/>
@ -347,19 +349,25 @@
<Checkbox
lang="settings.enhancements.game.items.gamemode.title"
prop="gamemode"
tooltip={gamemode.tooltip}
tooltip={{
lang: gamemode.tooltip
}}
disabled={gamemode.disabled}
/>
<Checkbox
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"
/>
<Checkbox
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"
disabled={!fpsUnlockerAvailable}
valueChanged={async (checked) => {
@ -374,7 +382,9 @@
<Checkbox
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"
/>
@ -382,7 +392,9 @@
<Checkbox
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"
/>
@ -406,7 +418,9 @@
<Checkbox
lang="settings.runners.items.recommended.title"
tooltip="settings.runners.items.recommended.tooltip"
tooltip={{
lang: 'settings.runners.items.recommended.tooltip'
}}
valueChanged={(value) => runnersRecommendable = value}
/>
@ -418,7 +432,9 @@
<Checkbox
lang="settings.dxvks.items.recommended.title"
tooltip="settings.dxvks.items.recommended.tooltip"
tooltip={{
lang: 'settings.dxvks.items.recommended.tooltip'
}}
valueChanged={(value) => dxvkRecommendable = value}
/>

View file

@ -231,7 +231,8 @@ export default class constants
fpsunlock: {
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'
}
},
analytics: 'https://aagl.launcher.moe/stat/'
};
// 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',
width: 700,
height: 500,
alwaysOnTop: true,
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
await Windows.current.show();
await Windows.current.center(1280, 700);

View file

@ -1,10 +1,13 @@
import type Launcher from '../../Launcher';
import { promisify, Configs } from '../../../empathize';
import Game from '../../Game';
import Prefix from '../../core/Prefix';
import constants from '../../Constants';
import Locales from '../Locales';
import { promisify } from '@empathize/framework';
declare const Neutralino;
export default (launcher: Launcher): Promise<void> => {
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
import('./InstallVoice').then((module) => {
module.default(launcher).then(() => resolve());