diff --git a/Bloxstrap/Bootstrapper.cs b/Bloxstrap/Bootstrapper.cs
index 66443a3..f46d55f 100644
--- a/Bloxstrap/Bootstrapper.cs
+++ b/Bloxstrap/Bootstrapper.cs
@@ -136,13 +136,10 @@ namespace Bloxstrap
Program.SettingsManager.Save();
-
if (Program.IsFirstRun && Program.IsNoLaunch)
Dialog.ShowSuccess($"{Program.ProjectName} has successfully installed");
else if (!Program.IsNoLaunch)
await StartRoblox();
-
- Program.Exit();
}
private async Task CheckForUpdates()
@@ -184,9 +181,11 @@ namespace Bloxstrap
foreach (string arg in Program.LaunchArgs)
startInfo.ArgumentList.Add(arg);
+ Program.SettingsManager.Save();
+
Process.Start(startInfo);
- Program.Exit();
+ Environment.Exit(0);
}
private async Task CheckLatestVersion()
diff --git a/Bloxstrap/Dialogs/BootstrapperDialogs/BootstrapperDialogForm.cs b/Bloxstrap/Dialogs/BootstrapperDialogs/BootstrapperDialogForm.cs
index 425df1b..963b3b6 100644
--- a/Bloxstrap/Dialogs/BootstrapperDialogs/BootstrapperDialogForm.cs
+++ b/Bloxstrap/Dialogs/BootstrapperDialogs/BootstrapperDialogForm.cs
@@ -112,6 +112,8 @@ namespace Bloxstrap.Dialogs.BootstrapperDialogs
ShowError(message);
}
#endif
+
+ Program.Exit();
}
public virtual void ShowSuccess(string message)
diff --git a/Bloxstrap/Dialogs/Preferences.xaml b/Bloxstrap/Dialogs/Preferences.xaml
index 9f90e0f..d907b74 100644
--- a/Bloxstrap/Dialogs/Preferences.xaml
+++ b/Bloxstrap/Dialogs/Preferences.xaml
@@ -58,10 +58,12 @@
-
+
+
-
+
+
diff --git a/Bloxstrap/Dialogs/Preferences.xaml.cs b/Bloxstrap/Dialogs/Preferences.xaml.cs
index 26de396..5dd98fc 100644
--- a/Bloxstrap/Dialogs/Preferences.xaml.cs
+++ b/Bloxstrap/Dialogs/Preferences.xaml.cs
@@ -57,6 +57,11 @@ namespace Bloxstrap.Dialogs
this.Resources.MergedDictionaries[0] = new ResourceDictionary() { Source = new Uri($"Dialogs/Themes/{theme}Theme.xaml", UriKind.Relative) };
}
+ private void ButtonOpenReShadeHelp_Click(object sender, EventArgs e)
+ {
+
+ }
+
private void ButtonOpenModFolder_Click(object sender, EventArgs e)
{
Process.Start("explorer.exe", Directories.Modifications);
diff --git a/Bloxstrap/Helpers/Integrations/RbxFpsUnlocker.cs b/Bloxstrap/Helpers/Integrations/RbxFpsUnlocker.cs
index f331c46..dfeeb9c 100644
--- a/Bloxstrap/Helpers/Integrations/RbxFpsUnlocker.cs
+++ b/Bloxstrap/Helpers/Integrations/RbxFpsUnlocker.cs
@@ -91,20 +91,17 @@ namespace Bloxstrap.Helpers.Integrations
Debug.WriteLine("Installing/Updating rbxfpsunlocker...");
- byte[] bytes = await Program.HttpClient.GetByteArrayAsync(downloadUrl);
-
- using (MemoryStream zipStream = new(bytes))
{
- using (ZipArchive zip = new(zipStream))
- {
- zip.ExtractToDirectory(folderLocation, true);
- }
+ byte[] bytes = await Program.HttpClient.GetByteArrayAsync(downloadUrl);
+
+ using MemoryStream zipStream = new(bytes);
+ using ZipArchive archive = new(zipStream);
+
+ archive.ExtractToDirectory(folderLocation, true);
}
if (!File.Exists(settingsLocation))
- {
await File.WriteAllTextAsync(settingsLocation, Settings);
- }
Program.Settings.RFUVersion = releaseInfo.TagName;
}
diff --git a/Bloxstrap/Helpers/Integrations/ReShade.cs b/Bloxstrap/Helpers/Integrations/ReShade.cs
index 1ae07af..d1dd4b3 100644
--- a/Bloxstrap/Helpers/Integrations/ReShade.cs
+++ b/Bloxstrap/Helpers/Integrations/ReShade.cs
@@ -11,7 +11,6 @@ using Bloxstrap.Models;
using IniParser;
using IniParser.Model;
using System.Diagnostics;
-using System.Xml.Linq;
namespace Bloxstrap.Helpers.Integrations
{
@@ -28,6 +27,7 @@ namespace Bloxstrap.Helpers.Integrations
// i mean, it should be fine? importing shaders is still gonna be a thing, though maybe not as simple, but most people would be looking to use extravi's presets anyway
// based on the shaders we have installed, we're gonna have to parse and adjust this... yay.............
+ #region Config
private static readonly string StockConfig =
"[APP]\r\n" +
"ForceFullscreen=0\r\n" +
@@ -36,13 +36,96 @@ namespace Bloxstrap.Helpers.Integrations
"\r\n" +
"[GENERAL]\r\n" +
"EffectSearchPaths=..\\..\\ReShade\\Shaders\r\n" +
+ "PerformanceMode=1\r\n" +
"PreprocessorDefinitions=RESHADE_DEPTH_LINEARIZATION_FAR_PLANE=1000.0,RESHADE_DEPTH_INPUT_IS_UPSIDE_DOWN=0,RESHADE_DEPTH_INPUT_IS_REVERSED=1,RESHADE_DEPTH_INPUT_IS_LOGARITHMIC=0\r\n" +
"PresetPath=..\\..\\ReShade\\Presets\\ReShadePreset.ini\r\n" +
"TextureSearchPaths=..\\..\\ReShade\\Textures\r\n" +
"\r\n" +
"[INPUT]\r\n" +
+ "ForceShortcutModifiers=1\r\n" +
+ "InputProcessing=2\r\n" +
"GamepadNavigation=1\r\n" +
- "KeyOverlay=36,0,0,0\r\n";
+ "KeyEffects=117,0,1,0\r\n" +
+ "KeyNextPreset=0,0,0,0\r\n" +
+ "KeyOverlay=9,0,1,0\r\n" +
+ "KeyPerformanceMode=0,0,0,0\r\n" +
+ "KeyPreviousPreset=0,0,0,0\r\n" +
+ "KeyReload=0,0,0,0\r\n" +
+ "KeyScreenshot=44,0,0,0\r\n" +
+ "\r\n" +
+ "[STYLE]\r\n" +
+ "Alpha=1.000000\r\n" +
+ "Border=0.862745,0.862745,0.862745,0.300000\r\n" +
+ "BorderShadow=0.000000,0.000000,0.000000,0.000000\r\n" +
+ "Button=0.156863,0.313726,0.941177,0.440000\r\n" +
+ "ButtonActive=0.156863,0.313726,0.941177,1.000000\r\n" +
+ "ButtonHovered=0.156863,0.313726,0.941177,0.860000\r\n" +
+ "CheckMark=0.156863,0.313726,0.941177,0.800000\r\n" +
+ "ChildBg=0.109804,0.109804,0.109804,0.000000\r\n" +
+ "ChildRounding=6.000000\r\n" +
+ "ColFPSText=1.000000,1.000000,0.784314,1.000000\r\n" +
+ "DockingEmptyBg=0.200000,0.200000,0.200000,1.000000\r\n" +
+ "DockingPreview=0.156863,0.313726,0.941177,0.532000\r\n" +
+ "DragDropTarget=1.000000,1.000000,0.000000,0.900000\r\n" +
+ "EditorFont=..\\..\\ReShade\\Fonts\\Hack-Regular.ttf\r\n" +
+ "EditorFontSize=18\r\n" +
+ "EditorStyleIndex=0\r\n" +
+ "Font=..\\..\\ReShade\\Fonts\\NunitoSans-Regular.ttf\r\n" +
+ "FontSize=18\r\n" +
+ "FPSScale=1.000000\r\n" +
+ "FrameBg=0.109804,0.109804,0.109804,1.000000\r\n" +
+ "FrameBgActive=0.156863,0.313726,0.941177,1.000000\r\n" +
+ "FrameBgHovered=0.156863,0.313726,0.941177,0.680000\r\n" +
+ "FrameRounding=6.000000\r\n" +
+ "GrabRounding=6.000000\r\n" +
+ "Header=0.156863,0.313726,0.941177,0.760000\r\n" +
+ "HeaderActive=0.156863,0.313726,0.941177,1.000000\r\n" +
+ "HeaderHovered=0.156863,0.313726,0.941177,0.860000\r\n" +
+ "MenuBarBg=0.109804,0.109804,0.109804,0.570000\r\n" +
+ "ModalWindowDimBg=0.800000,0.800000,0.800000,0.350000\r\n" +
+ "NavHighlight=0.260000,0.590000,0.980000,1.000000\r\n" +
+ "NavWindowingDimBg=0.800000,0.800000,0.800000,0.200000\r\n" +
+ "NavWindowingHighlight=1.000000,1.000000,1.000000,0.700000\r\n" +
+ "PlotHistogram=0.862745,0.862745,0.862745,0.630000\r\n" +
+ "PlotHistogramHovered=0.156863,0.313726,0.941177,1.000000\r\n" +
+ "PlotLines=0.862745,0.862745,0.862745,0.630000\r\n" +
+ "PlotLinesHovered=0.156863,0.313726,0.941177,1.000000\r\n" +
+ "PopupBg=0.047059,0.047059,0.047059,0.920000\r\n" +
+ "PopupRounding=6.000000\r\n" +
+ "ResizeGrip=0.156863,0.313726,0.941177,0.200000\r\n" +
+ "ResizeGripActive=0.156863,0.313726,0.941177,1.000000\r\n" +
+ "ResizeGripHovered=0.156863,0.313726,0.941177,0.780000\r\n" +
+ "ScrollbarBg=0.109804,0.109804,0.109804,1.000000\r\n" +
+ "ScrollbarGrab=0.156863,0.313726,0.941177,0.310000\r\n" +
+ "ScrollbarGrabActive=0.156863,0.313726,0.941177,1.000000\r\n" +
+ "ScrollbarGrabHovered=0.156863,0.313726,0.941177,0.780000\r\n" +
+ "ScrollbarRounding=6.000000\r\n" +
+ "Separator=0.862745,0.862745,0.862745,0.320000\r\n" +
+ "SeparatorActive=0.862745,0.862745,0.862745,1.000000\r\n" +
+ "SeparatorHovered=0.862745,0.862745,0.862745,0.780000\r\n" +
+ "SliderGrab=0.156863,0.313726,0.941177,0.240000\r\n" +
+ "SliderGrabActive=0.156863,0.313726,0.941177,1.000000\r\n" +
+ "StyleIndex=3\r\n" +
+ "Tab=0.156863,0.313726,0.941177,0.440000\r\n" +
+ "TabActive=0.156863,0.313726,0.941177,1.000000\r\n" +
+ "TabHovered=0.156863,0.313726,0.941177,0.860000\r\n" +
+ "TableBorderLight=0.230000,0.230000,0.250000,1.000000\r\n" +
+ "TableBorderStrong=0.310000,0.310000,0.350000,1.000000\r\n" +
+ "TableHeaderBg=0.190000,0.190000,0.200000,1.000000\r\n" +
+ "TableRowBg=0.000000,0.000000,0.000000,0.000000\r\n" +
+ "TableRowBgAlt=1.000000,1.000000,1.000000,0.060000\r\n" +
+ "TabRounding=6.000000\r\n" +
+ "TabUnfocused=0.156863,0.313726,0.941177,0.448000\r\n" +
+ "TabUnfocusedActive=0.156863,0.313726,0.941177,0.780000\r\n" +
+ "Text=0.862745,0.862745,0.862745,1.000000\r\n" +
+ "TextDisabled=0.862745,0.862745,0.862745,0.580000\r\n" +
+ "TextSelectedBg=0.156863,0.313726,0.941177,0.430000\r\n" +
+ "TitleBg=0.156863,0.313726,0.941177,0.450000\r\n" +
+ "TitleBgActive=0.156863,0.313726,0.941177,0.580000\r\n" +
+ "TitleBgCollapsed=0.156863,0.313726,0.941177,0.350000\r\n" +
+ "WindowBg=0.047059,0.047059,0.047059,1.000000\r\n" +
+ "WindowRounding=6.000000";
+ #endregion
// this is a list of selectable shaders to download:
// this should be formatted as { FolderName, GithubRepositoryUrl }
@@ -140,43 +223,46 @@ namespace Bloxstrap.Helpers.Integrations
Debug.WriteLine($"[ReShade] Downloading shaders for {name}");
- byte[] bytes = await Program.HttpClient.GetByteArrayAsync(downloadUrl);
-
- using (MemoryStream zipStream = new(bytes))
{
- using (ZipArchive archive = new(zipStream))
+ byte[] bytes = await Program.HttpClient.GetByteArrayAsync(downloadUrl);
+
+ using MemoryStream zipStream = new(bytes);
+ using ZipArchive archive = new(zipStream);
+
+ foreach (ZipArchiveEntry entry in archive.Entries)
{
- foreach (ZipArchiveEntry entry in archive.Entries)
- {
- if (entry.FullName.EndsWith('/'))
- continue;
+ if (entry.FullName.EndsWith('/'))
+ continue;
- // 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);
+ // 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);
- // skip file if it's not in the Shaders or Textures folder
- if (!fullPath.StartsWith("Shaders") && !fullPath.StartsWith("Textures"))
- continue;
+ // skip file if it's not in the Shaders or Textures folder
+ if (!fullPath.StartsWith("Shaders") && !fullPath.StartsWith("Textures"))
+ continue;
- // 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
- // so in this case, relativePath should just be "Vignette.fx"
- string relativePath = fullPath.Substring(fullPath.IndexOf('/') + 1);
+ // ingore shaders with compiler errors
+ if (fullPath.EndsWith("dh_Lain.fx") || fullPath.EndsWith("dh_rtgi.fx"))
+ continue;
- // now we stitch it all together
- string extractionPath = Path.Combine(
- Directories.ReShade,
- fullPath.StartsWith("Shaders") ? "Shaders" : "Textures",
- name,
- relativePath
- );
+ // 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
+ // so in this case, relativePath should just be "Vignette.fx"
+ string relativePath = fullPath.Substring(fullPath.IndexOf('/') + 1);
- // make sure the folder that we're extracting it to exists
- Directory.CreateDirectory(Path.GetDirectoryName(extractionPath)!);
+ // now we stitch it all together
+ string extractionPath = Path.Combine(
+ Directories.ReShade,
+ fullPath.StartsWith("Shaders") ? "Shaders" : "Textures",
+ name,
+ relativePath
+ );
- // and now extract
- await Task.Run(() => entry.ExtractToFile(extractionPath));
- }
+ // make sure the folder that we're extracting it to exists
+ Directory.CreateDirectory(Path.GetDirectoryName(extractionPath)!);
+
+ // and now extract
+ await Task.Run(() => entry.ExtractToFile(extractionPath));
}
}
@@ -241,33 +327,20 @@ namespace Bloxstrap.Helpers.Integrations
foreach (string name in ExtraviPresetsShaders)
await DownloadShaders(name);
- int count = new DirectoryInfo(Path.Combine(Directories.ReShade, "Presets")).GetFiles().Where(x => x.Name.StartsWith("Extravi")).Count();
-
- // there should be at least 7 presets beginning with "Extravi", if there aren't then presume they're not installed
- if (count >= 7)
- {
- Debug.WriteLine("[ReShade] Extravi's presets are already installed, aborting");
- return;
- }
-
- // we're also gonna need some sort of versioning for this somehow so that extravi can update the presets ota
byte[] bytes = await Program.HttpClient.GetByteArrayAsync("https://github.com/Extravi/extravi.github.io/raw/main/update/reshade-presets.zip");
- using (MemoryStream zipStream = new(bytes))
+ using MemoryStream zipStream = new(bytes);
+ using ZipArchive archive = new(zipStream);
+
+ foreach (ZipArchiveEntry entry in archive.Entries)
{
- using (ZipArchive archive = new(zipStream))
- {
- foreach (ZipArchiveEntry entry in archive.Entries)
- {
- if (entry.FullName.EndsWith('/'))
- continue;
+ if (entry.FullName.EndsWith('/'))
+ continue;
- // github branch zips have a root folder of the name of the branch, so let's just remove that
- string filename = entry.FullName.Substring(entry.FullName.IndexOf('/') + 1);
+ // remove containing folder
+ string filename = entry.FullName.Substring(entry.FullName.IndexOf('/') + 1);
- await Task.Run(() => entry.ExtractToFile(Path.Combine(Directories.ReShade, "Presets", filename), true));
- }
- }
+ await Task.Run(() => entry.ExtractToFile(Path.Combine(Directories.ReShade, "Presets", filename), true));
}
}
@@ -296,12 +369,16 @@ namespace Bloxstrap.Helpers.Integrations
// initialize directories
Directory.CreateDirectory(Directories.ReShade);
+ Directory.CreateDirectory(Path.Combine(Directories.ReShade, "Fonts"));
Directory.CreateDirectory(Path.Combine(Directories.ReShade, "Shaders"));
Directory.CreateDirectory(Path.Combine(Directories.ReShade, "Textures"));
Directory.CreateDirectory(Path.Combine(Directories.ReShade, "Presets"));
if (!Program.Settings.UseReShadeExtraviPresets)
+ {
UninstallExtraviPresets();
+ Program.Settings.ExtraviPresetsVersion = "";
+ }
if (!Program.Settings.UseReShade)
{
@@ -320,23 +397,44 @@ namespace Bloxstrap.Helpers.Integrations
return;
}
- // first, let's check to make sure the injector dll is downloaded
+ // the version manfiest contains the version of reshade available for download and the last date the presets were updated
+ var versionManifest = await Utilities.GetJson("https://raw.githubusercontent.com/Extravi/extravi.github.io/main/update/version.json");
+ bool shouldFetchReShade = false;
+
if (!File.Exists(injectorLocation))
+ {
+ shouldFetchReShade = true;
+ }
+ else if (versionManifest is not null)
+ {
+ // check if an update for reshade is available
+ FileVersionInfo injectorVersionInfo = FileVersionInfo.GetVersionInfo(injectorLocation);
+
+ if (injectorVersionInfo.ProductVersion != versionManifest.ReShade)
+ shouldFetchReShade = true;
+ }
+
+ if (shouldFetchReShade)
{
Debug.WriteLine("[ReShade] Installing ReShade...");
- // here we're downloading the dll through extravi's repository as reshade doesn't officially distribute binaries
- // uhhh... i'm not sure how we're gonna handle checking for updates? there's not exactly a version number to check here...
- // only way i can think of is to check the latest commit to the file but thats messy and requires the github api fsdkjhgusedjfzlikohskeolgdfazszwhs\aripy\aws;j/riows\ajuygh
- // i think i might have to (or get extravi to) host the binary version somewhere
- byte[] bytes = await Program.HttpClient.GetByteArrayAsync("https://github.com/Extravi/extravi.github.io/raw/main/update/dxgi.zip");
-
- using (MemoryStream zipStream = new(bytes))
{
- using (ZipArchive zip = new(zipStream))
- {
- zip.ExtractToDirectory(Directories.Modifications, true);
- }
+ byte[] bytes = await Program.HttpClient.GetByteArrayAsync("https://github.com/Extravi/extravi.github.io/raw/main/update/dxgi.zip");
+ using MemoryStream zipStream = new(bytes);
+ using ZipArchive archive = new(zipStream);
+ archive.ExtractToDirectory(Directories.Modifications, true);
+ }
+
+ // we also gotta download the editor fonts
+ if (Utilities.IsDirectoryEmpty(Path.Combine(Directories.ReShade, "Fonts")))
+ {
+ byte[] bytes = await Program.HttpClient.GetByteArrayAsync("https://github.com/Extravi/extravi.github.io/raw/main/update/config.zip");
+
+ using MemoryStream zipStream = new(bytes);
+ using ZipArchive archive = new(zipStream);
+
+ foreach (ZipArchiveEntry entry in archive.Entries.Where(x => x.FullName.EndsWith(".ttf")))
+ entry.ExtractToFile(Path.Combine(Directories.ReShade, "Fonts", entry.FullName));
}
}
@@ -346,8 +444,11 @@ namespace Bloxstrap.Helpers.Integrations
await DownloadShaders("Stock");
- if (Program.Settings.UseReShadeExtraviPresets)
+ if (Program.Settings.UseReShadeExtraviPresets && Program.Settings.ExtraviPresetsVersion != versionManifest!.Presets)
+ {
await InstallExtraviPresets();
+ Program.Settings.ExtraviPresetsVersion = versionManifest.Presets;
+ }
SynchronizeConfigFile();
}
diff --git a/Bloxstrap/Helpers/Utilities.cs b/Bloxstrap/Helpers/Utilities.cs
index 75b4488..066c081 100644
--- a/Bloxstrap/Helpers/Utilities.cs
+++ b/Bloxstrap/Helpers/Utilities.cs
@@ -1,5 +1,6 @@
using System.Diagnostics;
using System.IO;
+using System.IO.Compression;
using System.Security.Cryptography;
using System.Text.Json;
@@ -7,6 +8,11 @@ namespace Bloxstrap.Helpers
{
public class Utilities
{
+ public static bool IsDirectoryEmpty(string path)
+ {
+ return !Directory.EnumerateFileSystemEntries(path).Any();
+ }
+
public static long GetFreeDiskSpace(string path)
{
foreach (DriveInfo drive in DriveInfo.GetDrives())
diff --git a/Bloxstrap/Models/GithubCommit.cs b/Bloxstrap/Models/GithubCommit.cs
deleted file mode 100644
index 0eebdd6..0000000
--- a/Bloxstrap/Models/GithubCommit.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-using System.Text.Json.Serialization;
-
-namespace Bloxstrap.Models
-{
- public class GithubCommits
- {
- [JsonPropertyName("assets")]
- public List? Commits { get; set; }
- }
-
- public class GithubCommit
- {
- [JsonPropertyName("commit")]
- public GithubCommitData Commit { get; set; } = null!;
- }
-
- public class GithubCommitData
- {
- [JsonPropertyName("author")]
- public GithubCommitAuthor Author { get; set; } = null!;
- }
-
- public class GithubCommitAuthor
- {
- [JsonPropertyName("date")]
- public string Date { get; set; } = null!;
- }
-}
diff --git a/Bloxstrap/Models/ReShadeVersionManifest.cs b/Bloxstrap/Models/ReShadeVersionManifest.cs
new file mode 100644
index 0000000..9b4a6d0
--- /dev/null
+++ b/Bloxstrap/Models/ReShadeVersionManifest.cs
@@ -0,0 +1,8 @@
+namespace Bloxstrap.Models
+{
+ public class ReShadeVersionManifest
+ {
+ public string ReShade { get; set; } = null!;
+ public string Presets { get; set; } = null!;
+ }
+}
diff --git a/Bloxstrap/Models/SettingsFormat.cs b/Bloxstrap/Models/SettingsFormat.cs
index f8794e1..eaf7b3e 100644
--- a/Bloxstrap/Models/SettingsFormat.cs
+++ b/Bloxstrap/Models/SettingsFormat.cs
@@ -21,6 +21,7 @@ namespace Bloxstrap.Models
public bool RFUAutoclose { get; set; } = false;
public string RFUVersion { get; set; } = "";
+ public string ExtraviPresetsVersion { get; set; } = "";
public bool UseReShade { get; set; } = false;
public bool UseReShadeExtraviPresets { get; set; } = false;