2.0.0-rc1

- updated locales
- made `Launcher.isPackageAvailable()` method to check if some package installed
- added GameMode and shaders packages existance checking

From previous commits:
- added 8 new discord rpc icons
- updated way `DiscordSettings` handles RPC icons
- fixed windows sizing on wayland
- updated dependencies
- added proper shaders menu section
- made `Locales.bind()` method to bind some callback to locale changing event
- with change above, made proper translations for button on the main window
- added UWU (Cursed) Language (by Marie)
- removed vi-vn and es-es locales because no one translate it
- added 6 new splash screen messages
- encoded file names for discord rpc icons
- fixed old launcher logs deletion
- added environmental variables manager
- fixed `Domain.getInfo()` method work in some specific cases(?)
- added `Launcher.version` field that represents... current launcher version
- made `Git` class to work with git repositories;
  made `Git.getTags()` method to list remove repository tags
- added outdated launcher version notification
- now by default config file's `env` field contains `{ WINEESYNC: 1 }`
  so now ESync enabled by default
- added `fsr` field to config file;
  added checkbox to the settings menu
  if this option enabled, launcher will run the game with `WINE_FULLSCREEN_FSR: 1`
  and `WINE_FULLSCREEN_FSR_STRENGTH: 3`
  environmental variables
This commit is contained in:
Observer KRypt0n_ 2022-01-10 20:57:30 +02:00
parent 6b60d6326e
commit 213e418ee8
No known key found for this signature in database
GPG key ID: DC5D4EC1303465DA
10 changed files with 135 additions and 40 deletions

View file

@ -119,12 +119,15 @@ settings:
# GameMode
gamemode:
title: Benutze GameMode
tooltip: GameMode ist ein Program welches die Leistung verbessert
tooltip:
enabled: GameMode ist ein Program welches die Leistung verbessert
disabled: ⚠️ Sie haben GameMode nicht installiert
# AMD FSR
fsr:
title: AMD FSR
tooltip: Diese Option aktiviert AMD FidelityFX Super Resolution (FSR), womit kleine Resolution hochskaliert wird um FPS-verlust zu vermeiden.
tooltip: Diese Option aktiviert AMD FidelityFX Super Resolution (FSR),
womit kleine Resolution hochskaliert wird um FPS-verlust zu vermeiden.
# Unlock FPS
fps_unlocker:
@ -181,6 +184,7 @@ settings:
author: 'Autor: {author}'
no_images: Keine Bilder verfügbar
not_installed: Sie haben vkBasalt und Reshade-Shader nicht installiert
# Environmantal variables manager
environment:

View file

@ -119,12 +119,15 @@ settings:
# GameMode
gamemode:
title: Use GameMode
tooltip: It is a software that can improve the game performance
tooltip:
enabled: It is a software that can improve the game performance
disabled: ⚠️ You don't have gamemode package installed
# AMD FSR
fsr:
title: Enable AMD FSR
tooltip: This option enables AMD FidelityFX Super Resolution (FSR) which will scale your game resolution without losing FPS
tooltip: This option enables AMD FidelityFX Super Resolution (FSR)
which will scale your game resolution without losing FPS
# Unlock FPS
fps_unlocker:
@ -180,6 +183,7 @@ settings:
author: 'Author: {author}'
no_images: No images added
not_installed: You haven't installed vkBasalt and reshade-shaders library
# Environmantal variables manager
environment:

View file

@ -121,13 +121,15 @@ settings:
# GameMode
gamemode:
title: Utiliser GameMode
tooltip: C'est un logiciel qui permet d'améliorer les
performances en jeu
tooltip:
enabled: C'est un logiciel qui permet d'améliorer les performances en jeu
disabled: ⚠️ You don't have gamemode package installed
# AMD FSR
fsr:
title: Enable AMD FSR
tooltip: This option enables AMD FidelityFX Super Resolution (FSR) which will scale your game resolution without losing FPS
title: Activer AMD FSR
tooltip: Cette option active "AMD FidelityFX Super Resolution" (FSR)
ce qui permet d'augmenter votre résolution sans perdre des FPS (images par secondes)
# Unlock FPS
fps_unlocker:
@ -187,6 +189,7 @@ settings:
author: 'Auteur: {author}'
no_images: Aucune image ajoutée
not_installed: You haven't installed vkBasalt and reshade-shaders library
# Environmantal variables manager
environment:

View file

@ -119,7 +119,9 @@ settings:
# GameMode
gamemode:
title: Usa GameMode
tooltip: È un software che può migliorare le prestazioni in gioco
tooltip:
enabled: È un software che può migliorare le prestazioni in gioco
disabled: ⚠️ You don't have gamemode package installed
# AMD FSR
fsr:
@ -179,6 +181,7 @@ settings:
author: 'Autore: {author}'
no_images: Nessuna immagine aggiunta
not_installed: You haven't installed vkBasalt and reshade-shaders library
# Environmantal variables manager
environment:

View file

@ -119,12 +119,15 @@ settings:
# GameMode
gamemode:
title: Использовать GameMode
tooltip: Это программа, которая может улучшить производительность игры
tooltip:
enabled: Это программа, которая может улучшить производительность игры
disabled: ⚠️ У вас не установлен пакет gamemode
# AMD FSR
fsr:
title: Включить AMD FSR
tooltip: Эта опция включает AMD FidelityFX Super Resolution (FSR), который может увеличить разрешение игры без потери кадров
tooltip: Эта опция включает AMD FidelityFX Super Resolution (FSR),
который может увеличить разрешение игры без потери кадров
# Разблокировать FPS
fps_unlocker:
@ -179,6 +182,7 @@ settings:
author: 'Автор: {author}'
no_images: Нет добавленных изображений
not_installed: У вас не установлены пакеты vkBasalt и reshade-shaders
# Менеджер переменных среды
environment:

View file

@ -119,7 +119,9 @@ settings:
# GameMode
gamemode:
title: use G-GameMode
tooltip: it i-is a software t-that can impwove the game pewfowmance
tooltip:
enabled: it i-is a software t-that can impwove the game pewfowmance
disabled: ⚠️ You don't have gamemode package installed
# AMD FSR
fsr:
@ -180,6 +182,7 @@ settings:
author: 'a-authow: {author}'
no_images: no images avaiwable
not_installed: You haven't installed vkBasalt and reshade-shaders library
# Environmantal variables manager
environment:

View file

@ -2,11 +2,14 @@
import { _, locale } from 'svelte-i18n';
import type { Shader } from '../ts/types/Shaders';
import Shaders from '../ts/launcher/Shaders';
import Launcher from '../ts/Launcher';
import SelectionBox from './SelectionBox.svelte';
let shaders: Shader[] = [],
reshadeInstalled = true,
shadersOptions = {
'none': 'settings.shaders.items.shaders.items.none'
};
@ -19,33 +22,39 @@
shadersOptions['custom'] = 'settings.shaders.items.shaders.items.custom';
});
Launcher.isPackageAvailable('reshade').then((available) => reshadeInstalled = available);
</script>
<div>
<SelectionBox
lang="settings.shaders.items.shaders.title"
tooltip="settings.shaders.items.shaders.tooltip"
prop="shaders"
items={shadersOptions}
/>
{#if !reshadeInstalled}
<p>{$_('settings.shaders.items.not_installed')}</p>
{:else}
<SelectionBox
lang="settings.shaders.items.shaders.title"
tooltip="settings.shaders.items.shaders.tooltip"
prop="shaders"
items={shadersOptions}
/>
{#each shaders as shader}
<h3>{shader.name}</h3>
{#each shaders as shader}
<h3>{shader.name}</h3>
<p>{$_('settings.shaders.items.author', { values: { author: shader.author } })}</p>
<p>{$_('settings.shaders.items.author', { values: { author: shader.author } })}</p>
{#if !shader.images}
<p>{$_('settings.shaders.items.no_images')}</p>
{:else}
{#each shader.images as image}
{#await Shaders.getPicture(shader.folder, image.file) then picture}
<img class="shader-image" src={picture} alt="" />
{#if !shader.images}
<p>{$_('settings.shaders.items.no_images')}</p>
{:else}
{#each shader.images as image}
{#await Shaders.getPicture(shader.folder, image.file) then picture}
<img class="shader-image" src={picture} alt="" />
<p class="shader-image-title">{$locale && image.caption[$locale] ? image.caption[$locale] : image.caption['en-us']}</p>
{/await}
{/each}
{/if}
{/each}
<p class="shader-image-title">{$locale && image.caption[$locale] ? image.caption[$locale] : image.caption['en-us']}</p>
{/await}
{/each}
{/if}
{/each}
{/if}
</div>
<style lang="sass">

View file

@ -6,13 +6,16 @@
import { onMount } from 'svelte';
import { _, locale, locales } from 'svelte-i18n';
import Window from './ts/neutralino/Window';
import Process from './ts/neutralino/Process';
import constants from './ts/Constants';
import Configs from './ts/Configs';
import Launcher from './ts/Launcher';
import FPSUnlock from './ts/FPSUnlock';
import Window from './ts/neutralino/Window';
import Debug from './ts/core/Debug';
import IPC from './ts/core/IPC';
import Process from './ts/neutralino/Process';
import Runners from './ts/core/Runners';
import Button from './components/Button.svelte';
@ -136,6 +139,21 @@
Configs.set('discord', discordSettings);
};
/**
* GameMode option
*/
let gamemode = {
disabled: false,
tooltip: 'settings.enhancements.items.gamemode.tooltip.enabled'
};
Launcher.isPackageAvailable('gamemoderun').then((available) => {
gamemode.disabled = !available;
if (gamemode.disabled)
gamemode.tooltip = 'settings.enhancements.items.gamemode.tooltip.disabled';
});
/**
* Menu items changing
*/
@ -316,8 +334,9 @@
<Checkbox
lang="settings.enhancements.items.gamemode.title"
tooltip="settings.enhancements.items.gamemode.tooltip"
prop="gamemode"
tooltip={gamemode.tooltip}
disabled={gamemode.disabled}
/>
<Checkbox

View file

@ -17,6 +17,8 @@ import Background from './launcher/Background';
import { version } from '../../package.json';
declare const Neutralino;
export default class Launcher
{
public state?: State;
@ -24,6 +26,9 @@ export default class Launcher
public rpc?: DiscordRPC;
public tray: Tray;
/**
* Launcher version
*/
public static readonly version: string = version;
protected settingsMenu?: Process;
@ -151,4 +156,45 @@ export default class Launcher
});
});
}
/**
* Check if some binary file or package downloaded
*/
public static isPackageAvailable(name: string): Promise<boolean>
{
return new Promise(async (resolve) => {
let available = false;
let paths: string[] = (await Neutralino.os.getEnv('PATH')).split(':');
// Add "/usr/share" if it is not included
// because we use these paths to check if some library exists in system
if (!paths.includes('/usr/share'))
paths.push('/usr/share');
// Sort them by length because obviously
// "/usr/bin" more important than some randomly generated
// yaml or npm folder for its globally downloaded packages
paths = paths.sort((a, b) => a.length - b.length);
for (const path of paths)
{
// Becasue await Neutralino.filesystem.getStats will throw an erro
// if the specified path doesn't exist
try
{
if (await Neutralino.filesystem.getStats(`${path}/${name}`))
{
available = true;
break;
}
}
catch {}
}
resolve(available);
});
}
};

View file

@ -1,13 +1,13 @@
import type Launcher from '../../Launcher';
import Process from '../../neutralino/Process';
import Window from '../../neutralino/Window';
import Launcher from '../../Launcher';
import Configs from '../../Configs';
import constants from '../../Constants';
import { DebugThread } from '../../core/Debug';
import Notifications from '../../core/Notifications';
import Runners from '../../core/Runners';
import Game from '../../Game';
import Process from '../../neutralino/Process';
import Window from '../../neutralino/Window';
declare const Neutralino;
@ -86,7 +86,7 @@ export default (launcher: Launcher): Promise<void> => {
*/
const shaders = await Configs.get('shaders');
if (shaders !== 'none')
if (shaders !== 'none' && await Launcher.isPackageAvailable('reshade'))
{
const launcherShadersFile = `${await constants.paths.launcherDir}/vkBasalt.conf`;
@ -125,7 +125,7 @@ export default (launcher: Launcher): Promise<void> => {
/**
* Gamemode integration
*/
if (await Configs.get('gamemode'))
if (await Configs.get('gamemode') && await Launcher.isPackageAvailable('gamemoderun'))
command = `gamemoderun ${command}`;
/**