Several changes

- Discord RPC icons were moved to `src/assets/images/discord` folder
  and highly optimized
- added templates for `fr-fr`, `es-es` and `vi-vn` translations
- added Discord RPC icons selection
- added windows centering;
  also added `Window.current.center()` method
This commit is contained in:
Observer KRypt0n_ 2022-01-06 15:03:59 +02:00
parent c404cc486e
commit 4c5d08ba13
No known key found for this signature in database
GPG key ID: DC5D4EC1303465DA
31 changed files with 487 additions and 12 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 519 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 468 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 511 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 121 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 627 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 983 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 510 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 KiB

View file

@ -25,6 +25,9 @@ settings:
en-us: Englisch (US)
ru-ru: Russisch
de-de: Deutsch
fr-fr: Français
es-es: Español
vi-vn: Tiếng Việt
# Spiel sprachpaket auswahl
voice:
@ -53,6 +56,7 @@ settings:
timer: Display spent time
in-launcher: In-launcher text
in-game: In-game text
selectIcon: Select icon
# Verberssungen
enhancements:

View file

@ -25,6 +25,9 @@ settings:
en-us: English (US)
ru-ru: Русский
de-de: Deutsch
fr-fr: Français
es-es: Español
vi-vn: Tiếng Việt
# Game voice pack language
voice:
@ -53,6 +56,7 @@ settings:
timer: Display spent time
in-launcher: In-launcher text
in-game: In-game text
selectIcon: Select icon
# Enhancements
enhancements:

114
public/locales/es-es.yaml Normal file
View file

@ -0,0 +1,114 @@
# Splash window
splash:
title: Loading launcher
phrases:
- Doing some important stuff...
- Bullying Paimon...
- Pulling for Yae...
# Launcher window
launcher:
predownload: Pre-download update
# Settings window
settings:
# General
general:
title: General
items:
# Language selection
lang:
# Launcher language
launcher:
title: Launcher
items:
en-us: English (US)
ru-ru: Русский
de-de: Deutsch
fr-fr: Français
es-es: Español
vi-vn: Tiếng Việt
# Game voice pack language
voice:
title: Voice pack
tooltip: You will have to manually select the new voice pack in the game
items:
en-us: English (US)
ja-jp: Japanese
ko-kr: Korean
zn-cn: Chinese
# Launcher theme
theme:
title: Theme
items:
system: System
light: Light
dark: Dark
# Discord RPC
discord:
title: Discord RPC
settings:
title: Discord RPC settings
items:
timer: Display spent time
in-launcher: In-launcher text
in-game: In-game text
selectIcon: Select icon
# Enhancements
enhancements:
title: Enhancements
items:
# HUD
hud:
title: HUD
items:
none: None
dxvk: DXVK
mangohud: MangoHUD
# GameMode
gamemode:
title: Use GameMode
tooltip: It is a software that can improve the game performance
# Unlock FPS
fps_unlocker:
title: Unlock FPS
tooltip: This option will unlock maximum of the 60 fps limitation
# Delete DXVK logs
purge_dxvk_logs:
title: Delete DXVK logs
tooltip: With this option enabled your launcher will automatically
delete DXVK log files
# Runners
runners:
title: Wine version
items:
recommended:
title: Show recommended only
tooltip: This option will hide unplayable wine versions
# DXVKs
dxvks:
title: DXVK
items:
recommended:
title: Show recommended only
tooltip: This option will hide old DXVK versions
# Shaders
shaders:
title: Shaders
items:
shaders:
title: Shaders
tooltip: Use Home button to toggle shaders in the game
items:
none: None
custom: Custom

114
public/locales/fr-fr.yaml Normal file
View file

@ -0,0 +1,114 @@
# Splash window
splash:
title: Loading launcher
phrases:
- Doing some important stuff...
- Bullying Paimon...
- Pulling for Yae...
# Launcher window
launcher:
predownload: Pre-download update
# Settings window
settings:
# General
general:
title: General
items:
# Language selection
lang:
# Launcher language
launcher:
title: Launcher
items:
en-us: English (US)
ru-ru: Русский
de-de: Deutsch
fr-fr: Français
es-es: Español
vi-vn: Tiếng Việt
# Game voice pack language
voice:
title: Voice pack
tooltip: You will have to manually select the new voice pack in the game
items:
en-us: English (US)
ja-jp: Japanese
ko-kr: Korean
zn-cn: Chinese
# Launcher theme
theme:
title: Theme
items:
system: System
light: Light
dark: Dark
# Discord RPC
discord:
title: Discord RPC
settings:
title: Discord RPC settings
items:
timer: Display spent time
in-launcher: In-launcher text
in-game: In-game text
selectIcon: Select icon
# Enhancements
enhancements:
title: Enhancements
items:
# HUD
hud:
title: HUD
items:
none: None
dxvk: DXVK
mangohud: MangoHUD
# GameMode
gamemode:
title: Use GameMode
tooltip: It is a software that can improve the game performance
# Unlock FPS
fps_unlocker:
title: Unlock FPS
tooltip: This option will unlock maximum of the 60 fps limitation
# Delete DXVK logs
purge_dxvk_logs:
title: Delete DXVK logs
tooltip: With this option enabled your launcher will automatically
delete DXVK log files
# Runners
runners:
title: Wine version
items:
recommended:
title: Show recommended only
tooltip: This option will hide unplayable wine versions
# DXVKs
dxvks:
title: DXVK
items:
recommended:
title: Show recommended only
tooltip: This option will hide old DXVK versions
# Shaders
shaders:
title: Shaders
items:
shaders:
title: Shaders
tooltip: Use Home button to toggle shaders in the game
items:
none: None
custom: Custom

View file

@ -25,6 +25,9 @@ settings:
en-us: English (US)
ru-ru: Русский
de-de: Deutsch
fr-fr: Français
es-es: Español
vi-vn: Tiếng Việt
# Язык озвучки в игре
voice:
@ -53,6 +56,7 @@ settings:
timer: Отображать потраченное время
in-launcher: Текст в лаунчере
in-game: Текст в игре
selectIcon: Выберите иконку
# Улучшения
enhancements:

114
public/locales/vi-vn.yaml Normal file
View file

@ -0,0 +1,114 @@
# Splash window
splash:
title: Loading launcher
phrases:
- Doing some important stuff...
- Bullying Paimon...
- Pulling for Yae...
# Launcher window
launcher:
predownload: Pre-download update
# Settings window
settings:
# General
general:
title: General
items:
# Language selection
lang:
# Launcher language
launcher:
title: Launcher
items:
en-us: English (US)
ru-ru: Русский
de-de: Deutsch
fr-fr: Français
es-es: Español
vi-vn: Tiếng Việt
# Game voice pack language
voice:
title: Voice pack
tooltip: You will have to manually select the new voice pack in the game
items:
en-us: English (US)
ja-jp: Japanese
ko-kr: Korean
zn-cn: Chinese
# Launcher theme
theme:
title: Theme
items:
system: System
light: Light
dark: Dark
# Discord RPC
discord:
title: Discord RPC
settings:
title: Discord RPC settings
items:
timer: Display spent time
in-launcher: In-launcher text
in-game: In-game text
selectIcon: Select icon
# Enhancements
enhancements:
title: Enhancements
items:
# HUD
hud:
title: HUD
items:
none: None
dxvk: DXVK
mangohud: MangoHUD
# GameMode
gamemode:
title: Use GameMode
tooltip: It is a software that can improve the game performance
# Unlock FPS
fps_unlocker:
title: Unlock FPS
tooltip: This option will unlock maximum of the 60 fps limitation
# Delete DXVK logs
purge_dxvk_logs:
title: Delete DXVK logs
tooltip: With this option enabled your launcher will automatically
delete DXVK log files
# Runners
runners:
title: Wine version
items:
recommended:
title: Show recommended only
tooltip: This option will hide unplayable wine versions
# DXVKs
dxvks:
title: DXVK
items:
recommended:
title: Show recommended only
tooltip: This option will hide old DXVK versions
# Shaders
shaders:
title: Shaders
items:
shaders:
title: Shaders
tooltip: Use Home button to toggle shaders in the game
items:
none: None
custom: Custom

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

View file

@ -4,26 +4,69 @@
import Configs from '../ts/Configs';
export let visible: boolean = false;
export let valueChanged: (field: 'in-game' | 'in-launcher', value: string) => void = () => {};
export let iconChanged: (field: 'in-game' | 'in-launcher', icon: string) => void = () => {};
import Checkbox from './Checkbox.svelte';
// Discord RPC icons imports
// It's better to do it manually so Vite
// will be able to pack them automatically
import LauncherIcon from '../../public/icons/256x256.png';
import GameOriginalIcon from '../assets/images/discord/gi-icon.jpg';
import GameIcon from '../assets/images/discord/game.jpg';
import ArtGameIcon from '../assets/images/discord/artgame.jpg';
import ArtGame2Icon from '../assets/images/discord/artgame2.jpg';
import ArtGame3Icon from '../assets/images/discord/artgame3.jpg';
import BeidouGameIcon from '../assets/images/discord/beidougame.jpg';
import KleeGameIcon from '../assets/images/discord/kleegame.jpg';
import KleeGame2Icon from '../assets/images/discord/kleegame2.jpg';
import LiyueGameIcon from '../assets/images/discord/liyuegame.jpg';
const icons = {
'launcher': LauncherIcon,
'gi-icon': GameOriginalIcon,
'game': GameIcon,
'artgame': ArtGameIcon,
'artgame2': ArtGame2Icon,
'artgame3': ArtGame3Icon,
'beidougame': BeidouGameIcon,
'kleegame': KleeGameIcon,
'kleegame2': KleeGame2Icon,
'liyuegame': LiyueGameIcon
};
let iconSelector: 'in-game'|'in-launcher'|null = null;
let states = {
'in-game': '',
'in-launcher': ''
'in-game': {
text: '',
icon: 'game'
},
'in-launcher': {
text: '',
icon: 'launcher'
}
};
Configs.get('discord.states').then((settings) => {
states = {
'in-game': settings!['in-game']['details'],
'in-launcher': settings!['in-launcher']['details']
'in-game': {
text: settings!['in-game']['details'],
icon: settings!['in-game']['icon']
},
'in-launcher': {
text: settings!['in-launcher']['details'],
icon: settings!['in-launcher']['icon']
}
};
if (settings!['in-game']['state'] != '')
states['in-game'] += `\n${settings!['in-game']['state']}`;
states['in-game']['text'] += `\n${settings!['in-game']['state']}`;
if (settings!['in-launcher']['state'] != '')
states['in-launcher'] += `\n${settings!['in-launcher']['state']}`;
states['in-launcher']['text'] += `\n${settings!['in-launcher']['state']}`;
});
const textareaHandler = (event: KeyboardEvent, field: 'in-game' | 'in-launcher') => {
@ -38,6 +81,14 @@
else valueChanged(field, content.trim());
};
const selectIcon = (icon: string) => {
states[iconSelector!]['icon'] = icon;
iconChanged(iconSelector!, icon);
iconSelector = null;
};
</script>
<div style="display: {visible ? 'block' : 'none'}">
@ -52,7 +103,9 @@
</td>
<td>
<textarea rows="2" on:keyup={(e) => textareaHandler(e, 'in-launcher')}>{states['in-launcher']}</textarea>
<textarea rows="2" on:keyup={(e) => textareaHandler(e, 'in-launcher')}>{states['in-launcher']['text']}</textarea>
<img src={icons[states['in-launcher']['icon']]} alt="" on:click={() => iconSelector = iconSelector ? null : 'in-launcher'} />
</td>
</tr>
<tr>
@ -61,8 +114,54 @@
</td>
<td>
<textarea rows="2" on:keyup={(e) => textareaHandler(e, 'in-game')}>{states['in-game']}</textarea>
<textarea rows="2" on:keyup={(e) => textareaHandler(e, 'in-game')}>{states['in-game']['text']}</textarea>
<img src={icons[states['in-game']['icon']]} alt="" on:click={() => iconSelector = iconSelector ? null : 'in-game'} />
</td>
</tr>
</table>
<div class="icon-selection" style="display: {iconSelector ? 'block' : 'none'}">
<h4>{$_('settings.general.items.discord.settings.items.selectIcon')}</h4>
<div>
{#each Object.keys(icons) as icon}
<img src={icons[icon]} alt="" on:click={() => selectIcon(icon)} />
{/each}
</div>
</div>
</div>
<style lang="sass">
.icon-selection
div
display: inline-flex
width: 100%
img
width: 48px
height: 48px
border-radius: 24px
margin: 0 auto
cursor: pointer
&:hover
box-shadow: 0px 0px 12px 0px rgba(0, 0, 0, 0.45)
table.table
td:last-child
display: inline-flex
align-items: center
width: 100%
img
width: 40px
height: 40px
border-radius: 20px
</style>

View file

@ -5,6 +5,9 @@ import Locales from './ts/core/Locales';
register('en-us', () => Locales.get('en-us'));
register('ru-ru', () => Locales.get('ru-ru'));
register('de-de', () => Locales.get('de-de'));
register('fr-fr', () => Locales.get('fr-fr'));
register('es-es', () => Locales.get('es-es'));
register('vi-vn', () => Locales.get('vi-vn'));
Locales.default().then((locale) => {
init({

View file

@ -87,7 +87,7 @@
Configs.get('discord').then((settings) => discordSettings = settings as object);
const handleDiscordRpc = (field: 'in-game' | 'in-launcher', value: string) => {
const handleDiscordRpcText = (field: 'in-game' | 'in-launcher', value: string) => {
const lines = value.split(/\r\n|\r|\n/).filter((line) => line != '');
discordSettings['states'][field]['details'] = lines[0];
@ -111,6 +111,12 @@
}
};
const handleDiscordRpcIcon = (field: 'in-game' | 'in-launcher', icon: string) => {
discordSettings['states'][field]['icon'] = icon;
Configs.set('discord', discordSettings);
};
/**
* Menu items changing
*/
@ -151,6 +157,7 @@
// Do some stuff when all the content will be loaded
onMount(() => {
Window.current.show();
Window.current.center(900, 600);
});
Neutralino.events.on('windowClose', async () => {
@ -207,7 +214,7 @@
valueChanged={(value) => discordSettings['enabled'] = value}
/>
<DiscordSettings visible={discordSettings['enabled']} valueChanged={handleDiscordRpc} />
<DiscordSettings visible={discordSettings['enabled']} valueChanged={handleDiscordRpcText} iconChanged={handleDiscordRpcIcon} />
</div>
<div class="settings-item" id="enhancements">

View file

@ -20,6 +20,7 @@
onMount(() => {
Window.current.show();
Window.current.center(300, 400);
});
const isLauncherLoaded = () => {

View file

@ -68,6 +68,7 @@ export default class Launcher
});
Window.current.show();
Window.current.center(1280, 700);
})
Window.current.hide();

View file

@ -7,7 +7,10 @@ import Configs from '../Configs';
type AvailableLocales =
| 'en-us'
| 'ru-ru'
| 'de-de';
| 'de-de'
| 'fr-fr'
| 'es-es'
| 'vi-vn';
declare const Neutralino;

View file

@ -38,7 +38,14 @@ class Window
{
public static get current(): any
{
return Neutralino.window;
return {
...Neutralino.window,
center(windowWidth: number, windowHeight: number)
{
Neutralino.window.move((window.screen.width - windowWidth) / 2, (window.screen.height - windowHeight) / 2);
}
};
}
public static open(name: string, options: WindowOptions = {}): Promise<WindowOpenResult>