Update ReShade.cs

This commit is contained in:
Extravi 2023-03-05 21:11:53 -05:00 committed by GitHub
parent 26a70f4abf
commit 1bfef1ee01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -42,6 +42,7 @@ namespace Bloxstrap.Helpers.Integrations
{ "Stock", "https://github.com/crosire/reshade-shaders/archive/refs/heads/master.zip" }, { "Stock", "https://github.com/crosire/reshade-shaders/archive/refs/heads/master.zip" },
// shaders required for extravi's presets: // shaders required for extravi's presets:
{ "Stormshade","https://github.com/cyrie/Stormshade/archive/refs/heads/master.zip" },
{ "Legacy", "https://github.com/crosire/reshade-shaders/archive/refs/heads/legacy.zip" }, { "Legacy", "https://github.com/crosire/reshade-shaders/archive/refs/heads/legacy.zip" },
{ "AlucardDH", "https://github.com/AlucardDH/dh-reshade-shaders/archive/refs/heads/master.zip" }, { "AlucardDH", "https://github.com/AlucardDH/dh-reshade-shaders/archive/refs/heads/master.zip" },
{ "AstrayFX", "https://github.com/BlueSkyDefender/AstrayFX/archive/refs/heads/master.zip" }, { "AstrayFX", "https://github.com/BlueSkyDefender/AstrayFX/archive/refs/heads/master.zip" },
@ -56,6 +57,7 @@ namespace Bloxstrap.Helpers.Integrations
private static readonly string[] ExtraviPresetsShaders = new string[] private static readonly string[] ExtraviPresetsShaders = new string[]
{ {
"Stormshade",
"Legacy", "Legacy",
"AlucardDH", "AlucardDH",
"AstrayFX", "AstrayFX",
@ -197,16 +199,30 @@ namespace Bloxstrap.Helpers.Integrations
continue; continue;
// github branch zips have a root folder of the name of the branch, so let's just remove that // github branch zips have a root folder of the name of the branch, so let's just remove that
string fullPath = entry.FullName.Substring(entry.FullName.IndexOf('/') + 1); string fullPath;
if (entry.FullName.Contains("Stormshade-master"))
{
fullPath = entry.FullName.Substring(entry.FullName.IndexOf("reshade-shaders/") + "reshade-shaders/".Length);
}
else
{
fullPath = entry.FullName.Substring(entry.FullName.IndexOf('/') + 1);
}
// skip file if it's not in the Shaders or Textures folder // skip file if it's not in the Shaders or Textures folder
if (!fullPath.StartsWith("Shaders") && !fullPath.StartsWith("Textures")) if (!fullPath.StartsWith("Shaders") && !fullPath.StartsWith("Textures"))
continue; continue;
// ingore shaders with compiler errors // ingore shaders with compiler errors
if (fullPath.EndsWith("dh_Lain.fx") || fullPath.EndsWith("dh_rtgi.fx")) if (fullPath.EndsWith("dh_Lain.fx") || fullPath.EndsWith("dh_rtgi.fx") || fullPath.EndsWith("DOF.fx") || fullPath.EndsWith("FXAA.fx") || fullPath.EndsWith("FXAA.fxh"))
continue; continue;
if (entry.FullName.Contains("Stormshade-master"))
{
if (fullPath.EndsWith("Clarity.fx") || fullPath.EndsWith("AmbientLight.fx"))
continue;
}
// and now we do it again because of how we're handling folder management // and now we do it again because of how we're handling folder management
// e.g. reshade-shaders-master/Shaders/Vignette.fx should go to ReShade/Shaders/Stock/Vignette.fx // e.g. reshade-shaders-master/Shaders/Vignette.fx should go to ReShade/Shaders/Stock/Vignette.fx
// so in this case, relativePath should just be "Vignette.fx" // so in this case, relativePath should just be "Vignette.fx"
@ -284,7 +300,7 @@ namespace Bloxstrap.Helpers.Integrations
{ {
App.Logger.WriteLine("[ReShade::InstallExtraviPresets] Installing Extravi's presets..."); App.Logger.WriteLine("[ReShade::InstallExtraviPresets] Installing Extravi's presets...");
foreach (string name in ExtraviPresetsShaders) foreach (string name in ExtraviPresetsShaders)
await DownloadShaders(name); await DownloadShaders(name);
byte[] bytes = await App.HttpClient.GetByteArrayAsync($"{BaseUrl}/reshade-presets.zip"); byte[] bytes = await App.HttpClient.GetByteArrayAsync($"{BaseUrl}/reshade-presets.zip");