mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-21 10:01:27 -07:00
Refactor class structure for singletons/utilities
cleanup necessary namespaces and adjust namespaces for certain classes to better represent what they're for models, helpers and tools are all different and shouldnt really be under the same namespace
This commit is contained in:
parent
903fc42128
commit
58fb73c127
@ -14,10 +14,9 @@ using System.Windows.Threading;
|
|||||||
using Microsoft.Win32;
|
using Microsoft.Win32;
|
||||||
|
|
||||||
using Bloxstrap.Dialogs;
|
using Bloxstrap.Dialogs;
|
||||||
using Bloxstrap.Enums;
|
using Bloxstrap.Extensions;
|
||||||
using Bloxstrap.Helpers;
|
|
||||||
using Bloxstrap.Integrations;
|
|
||||||
using Bloxstrap.Models;
|
using Bloxstrap.Models;
|
||||||
|
using Bloxstrap.Singletons;
|
||||||
using Bloxstrap.Views;
|
using Bloxstrap.Views;
|
||||||
|
|
||||||
namespace Bloxstrap
|
namespace Bloxstrap
|
||||||
@ -240,7 +239,7 @@ namespace Bloxstrap
|
|||||||
{
|
{
|
||||||
if (LaunchArgs[0].StartsWith("roblox-player:"))
|
if (LaunchArgs[0].StartsWith("roblox-player:"))
|
||||||
{
|
{
|
||||||
commandLine = Protocol.ParseUri(LaunchArgs[0]);
|
commandLine = ProtocolHandler.ParseUri(LaunchArgs[0]);
|
||||||
}
|
}
|
||||||
else if (LaunchArgs[0].StartsWith("roblox:"))
|
else if (LaunchArgs[0].StartsWith("roblox:"))
|
||||||
{
|
{
|
||||||
|
@ -13,10 +13,10 @@ using System.Windows;
|
|||||||
using Microsoft.Win32;
|
using Microsoft.Win32;
|
||||||
|
|
||||||
using Bloxstrap.Dialogs;
|
using Bloxstrap.Dialogs;
|
||||||
using Bloxstrap.Helpers;
|
|
||||||
using Bloxstrap.Helpers.RSMM;
|
|
||||||
using Bloxstrap.Models;
|
|
||||||
using Bloxstrap.Integrations;
|
using Bloxstrap.Integrations;
|
||||||
|
using Bloxstrap.Models;
|
||||||
|
using Bloxstrap.Singletons;
|
||||||
|
using Bloxstrap.Tools;
|
||||||
|
|
||||||
namespace Bloxstrap
|
namespace Bloxstrap
|
||||||
{
|
{
|
||||||
@ -473,8 +473,8 @@ namespace Bloxstrap
|
|||||||
// this doesn't go under register, so we check every launch
|
// this doesn't go under register, so we check every launch
|
||||||
// just in case the stock bootstrapper changes it back
|
// just in case the stock bootstrapper changes it back
|
||||||
|
|
||||||
Protocol.Register("roblox", "Roblox", Directories.Application);
|
ProtocolHandler.Register("roblox", "Roblox", Directories.Application);
|
||||||
Protocol.Register("roblox-player", "Roblox", Directories.Application);
|
ProtocolHandler.Register("roblox-player", "Roblox", Directories.Application);
|
||||||
|
|
||||||
// in case the user is reinstalling
|
// in case the user is reinstalling
|
||||||
if (File.Exists(Directories.Application) && App.IsFirstRun)
|
if (File.Exists(Directories.Application) && App.IsFirstRun)
|
||||||
@ -612,8 +612,8 @@ namespace Bloxstrap
|
|||||||
RegistryKey? bootstrapperKey = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Uninstall\roblox-player");
|
RegistryKey? bootstrapperKey = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Uninstall\roblox-player");
|
||||||
if (bootstrapperKey is null)
|
if (bootstrapperKey is null)
|
||||||
{
|
{
|
||||||
Protocol.Unregister("roblox");
|
ProtocolHandler.Unregister("roblox");
|
||||||
Protocol.Unregister("roblox-player");
|
ProtocolHandler.Unregister("roblox-player");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -621,8 +621,8 @@ namespace Bloxstrap
|
|||||||
|
|
||||||
string bootstrapperLocation = (string?)bootstrapperKey.GetValue("InstallLocation") + "RobloxPlayerLauncher.exe";
|
string bootstrapperLocation = (string?)bootstrapperKey.GetValue("InstallLocation") + "RobloxPlayerLauncher.exe";
|
||||||
|
|
||||||
Protocol.Register("roblox", "Roblox", bootstrapperLocation);
|
ProtocolHandler.Register("roblox", "Roblox", bootstrapperLocation);
|
||||||
Protocol.Register("roblox-player", "Roblox", bootstrapperLocation);
|
ProtocolHandler.Register("roblox-player", "Roblox", bootstrapperLocation);
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
using Bloxstrap.Enums;
|
using Bloxstrap.Extensions;
|
||||||
using Bloxstrap.Helpers;
|
|
||||||
|
|
||||||
namespace Bloxstrap.Dialogs
|
namespace Bloxstrap.Dialogs
|
||||||
{
|
{
|
||||||
|
@ -3,7 +3,7 @@ using System.Windows;
|
|||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
using Bloxstrap.Enums;
|
using Bloxstrap.Enums;
|
||||||
using Bloxstrap.Helpers.Extensions;
|
using Bloxstrap.Extensions;
|
||||||
using Bloxstrap.ViewModels;
|
using Bloxstrap.ViewModels;
|
||||||
|
|
||||||
using Wpf.Ui.Appearance;
|
using Wpf.Ui.Appearance;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
using Bloxstrap.Enums;
|
using Bloxstrap.Extensions;
|
||||||
|
|
||||||
namespace Bloxstrap.Dialogs
|
namespace Bloxstrap.Dialogs
|
||||||
{
|
{
|
||||||
|
@ -3,7 +3,7 @@ using System.Drawing;
|
|||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
using Bloxstrap.Enums;
|
using Bloxstrap.Enums;
|
||||||
using Bloxstrap.Helpers.Extensions;
|
using Bloxstrap.Extensions;
|
||||||
|
|
||||||
namespace Bloxstrap.Dialogs
|
namespace Bloxstrap.Dialogs
|
||||||
{
|
{
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
using Bloxstrap.Enums;
|
using Bloxstrap.Extensions;
|
||||||
|
|
||||||
namespace Bloxstrap.Dialogs
|
namespace Bloxstrap.Dialogs
|
||||||
{
|
{
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
||||||
namespace Bloxstrap.Helpers
|
namespace Bloxstrap
|
||||||
{
|
{
|
||||||
class Directories
|
static class Directories
|
||||||
{
|
{
|
||||||
// note that these are directories that aren't tethered to the basedirectory
|
// note that these are directories that aren't tethered to the basedirectory
|
||||||
// so these can safely be called before initialization
|
// so these can safely be called before initialization
|
||||||
@ -21,7 +21,7 @@ namespace Bloxstrap.Helpers
|
|||||||
|
|
||||||
public static string Application { get; private set; } = "";
|
public static string Application { get; private set; } = "";
|
||||||
|
|
||||||
public static bool Initialized => String.IsNullOrEmpty(Base);
|
public static bool Initialized => string.IsNullOrEmpty(Base);
|
||||||
|
|
||||||
public static void Initialize(string baseDirectory)
|
public static void Initialize(string baseDirectory)
|
||||||
{
|
{
|
@ -1,10 +1,4 @@
|
|||||||
using System;
|
namespace Bloxstrap.Enums
|
||||||
using System.Drawing;
|
|
||||||
using System.IO;
|
|
||||||
using System.Windows.Media;
|
|
||||||
using System.Windows.Media.Imaging;
|
|
||||||
|
|
||||||
namespace Bloxstrap.Enums
|
|
||||||
{
|
{
|
||||||
public enum BootstrapperIcon
|
public enum BootstrapperIcon
|
||||||
{
|
{
|
||||||
@ -18,44 +12,4 @@ namespace Bloxstrap.Enums
|
|||||||
Icon2022,
|
Icon2022,
|
||||||
IconCustom
|
IconCustom
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class BootstrapperIconEx
|
|
||||||
{
|
|
||||||
// small note on handling icon sizes
|
|
||||||
// i'm using multisize icon packs here with sizes 16, 24, 32, 48, 64 and 128
|
|
||||||
// use this for generating multisize packs: https://www.aconvert.com/icon/
|
|
||||||
|
|
||||||
public static Icon GetIcon(this BootstrapperIcon icon)
|
|
||||||
{
|
|
||||||
// load the custom icon file
|
|
||||||
if (icon == BootstrapperIcon.IconCustom)
|
|
||||||
{
|
|
||||||
Icon? customIcon = null;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
customIcon = new Icon(App.Settings.Prop.BootstrapperIconCustomLocation);
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
App.Logger.WriteLine($"[BootstrapperIconEx::GetIcon] Failed to load custom icon! {ex}");
|
|
||||||
}
|
|
||||||
|
|
||||||
return customIcon ?? Properties.Resources.IconBloxstrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
return icon switch
|
|
||||||
{
|
|
||||||
BootstrapperIcon.IconBloxstrap => Properties.Resources.IconBloxstrap,
|
|
||||||
BootstrapperIcon.Icon2009 => Properties.Resources.Icon2009,
|
|
||||||
BootstrapperIcon.Icon2011 => Properties.Resources.Icon2011,
|
|
||||||
BootstrapperIcon.IconEarly2015 => Properties.Resources.IconEarly2015,
|
|
||||||
BootstrapperIcon.IconLate2015 => Properties.Resources.IconLate2015,
|
|
||||||
BootstrapperIcon.Icon2017 => Properties.Resources.Icon2017,
|
|
||||||
BootstrapperIcon.Icon2019 => Properties.Resources.Icon2019,
|
|
||||||
BootstrapperIcon.Icon2022 => Properties.Resources.Icon2022,
|
|
||||||
_ => Properties.Resources.IconBloxstrap
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,4 @@
|
|||||||
using System.Windows.Forms;
|
namespace Bloxstrap.Enums
|
||||||
|
|
||||||
using Bloxstrap.Dialogs;
|
|
||||||
|
|
||||||
namespace Bloxstrap.Enums
|
|
||||||
{
|
{
|
||||||
public enum BootstrapperStyle
|
public enum BootstrapperStyle
|
||||||
{
|
{
|
||||||
@ -12,20 +8,4 @@ namespace Bloxstrap.Enums
|
|||||||
ProgressDialog,
|
ProgressDialog,
|
||||||
FluentDialog
|
FluentDialog
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class BootstrapperStyleEx
|
|
||||||
{
|
|
||||||
public static IBootstrapperDialog GetNew(this BootstrapperStyle bootstrapperStyle)
|
|
||||||
{
|
|
||||||
return bootstrapperStyle switch
|
|
||||||
{
|
|
||||||
BootstrapperStyle.VistaDialog => new VistaDialog(),
|
|
||||||
BootstrapperStyle.LegacyDialog2009 => new LegacyDialog2009(),
|
|
||||||
BootstrapperStyle.LegacyDialog2011 => new LegacyDialog2011(),
|
|
||||||
BootstrapperStyle.ProgressDialog => new ProgressDialog(),
|
|
||||||
BootstrapperStyle.FluentDialog => new FluentDialog(),
|
|
||||||
_ => new FluentDialog()
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
using Microsoft.Win32;
|
namespace Bloxstrap.Enums
|
||||||
|
|
||||||
namespace Bloxstrap.Enums
|
|
||||||
{
|
{
|
||||||
public enum Theme
|
public enum Theme
|
||||||
{
|
{
|
||||||
@ -8,25 +6,4 @@ namespace Bloxstrap.Enums
|
|||||||
Light,
|
Light,
|
||||||
Dark
|
Dark
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class DialogThemeEx
|
|
||||||
{
|
|
||||||
public static Theme GetFinal(this Theme dialogTheme)
|
|
||||||
{
|
|
||||||
if (dialogTheme != Theme.Default)
|
|
||||||
return dialogTheme;
|
|
||||||
|
|
||||||
RegistryKey? key = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize");
|
|
||||||
|
|
||||||
if (key is not null)
|
|
||||||
{
|
|
||||||
var value = key.GetValue("AppsUseLightTheme");
|
|
||||||
|
|
||||||
if (value is not null && (int)value == 0)
|
|
||||||
return Theme.Dark;
|
|
||||||
}
|
|
||||||
|
|
||||||
return Theme.Light;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
47
Bloxstrap/Extensions/BootstrapperIconEx.cs
Normal file
47
Bloxstrap/Extensions/BootstrapperIconEx.cs
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
using System;
|
||||||
|
using System.Drawing;
|
||||||
|
|
||||||
|
using Bloxstrap.Enums;
|
||||||
|
|
||||||
|
namespace Bloxstrap.Extensions
|
||||||
|
{
|
||||||
|
static class BootstrapperIconEx
|
||||||
|
{
|
||||||
|
// small note on handling icon sizes
|
||||||
|
// i'm using multisize icon packs here with sizes 16, 24, 32, 48, 64 and 128
|
||||||
|
// use this for generating multisize packs: https://www.aconvert.com/icon/
|
||||||
|
|
||||||
|
public static Icon GetIcon(this BootstrapperIcon icon)
|
||||||
|
{
|
||||||
|
// load the custom icon file
|
||||||
|
if (icon == BootstrapperIcon.IconCustom)
|
||||||
|
{
|
||||||
|
Icon? customIcon = null;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
customIcon = new Icon(App.Settings.Prop.BootstrapperIconCustomLocation);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
App.Logger.WriteLine($"[BootstrapperIconEx::GetIcon] Failed to load custom icon! {ex}");
|
||||||
|
}
|
||||||
|
|
||||||
|
return customIcon ?? Properties.Resources.IconBloxstrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
return icon switch
|
||||||
|
{
|
||||||
|
BootstrapperIcon.IconBloxstrap => Properties.Resources.IconBloxstrap,
|
||||||
|
BootstrapperIcon.Icon2009 => Properties.Resources.Icon2009,
|
||||||
|
BootstrapperIcon.Icon2011 => Properties.Resources.Icon2011,
|
||||||
|
BootstrapperIcon.IconEarly2015 => Properties.Resources.IconEarly2015,
|
||||||
|
BootstrapperIcon.IconLate2015 => Properties.Resources.IconLate2015,
|
||||||
|
BootstrapperIcon.Icon2017 => Properties.Resources.Icon2017,
|
||||||
|
BootstrapperIcon.Icon2019 => Properties.Resources.Icon2019,
|
||||||
|
BootstrapperIcon.Icon2022 => Properties.Resources.Icon2022,
|
||||||
|
_ => Properties.Resources.IconBloxstrap
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
21
Bloxstrap/Extensions/BootstrapperStyleEx.cs
Normal file
21
Bloxstrap/Extensions/BootstrapperStyleEx.cs
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
using Bloxstrap.Dialogs;
|
||||||
|
using Bloxstrap.Enums;
|
||||||
|
|
||||||
|
namespace Bloxstrap.Extensions
|
||||||
|
{
|
||||||
|
static class BootstrapperStyleEx
|
||||||
|
{
|
||||||
|
public static IBootstrapperDialog GetNew(this BootstrapperStyle bootstrapperStyle)
|
||||||
|
{
|
||||||
|
return bootstrapperStyle switch
|
||||||
|
{
|
||||||
|
BootstrapperStyle.VistaDialog => new VistaDialog(),
|
||||||
|
BootstrapperStyle.LegacyDialog2009 => new LegacyDialog2009(),
|
||||||
|
BootstrapperStyle.LegacyDialog2011 => new LegacyDialog2011(),
|
||||||
|
BootstrapperStyle.ProgressDialog => new ProgressDialog(),
|
||||||
|
BootstrapperStyle.FluentDialog => new FluentDialog(),
|
||||||
|
_ => new FluentDialog()
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -3,7 +3,7 @@ using System.IO;
|
|||||||
using System.Windows.Media.Imaging;
|
using System.Windows.Media.Imaging;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
|
|
||||||
namespace Bloxstrap.Helpers.Extensions
|
namespace Bloxstrap.Extensions
|
||||||
{
|
{
|
||||||
public static class IconEx
|
public static class IconEx
|
||||||
{
|
{
|
26
Bloxstrap/Extensions/ThemeEx.cs
Normal file
26
Bloxstrap/Extensions/ThemeEx.cs
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
using Microsoft.Win32;
|
||||||
|
using Bloxstrap.Enums;
|
||||||
|
|
||||||
|
namespace Bloxstrap.Extensions
|
||||||
|
{
|
||||||
|
public static class ThemeEx
|
||||||
|
{
|
||||||
|
public static Theme GetFinal(this Theme dialogTheme)
|
||||||
|
{
|
||||||
|
if (dialogTheme != Theme.Default)
|
||||||
|
return dialogTheme;
|
||||||
|
|
||||||
|
RegistryKey? key = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize");
|
||||||
|
|
||||||
|
if (key is not null)
|
||||||
|
{
|
||||||
|
var value = key.GetValue("AppsUseLightTheme");
|
||||||
|
|
||||||
|
if (value is not null && (int)value == 0)
|
||||||
|
return Theme.Dark;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Theme.Light;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,13 +1,11 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Bloxstrap.Helpers
|
namespace Bloxstrap
|
||||||
{
|
{
|
||||||
public class GameActivityWatcher : IDisposable
|
public class GameActivityWatcher : IDisposable
|
||||||
{
|
{
|
@ -3,14 +3,13 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
using Bloxstrap.Helpers;
|
|
||||||
using Bloxstrap.Models.RobloxApi;
|
|
||||||
|
|
||||||
using DiscordRPC;
|
using DiscordRPC;
|
||||||
|
|
||||||
|
using Bloxstrap.Models.RobloxApi;
|
||||||
|
|
||||||
namespace Bloxstrap.Integrations
|
namespace Bloxstrap.Integrations
|
||||||
{
|
{
|
||||||
class DiscordRichPresence : IDisposable
|
public class DiscordRichPresence : IDisposable
|
||||||
{
|
{
|
||||||
private readonly DiscordRpcClient _rpcClient = new("1005469189907173486");
|
private readonly DiscordRpcClient _rpcClient = new("1005469189907173486");
|
||||||
private readonly GameActivityWatcher _activityWatcher;
|
private readonly GameActivityWatcher _activityWatcher;
|
||||||
|
@ -6,15 +6,14 @@ using System.IO.Compression;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
using Bloxstrap.Helpers;
|
|
||||||
using Bloxstrap.Models;
|
|
||||||
|
|
||||||
using IniParser;
|
using IniParser;
|
||||||
using IniParser.Model;
|
using IniParser.Model;
|
||||||
|
|
||||||
|
using Bloxstrap.Models;
|
||||||
|
|
||||||
namespace Bloxstrap.Integrations
|
namespace Bloxstrap.Integrations
|
||||||
{
|
{
|
||||||
internal class ReShade
|
public class ReShade
|
||||||
{
|
{
|
||||||
// i havent even started this and i know for a fact this is gonna be a mess of an integration lol
|
// i havent even started this and i know for a fact this is gonna be a mess of an integration lol
|
||||||
// there's a lot of nuances involved in how reshade functionality is supposed to work (shader management, config management, etc)
|
// there's a lot of nuances involved in how reshade functionality is supposed to work (shader management, config management, etc)
|
||||||
|
@ -3,7 +3,6 @@ using System.Net.NetworkInformation;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
using Bloxstrap.Helpers;
|
|
||||||
using Bloxstrap.Properties;
|
using Bloxstrap.Properties;
|
||||||
|
|
||||||
namespace Bloxstrap.Integrations
|
namespace Bloxstrap.Integrations
|
||||||
|
@ -1,11 +1,4 @@
|
|||||||
using Newtonsoft.Json.Linq;
|
namespace Bloxstrap.Models
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Bloxstrap.Models
|
|
||||||
{
|
{
|
||||||
public class CustomIntegration
|
public class CustomIntegration
|
||||||
{
|
{
|
||||||
|
@ -1,8 +1,12 @@
|
|||||||
// https://github.com/MaximumADHD/Roblox-Studio-Mod-Manager/blob/main/ProjectSrc/Utility/Package.cs
|
/*
|
||||||
|
* Roblox Studio Mod Manager (ProjectSrc/Utility/Package.cs)
|
||||||
|
* MIT License
|
||||||
|
* Copyright (c) 2015-present MaximumADHD
|
||||||
|
*/
|
||||||
|
|
||||||
namespace Bloxstrap.Helpers.RSMM
|
namespace Bloxstrap.Models
|
||||||
{
|
{
|
||||||
internal class Package
|
public class Package
|
||||||
{
|
{
|
||||||
public string Name { get; set; } = "";
|
public string Name { get; set; } = "";
|
||||||
public string Signature { get; set; } = "";
|
public string Signature { get; set; } = "";
|
@ -1,13 +1,17 @@
|
|||||||
// https://github.com/MaximumADHD/Roblox-Studio-Mod-Manager/blob/main/ProjectSrc/Bootstrapper/PackageManifest.cs
|
/*
|
||||||
|
* Roblox Studio Mod Manager (ProjectSrc/Utility/PackageManifest.cs)
|
||||||
|
* MIT License
|
||||||
|
* Copyright (c) 2015-present MaximumADHD
|
||||||
|
*/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Bloxstrap.Helpers.RSMM
|
namespace Bloxstrap.Models
|
||||||
{
|
{
|
||||||
internal class PackageManifest : List<Package>
|
public class PackageManifest : List<Package>
|
||||||
{
|
{
|
||||||
private PackageManifest(string data)
|
private PackageManifest(string data)
|
||||||
{
|
{
|
@ -3,7 +3,7 @@
|
|||||||
namespace Bloxstrap.Models.RobloxApi
|
namespace Bloxstrap.Models.RobloxApi
|
||||||
{
|
{
|
||||||
// lmao its just one property
|
// lmao its just one property
|
||||||
internal class UniverseIdResponse
|
public class UniverseIdResponse
|
||||||
{
|
{
|
||||||
[JsonPropertyName("universeId")]
|
[JsonPropertyName("universeId")]
|
||||||
public long UniverseId { get; set; }
|
public long UniverseId { get; set; }
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.ObjectModel;
|
||||||
using System.Collections.ObjectModel;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using Bloxstrap.Enums;
|
using Bloxstrap.Enums;
|
||||||
using Bloxstrap.Helpers;
|
using Bloxstrap.Singletons;
|
||||||
|
|
||||||
namespace Bloxstrap.Models
|
namespace Bloxstrap.Models
|
||||||
{
|
{
|
||||||
|
@ -1,15 +1,14 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Web;
|
using System.Web;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
|
||||||
using Microsoft.Win32;
|
using Microsoft.Win32;
|
||||||
|
|
||||||
namespace Bloxstrap.Helpers
|
namespace Bloxstrap
|
||||||
{
|
{
|
||||||
public class Protocol
|
static class ProtocolHandler
|
||||||
{
|
{
|
||||||
// map uri keys to command line args
|
// map uri keys to command line args
|
||||||
private static readonly IReadOnlyDictionary<string, string> UriKeyArgMap = new Dictionary<string, string>()
|
private static readonly IReadOnlyDictionary<string, string> UriKeyArgMap = new Dictionary<string, string>()
|
@ -3,9 +3,9 @@ using System.Linq;
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Bloxstrap.Helpers
|
namespace Bloxstrap
|
||||||
{
|
{
|
||||||
internal class ResourceHelper
|
static class ResourceHelper
|
||||||
{
|
{
|
||||||
static readonly Assembly assembly = Assembly.GetExecutingAssembly();
|
static readonly Assembly assembly = Assembly.GetExecutingAssembly();
|
||||||
static readonly string[] resourceNames = assembly.GetManifestResourceNames();
|
static readonly string[] resourceNames = assembly.GetManifestResourceNames();
|
@ -8,7 +8,7 @@ using System.Windows;
|
|||||||
|
|
||||||
using Bloxstrap.Models;
|
using Bloxstrap.Models;
|
||||||
|
|
||||||
namespace Bloxstrap.Helpers
|
namespace Bloxstrap.Singletons
|
||||||
{
|
{
|
||||||
// TODO - make this functional and into a helper instead of a singleton, this really doesn't need to be OOP
|
// TODO - make this functional and into a helper instead of a singleton, this really doesn't need to be OOP
|
||||||
|
|
||||||
@ -33,7 +33,7 @@ namespace Bloxstrap.Helpers
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (String.IsNullOrEmpty(_baseUrl))
|
if (string.IsNullOrEmpty(_baseUrl))
|
||||||
{
|
{
|
||||||
// check for a working accessible deployment domain
|
// check for a working accessible deployment domain
|
||||||
foreach (string attemptedUrl in BaseUrls)
|
foreach (string attemptedUrl in BaseUrls)
|
||||||
@ -55,7 +55,7 @@ namespace Bloxstrap.Helpers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (String.IsNullOrEmpty(_baseUrl))
|
if (string.IsNullOrEmpty(_baseUrl))
|
||||||
throw new Exception("Unable to find an accessible Roblox deploy mirror!");
|
throw new Exception("Unable to find an accessible Roblox deploy mirror!");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -96,8 +96,8 @@ namespace Bloxstrap.Helpers
|
|||||||
// either way, we throw
|
// either way, we throw
|
||||||
|
|
||||||
App.Logger.WriteLine(
|
App.Logger.WriteLine(
|
||||||
"[DeployManager::GetLastDeploy] Failed to fetch deploy info!\r\n"+
|
"[DeployManager::GetLastDeploy] Failed to fetch deploy info!\r\n" +
|
||||||
$"\tStatus code: {deployInfoResponse.StatusCode}\r\n"+
|
$"\tStatus code: {deployInfoResponse.StatusCode}\r\n" +
|
||||||
$"\tResponse: {rawResponse}"
|
$"\tResponse: {rawResponse}"
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -163,8 +163,8 @@ namespace Bloxstrap.Helpers
|
|||||||
|
|
||||||
// this SUCKS
|
// this SUCKS
|
||||||
ClientVersion defaultChannelInfo = await new DeployManager().GetLastDeploy().ConfigureAwait(false);
|
ClientVersion defaultChannelInfo = await new DeployManager().GetLastDeploy().ConfigureAwait(false);
|
||||||
int defaultChannelVersion = Int32.Parse(defaultChannelInfo.Version.Split('.')[1]);
|
int defaultChannelVersion = int.Parse(defaultChannelInfo.Version.Split('.')[1]);
|
||||||
int currentChannelVersion = Int32.Parse(versionInfo.Version.Split('.')[1]);
|
int currentChannelVersion = int.Parse(versionInfo.Version.Split('.')[1]);
|
||||||
|
|
||||||
if (currentChannelVersion < defaultChannelVersion)
|
if (currentChannelVersion < defaultChannelVersion)
|
||||||
{
|
{
|
@ -4,7 +4,7 @@ using System.Collections.Generic;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
|
|
||||||
namespace Bloxstrap.Helpers
|
namespace Bloxstrap.Singletons
|
||||||
{
|
{
|
||||||
public class FastFlagManager : JsonManager<Dictionary<string, object>>
|
public class FastFlagManager : JsonManager<Dictionary<string, object>>
|
||||||
{
|
{
|
@ -2,7 +2,7 @@
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
|
|
||||||
namespace Bloxstrap.Helpers
|
namespace Bloxstrap.Singletons
|
||||||
{
|
{
|
||||||
public class JsonManager<T> where T : new()
|
public class JsonManager<T> where T : new()
|
||||||
{
|
{
|
@ -5,7 +5,7 @@ using System.IO;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
|
||||||
namespace Bloxstrap.Helpers
|
namespace Bloxstrap.Singletons
|
||||||
{
|
{
|
||||||
// https://stackoverflow.com/a/53873141/11852173
|
// https://stackoverflow.com/a/53873141/11852173
|
||||||
public class Logger
|
public class Logger
|
||||||
@ -27,7 +27,7 @@ namespace Bloxstrap.Helpers
|
|||||||
_filestream = File.Open(filename, FileMode.Create, FileAccess.Write, FileShare.Read);
|
_filestream = File.Open(filename, FileMode.Create, FileAccess.Write, FileShare.Read);
|
||||||
|
|
||||||
if (_backlog.Count > 0)
|
if (_backlog.Count > 0)
|
||||||
WriteToLog(String.Join("\r\n", _backlog));
|
WriteToLog(string.Join("\r\n", _backlog));
|
||||||
|
|
||||||
WriteLine($"[Logger::Logger] Initialized at {filename}");
|
WriteLine($"[Logger::Logger] Initialized at {filename}");
|
||||||
}
|
}
|
@ -5,9 +5,10 @@ using System.Text;
|
|||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Bloxstrap.Helpers
|
namespace Bloxstrap.Tools
|
||||||
{
|
{
|
||||||
// https://gist.github.com/dfederm/35c729f6218834b764fa04c219181e4e
|
// https://gist.github.com/dfederm/35c729f6218834b764fa04c219181e4e
|
||||||
|
|
||||||
public sealed class AsyncMutex : IAsyncDisposable
|
public sealed class AsyncMutex : IAsyncDisposable
|
||||||
{
|
{
|
||||||
private readonly string _name;
|
private readonly string _name;
|
@ -1,10 +1,14 @@
|
|||||||
// https://github.com/MaximumADHD/Roblox-Studio-Mod-Manager/blob/main/ProjectSrc/Utility/SystemEvent.cs
|
/*
|
||||||
|
* Roblox Studio Mod Manager (ProjectSrc/Utility/SystemEvent.cs)
|
||||||
|
* MIT License
|
||||||
|
* Copyright (c) 2015-present MaximumADHD
|
||||||
|
*/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Bloxstrap.Helpers.RSMM
|
namespace Bloxstrap.Tools
|
||||||
{
|
{
|
||||||
public class SystemEvent : EventWaitHandle
|
public class SystemEvent : EventWaitHandle
|
||||||
{
|
{
|
@ -9,7 +9,7 @@ using System.Threading.Tasks;
|
|||||||
using Bloxstrap.Properties;
|
using Bloxstrap.Properties;
|
||||||
using Bloxstrap.Views;
|
using Bloxstrap.Views;
|
||||||
|
|
||||||
namespace Bloxstrap.Helpers
|
namespace Bloxstrap
|
||||||
{
|
{
|
||||||
public class Updater
|
public class Updater
|
||||||
{
|
{
|
@ -6,9 +6,9 @@ using System.Security.Cryptography;
|
|||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Bloxstrap.Helpers
|
namespace Bloxstrap
|
||||||
{
|
{
|
||||||
public class Utilities
|
static class Utilities
|
||||||
{
|
{
|
||||||
public static bool IsDirectoryEmpty(string path)
|
public static bool IsDirectoryEmpty(string path)
|
||||||
{
|
{
|
@ -1,8 +1,4 @@
|
|||||||
using System.Windows.Input;
|
namespace Bloxstrap.ViewModels
|
||||||
using CommunityToolkit.Mvvm.Input;
|
|
||||||
using Bloxstrap.Helpers;
|
|
||||||
|
|
||||||
namespace Bloxstrap.ViewModels
|
|
||||||
{
|
{
|
||||||
public class AboutViewModel
|
public class AboutViewModel
|
||||||
{
|
{
|
||||||
|
@ -6,11 +6,12 @@ using System.Windows.Controls;
|
|||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
|
|
||||||
using CommunityToolkit.Mvvm.Input;
|
using CommunityToolkit.Mvvm.Input;
|
||||||
|
|
||||||
using Bloxstrap.Dialogs;
|
using Bloxstrap.Dialogs;
|
||||||
using Bloxstrap.Enums;
|
using Bloxstrap.Enums;
|
||||||
using Bloxstrap.Helpers.Extensions;
|
using Bloxstrap.Extensions;
|
||||||
using Bloxstrap.Views;
|
using Bloxstrap.Views;
|
||||||
|
|
||||||
namespace Bloxstrap.ViewModels
|
namespace Bloxstrap.ViewModels
|
||||||
|
@ -1,22 +1,4 @@
|
|||||||
using System;
|
namespace Bloxstrap.ViewModels
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows;
|
|
||||||
using System.Windows.Controls;
|
|
||||||
using System.Windows.Input;
|
|
||||||
using System.Windows.Media;
|
|
||||||
using Bloxstrap.Dialogs;
|
|
||||||
using Bloxstrap.Enums;
|
|
||||||
using Bloxstrap.Helpers.Extensions;
|
|
||||||
using Bloxstrap.Views;
|
|
||||||
using CommunityToolkit.Mvvm.Input;
|
|
||||||
using Wpf.Ui.Mvvm.Services;
|
|
||||||
using Wpf.Ui.Mvvm.Contracts;
|
|
||||||
|
|
||||||
namespace Bloxstrap.ViewModels
|
|
||||||
{
|
{
|
||||||
public class BehaviourViewModel
|
public class BehaviourViewModel
|
||||||
{
|
{
|
||||||
|
@ -10,11 +10,11 @@ using System.Windows.Media;
|
|||||||
using CommunityToolkit.Mvvm.Input;
|
using CommunityToolkit.Mvvm.Input;
|
||||||
using Bloxstrap.Dialogs;
|
using Bloxstrap.Dialogs;
|
||||||
using Bloxstrap.Enums;
|
using Bloxstrap.Enums;
|
||||||
using Bloxstrap.Helpers.Extensions;
|
using Bloxstrap.Extensions;
|
||||||
|
|
||||||
namespace Bloxstrap.ViewModels
|
namespace Bloxstrap.ViewModels
|
||||||
{
|
{
|
||||||
class FluentDialogViewModel : INotifyPropertyChanged
|
public class FluentDialogViewModel : INotifyPropertyChanged
|
||||||
{
|
{
|
||||||
public event PropertyChangedEventHandler? PropertyChanged;
|
public event PropertyChangedEventHandler? PropertyChanged;
|
||||||
public void OnPropertyChanged(string propertyName) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
public void OnPropertyChanged(string propertyName) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||||
|
@ -1,11 +1,6 @@
|
|||||||
using Bloxstrap.Helpers;
|
using System.Windows.Input;
|
||||||
|
|
||||||
using CommunityToolkit.Mvvm.Input;
|
using CommunityToolkit.Mvvm.Input;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows.Input;
|
|
||||||
|
|
||||||
namespace Bloxstrap.ViewModels
|
namespace Bloxstrap.ViewModels
|
||||||
{
|
{
|
||||||
|
@ -8,8 +8,8 @@ using System.Windows;
|
|||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using CommunityToolkit.Mvvm.Input;
|
using CommunityToolkit.Mvvm.Input;
|
||||||
using Bloxstrap.Helpers;
|
|
||||||
using Bloxstrap.Models;
|
using Bloxstrap.Models;
|
||||||
|
using Bloxstrap.Singletons;
|
||||||
|
|
||||||
namespace Bloxstrap.ViewModels
|
namespace Bloxstrap.ViewModels
|
||||||
{
|
{
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
using System.ComponentModel;
|
using System.Collections.ObjectModel;
|
||||||
|
using System.ComponentModel;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
|
|
||||||
using CommunityToolkit.Mvvm.Input;
|
using CommunityToolkit.Mvvm.Input;
|
||||||
|
|
||||||
using Bloxstrap.Helpers;
|
|
||||||
using Bloxstrap.Models;
|
using Bloxstrap.Models;
|
||||||
using System.Collections.ObjectModel;
|
|
||||||
|
|
||||||
namespace Bloxstrap.ViewModels
|
namespace Bloxstrap.ViewModels
|
||||||
{
|
{
|
||||||
|
@ -2,9 +2,11 @@
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using Bloxstrap.Helpers;
|
|
||||||
using Microsoft.Win32;
|
using Microsoft.Win32;
|
||||||
|
|
||||||
using CommunityToolkit.Mvvm.Input;
|
using CommunityToolkit.Mvvm.Input;
|
||||||
|
|
||||||
using Wpf.Ui.Controls.Interfaces;
|
using Wpf.Ui.Controls.Interfaces;
|
||||||
using Wpf.Ui.Mvvm.Contracts;
|
using Wpf.Ui.Mvvm.Contracts;
|
||||||
|
|
||||||
|
@ -3,9 +3,11 @@ using System.Collections.Generic;
|
|||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using Bloxstrap.Helpers;
|
|
||||||
using CommunityToolkit.Mvvm.Input;
|
using CommunityToolkit.Mvvm.Input;
|
||||||
|
|
||||||
|
using Bloxstrap.Singletons;
|
||||||
|
|
||||||
namespace Bloxstrap.ViewModels
|
namespace Bloxstrap.ViewModels
|
||||||
{
|
{
|
||||||
public class ModsViewModel : INotifyPropertyChanged
|
public class ModsViewModel : INotifyPropertyChanged
|
||||||
|
@ -1,11 +1,13 @@
|
|||||||
using System.Windows.Controls;
|
using System;
|
||||||
using System;
|
using System.Windows.Controls;
|
||||||
|
|
||||||
|
using Wpf.Ui.Appearance;
|
||||||
using Wpf.Ui.Controls.Interfaces;
|
using Wpf.Ui.Controls.Interfaces;
|
||||||
using Wpf.Ui.Mvvm.Contracts;
|
using Wpf.Ui.Mvvm.Contracts;
|
||||||
using Bloxstrap.Enums;
|
|
||||||
using Bloxstrap.ViewModels;
|
|
||||||
using Wpf.Ui.Mvvm.Services;
|
using Wpf.Ui.Mvvm.Services;
|
||||||
using Wpf.Ui.Appearance;
|
|
||||||
|
using Bloxstrap.Extensions;
|
||||||
|
using Bloxstrap.ViewModels;
|
||||||
|
|
||||||
namespace Bloxstrap.Views
|
namespace Bloxstrap.Views
|
||||||
{
|
{
|
||||||
|
@ -2,9 +2,9 @@
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
namespace Bloxstrap.Helpers
|
namespace Bloxstrap
|
||||||
{
|
{
|
||||||
public class WindowScaling
|
public static class WindowScaling
|
||||||
{
|
{
|
||||||
public static double GetFactor()
|
public static double GetFactor()
|
||||||
{
|
{
|
Loading…
Reference in New Issue
Block a user