From 07b32adaae328296156b4506a4f5d13461c4d221 Mon Sep 17 00:00:00 2001 From: Observer KRypt0n_ Date: Sat, 5 Mar 2022 23:51:36 +0200 Subject: [PATCH] Added Patch section to the settings menu - removed excess sass styles - added `Patch.revert()` method --- public/locales/de-de.yaml | 11 +++++ public/locales/en-us.yaml | 11 +++++ public/locales/es-es.yaml | 11 +++++ public/locales/fr-fr.yaml | 11 +++++ public/locales/hu-hu.yaml | 11 +++++ public/locales/id-id.yaml | 11 +++++ public/locales/it-it.yaml | 11 +++++ public/locales/ja-jp.yaml | 11 +++++ public/locales/nb-no.yaml | 11 +++++ public/locales/ru-ru.yaml | 11 +++++ public/locales/uwu.yaml | 11 +++++ public/locales/zh-cn.yaml | 11 +++++ src/sass/settings.sass | 51 ++++++------------------ src/settings.svelte | 84 +++++++++++++++++++++++++++++++++++++-- src/ts/Launcher.ts | 4 +- src/ts/Patch.ts | 22 ++++++++++ 16 files changed, 249 insertions(+), 44 deletions(-) diff --git a/public/locales/de-de.yaml b/public/locales/de-de.yaml index 8fe9b02..5d91eef 100644 --- a/public/locales/de-de.yaml +++ b/public/locales/de-de.yaml @@ -274,6 +274,17 @@ settings: add: Hinzufügen delete: Löschen + # Patch-related settings + patch: + title: Patch + items: + patch_version: 'Patch version:' + updating_info: 'Updating patch info...' + buttons: + revert_patch: revert patch + apply_patch: apply patch + reapply_patch: re-apply patch + # Notifications notifications: # Launcher update diff --git a/public/locales/en-us.yaml b/public/locales/en-us.yaml index 6aac73b..b60e560 100644 --- a/public/locales/en-us.yaml +++ b/public/locales/en-us.yaml @@ -273,6 +273,17 @@ settings: add: Add delete: Delete + # Patch-related settings + patch: + title: Patch + items: + patch_version: 'Patch version:' + updating_info: 'Updating patch info...' + buttons: + revert_patch: revert patch + apply_patch: apply patch + reapply_patch: re-apply patch + # Notifications notifications: # Launcher update diff --git a/public/locales/es-es.yaml b/public/locales/es-es.yaml index 1f0842e..245c705 100644 --- a/public/locales/es-es.yaml +++ b/public/locales/es-es.yaml @@ -272,6 +272,17 @@ settings: add: Añadir delete: Borrar + # Patch-related settings + patch: + title: Patch + items: + patch_version: 'Patch version:' + updating_info: 'Updating patch info...' + buttons: + revert_patch: revert patch + apply_patch: apply patch + reapply_patch: re-apply patch + # Notifications notifications: # Actualización del Launcher diff --git a/public/locales/fr-fr.yaml b/public/locales/fr-fr.yaml index 195743e..5abb3f7 100644 --- a/public/locales/fr-fr.yaml +++ b/public/locales/fr-fr.yaml @@ -283,6 +283,17 @@ settings: add: Ajouter delete: Supprimer + # Patch-related settings + patch: + title: Patch + items: + patch_version: 'Patch version:' + updating_info: 'Updating patch info...' + buttons: + revert_patch: revert patch + apply_patch: apply patch + reapply_patch: re-apply patch + # Notifications notifications: # Launcher update diff --git a/public/locales/hu-hu.yaml b/public/locales/hu-hu.yaml index 2a57c41..3886260 100644 --- a/public/locales/hu-hu.yaml +++ b/public/locales/hu-hu.yaml @@ -273,6 +273,17 @@ settings: add: Hozzáadás delete: Törlés + # Patch-related settings + patch: + title: Patch + items: + patch_version: 'Patch version:' + updating_info: 'Updating patch info...' + buttons: + revert_patch: revert patch + apply_patch: apply patch + reapply_patch: re-apply patch + # Notifications notifications: # Launcher update diff --git a/public/locales/id-id.yaml b/public/locales/id-id.yaml index 0f9d4c4..2bf27eb 100644 --- a/public/locales/id-id.yaml +++ b/public/locales/id-id.yaml @@ -273,6 +273,17 @@ settings: add: Tambah delete: Hapus + # Patch-related settings + patch: + title: Patch + items: + patch_version: 'Patch version:' + updating_info: 'Updating patch info...' + buttons: + revert_patch: revert patch + apply_patch: apply patch + reapply_patch: re-apply patch + # Notifications notifications: # Launcher update diff --git a/public/locales/it-it.yaml b/public/locales/it-it.yaml index f796c30..e29c00c 100644 --- a/public/locales/it-it.yaml +++ b/public/locales/it-it.yaml @@ -271,6 +271,17 @@ settings: add: Aggiungi delete: Rimuovi + # Patch-related settings + patch: + title: Patch + items: + patch_version: 'Patch version:' + updating_info: 'Updating patch info...' + buttons: + revert_patch: revert patch + apply_patch: apply patch + reapply_patch: re-apply patch + # Notifications notifications: # Launcher update diff --git a/public/locales/ja-jp.yaml b/public/locales/ja-jp.yaml index fa002f8..d52ca97 100644 --- a/public/locales/ja-jp.yaml +++ b/public/locales/ja-jp.yaml @@ -273,6 +273,17 @@ settings: add: 追加 delete: 削除 + # Patch-related settings + patch: + title: Patch + items: + patch_version: 'Patch version:' + updating_info: 'Updating patch info...' + buttons: + revert_patch: revert patch + apply_patch: apply patch + reapply_patch: re-apply patch + # Notifications notifications: # Launcher update diff --git a/public/locales/nb-no.yaml b/public/locales/nb-no.yaml index d89ccf3..5e8f64b 100644 --- a/public/locales/nb-no.yaml +++ b/public/locales/nb-no.yaml @@ -273,6 +273,17 @@ settings: add: Legg til delete: Fjern + # Patch-related settings + patch: + title: Patch + items: + patch_version: 'Patch version:' + updating_info: 'Updating patch info...' + buttons: + revert_patch: revert patch + apply_patch: apply patch + reapply_patch: re-apply patch + # Notifications notifications: # Launcher update diff --git a/public/locales/ru-ru.yaml b/public/locales/ru-ru.yaml index b8d6062..8bc950d 100644 --- a/public/locales/ru-ru.yaml +++ b/public/locales/ru-ru.yaml @@ -272,6 +272,17 @@ settings: add: Добавить delete: Удалить + # Настроки патча + patch: + title: Патч + items: + patch_version: 'Версия патча:' + updating_info: 'Обновление информации о патче...' + buttons: + revert_patch: отменить патч + apply_patch: применить патч + reapply_patch: переприменить патч + # Уведомления notifications: # Обновление лаунчера diff --git a/public/locales/uwu.yaml b/public/locales/uwu.yaml index 57fceed..6cd65cb 100644 --- a/public/locales/uwu.yaml +++ b/public/locales/uwu.yaml @@ -272,6 +272,17 @@ settings: add: add delete: dewete + # Patch-related settings + patch: + title: Patch + items: + patch_version: 'Patch version:' + updating_info: 'Updating patch info...' + buttons: + revert_patch: revert patch + apply_patch: apply patch + reapply_patch: re-apply patch + # Notifications notifications: # Launcher update diff --git a/public/locales/zh-cn.yaml b/public/locales/zh-cn.yaml index 43a7237..9b93e38 100644 --- a/public/locales/zh-cn.yaml +++ b/public/locales/zh-cn.yaml @@ -273,6 +273,17 @@ settings: add: 添加 delete: 删除 + # Patch-related settings + patch: + title: Patch + items: + patch_version: 'Patch version:' + updating_info: 'Updating patch info...' + buttons: + revert_patch: revert patch + apply_patch: apply patch + reapply_patch: re-apply patch + # Notifications notifications: # Launcher update diff --git a/src/sass/settings.sass b/src/sass/settings.sass index 2a87ce4..4e7b07e 100644 --- a/src/sass/settings.sass +++ b/src/sass/settings.sass @@ -89,6 +89,18 @@ &:hover background: #e5e9f0 + .settings-item#patch + .patch-version + font-size: 18px + + span + margin-left: 8px + + color: map.get($theme-map, "primary") + + span.warning + color: #d82148 + .settings-footer margin: 24px 0 @@ -104,45 +116,6 @@ color: map.get($theme-map, "primary") - .launcher-stats - display: inline-flex - margin-bottom: 16px - - > img - width: 96px - height: 96px - - .level - position: absolute - width: 96px - top: 105px - - text-align: center - font-size: 20px - color: #71b71b - - .stats - margin-left: 32px - align-self: center - - > p - font-size: 20px - font-weight: 600 - margin: 0 - - .time-spent - font-size: 18px - margin: 8px 0 16px 0 - - .badges - margin-bottom: 16px - - img - width: 24px - height: 24px - - margin-right: 4px - @import "themes/light" @import "themes/dark" diff --git a/src/settings.svelte b/src/settings.svelte index b3dcec2..69e6a6d 100644 --- a/src/settings.svelte +++ b/src/settings.svelte @@ -12,6 +12,9 @@ import Launcher from './ts/Launcher'; import FPSUnlock from './ts/FPSUnlock'; import Runners from './ts/core/Runners'; + import Patch from './ts/Patch'; + + import type { PatchInfo } from './ts/types/Patch'; import Button from './components/Button.svelte'; import Checkbox from './components/Checkbox.svelte'; @@ -115,7 +118,14 @@ gamemode.tooltip = 'settings.enhancements.game.items.gamemode.tooltip.disabled'; }); - let borderless_active = Configs.get('borderless_window').then((val) => borderless_active = val); + let borderless_active = Configs.get('borderless_window').then((value) => borderless_active = value); + + /** + * Patch info + */ + let patchInfo: PatchInfo|null = null; + + Patch.latest.then((value) => patchInfo = value); /** * Menu items changing @@ -185,7 +195,7 @@ }); if (voiceUpdateRequired) - await IPC.write('voice-update-required'); + await IPC.write('update-state'); Neutralino.app.exit(); }); @@ -194,7 +204,7 @@ {#if typeof $locale === 'string'}