Added custom shaders option in settings menu

This commit is contained in:
Observer KRypt0n_ 2022-01-06 12:56:35 +02:00
parent ec046faee9
commit c404cc486e
No known key found for this signature in database
GPG key ID: DC5D4EC1303465DA
5 changed files with 15 additions and 7 deletions

View file

@ -107,4 +107,5 @@ settings:
title: Shaders
tooltip: Benutze die Home/POS1 taste um die Shader in-spiel zu togglen
items:
none: None
none: None
custom: Custom

View file

@ -106,4 +106,5 @@ settings:
title: Shaders
tooltip: Use Home button to toggle shaders in the game
items:
none: None
none: None
custom: Custom

View file

@ -105,4 +105,5 @@ settings:
title: Шейдеры
tooltip: Используйте кнопку Home чтобы переключать шейдеры в игре
items:
none: Отключены
none: Отключены
custom: Кастомные

View file

@ -14,9 +14,10 @@
Shaders.list().then((list) => {
shaders = list;
list.forEach((shader) => {
for (const shader of list)
shadersOptions[shader.folder] = shader.name;
});
shadersOptions['custom'] = 'settings.shaders.items.shaders.items.custom';
});
</script>

View file

@ -77,13 +77,17 @@ export default (launcher: Launcher): Promise<void> => {
if (shaders !== 'none')
{
const userShadersFile = `${constants.paths.shadersDir}/public/${shaders}/vkBasalt.conf`;
const launcherShadersFile = `${await constants.paths.launcherDir}/vkBasalt.conf`;
env['ENABLE_VKBASALT'] = 1;
env['VKBASALT_CONFIG_FILE'] = launcherShadersFile;
await Neutralino.filesystem.writeFile(launcherShadersFile, await Neutralino.filesystem.readFile(userShadersFile));
if (shaders !== 'custom')
{
const userShadersFile = `${constants.paths.shadersDir}/public/${shaders}/vkBasalt.conf`;
await Neutralino.filesystem.writeFile(launcherShadersFile, await Neutralino.filesystem.readFile(userShadersFile));
}
}
/**