diff --git a/Bloxstrap/Bloxstrap.csproj b/Bloxstrap/Bloxstrap.csproj
index fe9dcbd..bc697fa 100644
--- a/Bloxstrap/Bloxstrap.csproj
+++ b/Bloxstrap/Bloxstrap.csproj
@@ -13,7 +13,7 @@
true
false
-
+
@@ -27,6 +27,14 @@
+
+
+
+
+
+
+
+
diff --git a/Bloxstrap/Models/SettingTasks/Base/BaseTask.cs b/Bloxstrap/Models/SettingTasks/Base/BaseTask.cs
index 15f3ec8..70cf788 100644
--- a/Bloxstrap/Models/SettingTasks/Base/BaseTask.cs
+++ b/Bloxstrap/Models/SettingTasks/Base/BaseTask.cs
@@ -12,7 +12,9 @@ namespace Bloxstrap.Models.SettingTasks.Base
public abstract bool Changed { get; }
- public BaseTask(string prefix, string name) => Name = $"{prefix}.{name}";
+ public BaseTask(string prefix, string name) : this($"{prefix}.{name}") { }
+
+ public BaseTask(string name) => Name = name;
public override string ToString() => Name;
diff --git a/Bloxstrap/Models/SettingTasks/Base/BoolBaseTask.cs b/Bloxstrap/Models/SettingTasks/Base/BoolBaseTask.cs
index 5b5adce..213bafe 100644
--- a/Bloxstrap/Models/SettingTasks/Base/BoolBaseTask.cs
+++ b/Bloxstrap/Models/SettingTasks/Base/BoolBaseTask.cs
@@ -41,5 +41,7 @@ namespace Bloxstrap.Models.SettingTasks.Base
public override bool Changed => _newState != OriginalState;
public BoolBaseTask(string prefix, string name) : base(prefix, name) { }
+
+ public BoolBaseTask(string name) : base(name) { }
}
}
diff --git a/Bloxstrap/Models/SettingTasks/ExtractIconsTask.cs b/Bloxstrap/Models/SettingTasks/ExtractIconsTask.cs
new file mode 100644
index 0000000..8b000bc
--- /dev/null
+++ b/Bloxstrap/Models/SettingTasks/ExtractIconsTask.cs
@@ -0,0 +1,42 @@
+using System.Reflection;
+using System.Windows.Markup;
+
+namespace Bloxstrap.Models.SettingTasks
+{
+ public class ExtractIconsTask : BoolBaseTask
+ {
+ public ExtractIconsTask() : base("ExtractIcons")
+ {
+ OriginalState = Directory.Exists(Paths.Icons);
+ }
+
+ public override void Execute()
+ {
+ if (NewState)
+ {
+ Directory.CreateDirectory(Paths.Icons);
+
+ var assembly = Assembly.GetExecutingAssembly();
+ var resourceNames = assembly.GetManifestResourceNames().Where(x => x.EndsWith(".ico"));
+
+ foreach (string name in resourceNames)
+ {
+ string path = Path.Combine(Paths.Icons, name.Replace("Bloxstrap.Resources.", ""));
+ var stream = assembly.GetManifestResourceStream(name)!;
+
+ using var memoryStream = new MemoryStream();
+ stream.CopyTo(memoryStream);
+
+ Filesystem.AssertReadOnly(path);
+ File.WriteAllBytes(path, memoryStream.ToArray());
+ }
+ }
+ else if (Directory.Exists(Paths.Icons))
+ {
+ Directory.Delete(Paths.Icons, true);
+ }
+
+ OriginalState = NewState;
+ }
+ }
+}
diff --git a/Bloxstrap/Models/SettingTasks/ModPresetTask.cs b/Bloxstrap/Models/SettingTasks/ModPresetTask.cs
index 8aa1592..73fcc22 100644
--- a/Bloxstrap/Models/SettingTasks/ModPresetTask.cs
+++ b/Bloxstrap/Models/SettingTasks/ModPresetTask.cs
@@ -42,7 +42,7 @@ namespace Bloxstrap.Models.SettingTasks
using var resourceStream = data.ResourceStream;
using var memoryStream = new MemoryStream();
- data.ResourceStream.CopyTo(memoryStream);
+ resourceStream.CopyTo(memoryStream);
Filesystem.AssertReadOnly(data.FullFilePath);
File.WriteAllBytes(data.FullFilePath, memoryStream.ToArray());
diff --git a/Bloxstrap/Models/SettingTasks/ShortcutTask.cs b/Bloxstrap/Models/SettingTasks/ShortcutTask.cs
index ca14a45..e85fcf1 100644
--- a/Bloxstrap/Models/SettingTasks/ShortcutTask.cs
+++ b/Bloxstrap/Models/SettingTasks/ShortcutTask.cs
@@ -1,11 +1,9 @@
-using Bloxstrap.Models.SettingTasks.Base;
-
-namespace Bloxstrap.Models.SettingTasks
+namespace Bloxstrap.Models.SettingTasks
{
public class ShortcutTask : BoolBaseTask
{
private string _shortcutPath;
-
+
private string _exeFlags;
public ShortcutTask(string name, string lnkFolder, string lnkName, string exeFlags = "") : base("Shortcut", name)
@@ -26,4 +24,4 @@ namespace Bloxstrap.Models.SettingTasks
OriginalState = NewState;
}
}
-}
+}
\ No newline at end of file
diff --git a/Bloxstrap/Paths.cs b/Bloxstrap/Paths.cs
index 36f8136..130d44b 100644
--- a/Bloxstrap/Paths.cs
+++ b/Bloxstrap/Paths.cs
@@ -22,6 +22,7 @@
public static string Integrations { get; private set; } = "";
public static string Modifications { get; private set; } = "";
public static string Roblox { get; private set; } = "";
+ public static string Icons { get; private set; } = "";
public static string Application { get; private set; } = "";
@@ -37,6 +38,7 @@
Integrations = Path.Combine(Base, "Integrations");
Modifications = Path.Combine(Base, "Modifications");
Roblox = Path.Combine(Base, "Roblox");
+ Icons = Path.Combine(Base, "Icons");
Application = Path.Combine(Base, $"{App.ProjectName}.exe");
}
diff --git a/Bloxstrap/Resources/Strings.Designer.cs b/Bloxstrap/Resources/Strings.Designer.cs
index f261f0a..8a3f4a5 100644
--- a/Bloxstrap/Resources/Strings.Designer.cs
+++ b/Bloxstrap/Resources/Strings.Designer.cs
@@ -3088,6 +3088,24 @@ namespace Bloxstrap.Resources {
}
}
+ ///
+ /// Looks up a localized string similar to To use for your shortcuts, right-click it, open properties, change icon, browse, and pick from the Icons folder..
+ ///
+ public static string Menu_Shortcuts_ExtractIcons_Description {
+ get {
+ return ResourceManager.GetString("Menu.Shortcuts.ExtractIcons.Description", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Extract Roblox icons to folder.
+ ///
+ public static string Menu_Shortcuts_ExtractIcons_Title {
+ get {
+ return ResourceManager.GetString("Menu.Shortcuts.ExtractIcons.Title", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Create shortcuts for quick access to specific functions. These will all be placed on the Desktop..
///
diff --git a/Bloxstrap/Resources/Strings.resx b/Bloxstrap/Resources/Strings.resx
index b10ea6e..231b03f 100644
--- a/Bloxstrap/Resources/Strings.resx
+++ b/Bloxstrap/Resources/Strings.resx
@@ -1198,4 +1198,10 @@ Please manually delete Bloxstrap.exe from the install location or try restarting
{0}
+
+ Extract Roblox icons to folder
+
+
+ To use for your shortcuts, right-click it, open properties, change icon, browse, and pick from the Icons folder.
+
\ No newline at end of file
diff --git a/Bloxstrap/UI/Elements/Settings/Pages/ShortcutsPage.xaml b/Bloxstrap/UI/Elements/Settings/Pages/ShortcutsPage.xaml
index 6d10250..9d3f359 100644
--- a/Bloxstrap/UI/Elements/Settings/Pages/ShortcutsPage.xaml
+++ b/Bloxstrap/UI/Elements/Settings/Pages/ShortcutsPage.xaml
@@ -17,6 +17,13 @@
+
+
+
+
diff --git a/Bloxstrap/UI/ViewModels/Settings/ShortcutsViewModel.cs b/Bloxstrap/UI/ViewModels/Settings/ShortcutsViewModel.cs
index b79d8c8..cb4cc54 100644
--- a/Bloxstrap/UI/ViewModels/Settings/ShortcutsViewModel.cs
+++ b/Bloxstrap/UI/ViewModels/Settings/ShortcutsViewModel.cs
@@ -12,5 +12,7 @@ namespace Bloxstrap.UI.ViewModels.Settings
public ShortcutTask PlayerIconTask { get; } = new("RobloxPlayer", Paths.Desktop, $"{Strings.LaunchMenu_LaunchRoblox}.lnk", "-player");
public ShortcutTask SettingsIconTask { get; } = new("Settings", Paths.Desktop, $"{Strings.Menu_Title}.lnk", "-settings");
+
+ public ExtractIconsTask ExtractIconsTask { get; } = new();
}
}