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

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

View file

@ -107,3 +107,4 @@ settings:
tooltip: Use Home button to toggle shaders in the game
items:
none: None
custom: Custom

View file

@ -106,3 +106,4 @@ settings:
tooltip: Используйте кнопку Home чтобы переключать шейдеры в игре
items:
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));
}
}
/**