diff --git a/ModAssistant.sln b/ModAssistant.sln new file mode 100644 index 0000000..5643d23 --- /dev/null +++ b/ModAssistant.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.27130.2027 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ModAssistant", "ModAssistant\ModAssistant.csproj", "{6A224B82-40DA-40B3-94DC-EFBEC2BDDA39}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {6A224B82-40DA-40B3-94DC-EFBEC2BDDA39}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6A224B82-40DA-40B3-94DC-EFBEC2BDDA39}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6A224B82-40DA-40B3-94DC-EFBEC2BDDA39}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6A224B82-40DA-40B3-94DC-EFBEC2BDDA39}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {ACC0D20B-78C5-40AC-BF48-553C41D9987B} + EndGlobalSection +EndGlobal diff --git a/ModAssistant/App.config b/ModAssistant/App.config new file mode 100644 index 0000000..1e43f2a --- /dev/null +++ b/ModAssistant/App.config @@ -0,0 +1,42 @@ + + + + +
+
+ + + + + + + + + + + + + + + False + + + False + + + False + + + False + + + + + + + + + + + + \ No newline at end of file diff --git a/ModAssistant/App.xaml b/ModAssistant/App.xaml new file mode 100644 index 0000000..28e6858 --- /dev/null +++ b/ModAssistant/App.xaml @@ -0,0 +1,9 @@ + + + + + diff --git a/ModAssistant/App.xaml.cs b/ModAssistant/App.xaml.cs new file mode 100644 index 0000000..88ed435 --- /dev/null +++ b/ModAssistant/App.xaml.cs @@ -0,0 +1,58 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Linq; +using System.Threading.Tasks; +using System.Windows; +using ModAssistant; + +namespace ModAssistant +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + public static string BeatSaberInstallDirectory; + public static string BeatSaberInstallType; + public static bool SaveModSelection; + public static bool CheckInstalledMods; + public static List SavedMods = ModAssistant.Properties.Settings.Default.SavedMods.Split(',').ToList(); + + + private void Application_Startup(object sender, StartupEventArgs e) + { + BeatSaberInstallDirectory = Utils.GetInstallDir(); + BeatSaberInstallType = ModAssistant.Properties.Settings.Default.StoreType; + SaveModSelection = ModAssistant.Properties.Settings.Default.SaveSelected; + //CheckInstalledMods = ModAssistant.Properties.Settings.Default.CheckInstalled; + + if (e.Args.Length == 0) + { + MainWindow window = new MainWindow(); + window.Show(); + } + else + { + ArgumentHandler(e.Args); + } + } + + private void ArgumentHandler(string[] Args) + { + Utils.SendNotify(Args[0]); + } + + private void Application_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e) + { + MessageBox.Show("An unhandled exception just occurred: " + e.Exception.Message, "Exception", MessageBoxButton.OK, MessageBoxImage.Warning); + e.Handled = true; + } + + public void RegisterOneClickInstalls () + { + + } + } +} diff --git a/ModAssistant/Classes/Diagnostics.cs b/ModAssistant/Classes/Diagnostics.cs new file mode 100644 index 0000000..ccc6947 --- /dev/null +++ b/ModAssistant/Classes/Diagnostics.cs @@ -0,0 +1,62 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; + +namespace ModAssistant +{ + class Diagnostics + { + public static string[] ReadFolder(string path, int level = 0) + { + List entries = new List(); + + foreach (string file in Directory.GetFileSystemEntries(path)) + { + string line = String.Empty; + + if (File.Exists(file)) + { + line = Utils.CalculateMD5(file) + " " +LevelSeparator(level) + "├─ " + Path.GetFileName(file); + entries.Add(line); + + } + else if (Directory.Exists(file)) + { + line = Utils.Constants.MD5Spacer + LevelSeparator(level) + "├─ " + Path.GetFileName(file); + entries.Add(line); + + foreach (string entry in ReadFolder(file.Replace(@"\", @"\\"), level + 1)) + { + //MessageBox.Show(entry); + entries.Add(entry); + } + + } + else + { + MessageBox.Show("! " + file); + } + + + } + if (entries.Count > 0) + entries[entries.Count - 1] = entries[entries.Count - 1].Replace("├", "└"); + + return entries.ToArray(); + } + + private static string LevelSeparator(int level) + { + string separator = String.Empty; + for(int i = 0; i < level; i++) + { + separator = separator + "│ "; + } + return separator; + } + } +} diff --git a/ModAssistant/Classes/Mod.cs b/ModAssistant/Classes/Mod.cs new file mode 100644 index 0000000..6a85f05 --- /dev/null +++ b/ModAssistant/Classes/Mod.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; +using ModAssistant.Pages; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ModAssistant +{ + public class Mod + { + public string name; + public string version; + public string _id; + public string authorId; + public string uploadedDate; + public string updatedDate; + public Author author; + public string description; + public string link; + public string category; + public DownloadLink[] downloads; + public bool required; + public Dependency[] dependencies; + public List Dependents = new List(); + public Mods.ModListItem ListItem; + + public class Author + { + public string _id; + public string username; + public string lastLogin; + } + + public class DownloadLink + { + public string type; + public string url; + public FileHashes[] hashMd5; + } + + public class FileHashes + { + public string hash; + public string file; + } + + public class Dependency + { + public string name; + public string _id; + public Mod Mod; + } + } +} diff --git a/ModAssistant/Classes/OneClickInstaller.cs b/ModAssistant/Classes/OneClickInstaller.cs new file mode 100644 index 0000000..40d9ffd --- /dev/null +++ b/ModAssistant/Classes/OneClickInstaller.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ModAssistant +{ + class OneClickInstaller + { + private const string ModelSaberURLPrefix = "https://modelsaber.com/files"; + + private const string CustomAvatarsFolder = "CustomAvatars"; + private const string CustomSabersFolder = "CustomSabers"; + private const string CustomPlatformsFolder = "CustomPlatforms"; + + private static readonly string[] Protocols = new[] { "modsaber" }; + + public static void InstallAsset(string link) + { + Uri uri = new Uri(link); + if (!Protocols.Contains(uri.Scheme)) return; + + + + } + + private static bool DownloadAsset(string link, string folder) + { + string BeatSaberPath = ""; + if (string.IsNullOrEmpty(BeatSaberPath)) + { + Utils.SendNotify("Beat Saber installation path not found."); + return false; + } + return false; + } + + + } +} diff --git a/ModAssistant/Classes/Utils.cs b/ModAssistant/Classes/Utils.cs new file mode 100644 index 0000000..55affb8 --- /dev/null +++ b/ModAssistant/Classes/Utils.cs @@ -0,0 +1,256 @@ +using Microsoft.Win32; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Security.Cryptography; +using System.Text; +using System.Text.RegularExpressions; +using System.Threading.Tasks; +using System.Windows; +using System.Management; +using ModAssistant.Properties; + +namespace ModAssistant +{ + public class Utils + { + public class Constants + { + public const string BeatSaberAPPID = "620980"; + public const string BeatModsAPIUrl = "https://beatmods.com/api/v1/"; + public const string BeatModsURL = "https://beatmods.com"; + public const string BeatModsModsOptions = "mod?status=approved"; + public const string MD5Spacer = " "; + } + + public static void SendNotify(string message, string title = "Mod Assistant") + { + var notification = new System.Windows.Forms.NotifyIcon() + { + Visible = true, + Icon = System.Drawing.SystemIcons.Information, + BalloonTipTitle = title, + BalloonTipText = message + }; + + notification.ShowBalloonTip(5000); + + notification.Dispose(); + } + + public static string CalculateMD5(string filename) + { + using (var md5 = MD5.Create()) + { + using (var stream = File.OpenRead(filename)) + { + var hash = md5.ComputeHash(stream); + return BitConverter.ToString(hash).Replace("-", "").ToLowerInvariant(); + } + } + } + + public static string GetInstallDir() + { + string InstallDir = null; + + InstallDir = Properties.Settings.Default.InstallFolder; + if (!String.IsNullOrEmpty(InstallDir)) + { + return InstallDir; + } + + InstallDir = GetSteamDir(); + if (!String.IsNullOrEmpty(InstallDir)) + { + return InstallDir; + } + + InstallDir = GetOculusDir(); + if (!String.IsNullOrEmpty(InstallDir)) + { + return InstallDir; + } + + MessageBox.Show("Could not detect your Beat Saber install folder. Please select it manually."); + + InstallDir = GetManualDir(); + if (!String.IsNullOrEmpty(InstallDir)) + { + return InstallDir; + } + + return null; + } + + public static string SetDir(string directory, string store) + { + App.BeatSaberInstallDirectory = directory; + App.BeatSaberInstallType = store; + Properties.Settings.Default.InstallFolder = directory; + Properties.Settings.Default.StoreType = store; + Properties.Settings.Default.Save(); + return directory; + } + + public static string GetSteamDir() + { + + string SteamInstall = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64)?.OpenSubKey("SOFTWARE")?.OpenSubKey("WOW6432Node")?.OpenSubKey("Valve")?.OpenSubKey("Steam")?.GetValue("InstallPath").ToString(); + if (String.IsNullOrEmpty(SteamInstall)) + { + SteamInstall = Registry.LocalMachine.OpenSubKey("SOFTWARE")?.OpenSubKey("WOW6432Node")?.OpenSubKey("Valve")?.OpenSubKey("Steam")?.GetValue("InstallPath").ToString(); + } + if (String.IsNullOrEmpty(SteamInstall)) return null; + + string vdf = Path.Combine(SteamInstall, @"steamapps\libraryfolders.vdf"); + if (!File.Exists(@vdf)) return null; + + Regex regex = new Regex("\\s\"\\d\"\\s+\"(.+)\""); + List SteamPaths = new List(); + SteamPaths.Add(Path.Combine(SteamInstall, @"steamapps")); + + using (StreamReader reader = new StreamReader(@vdf)) + { + string line; + while ((line = reader.ReadLine()) != null) + { + Match match = regex.Match(line); + if (match.Success) + { + SteamPaths.Add(Path.Combine(match.Groups[1].Value.Replace(@"\\", @"\"), @"steamapps")); + } + } + } + + regex = new Regex("\\s\"installdir\"\\s+\"(.+)\""); + foreach (string path in SteamPaths) + { + if (File.Exists(Path.Combine(@path, @"appmanifest_" + Constants.BeatSaberAPPID + ".acf"))) + { + using (StreamReader reader = new StreamReader(Path.Combine(@path, @"appmanifest_" + Constants.BeatSaberAPPID + ".acf"))) + { + string line; + while ((line = reader.ReadLine()) != null) + { + Match match = regex.Match(line); + if (match.Success) + { + if (File.Exists(Path.Combine(@path, @"common", match.Groups[1].Value, "Beat Saber.exe"))) + { + return SetDir(Path.Combine(@path, @"common", match.Groups[1].Value), "Steam"); + } + } + } + } + } + } + return null; + } + + public static string GetOculusDir() + { + string OculusInstall = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64)?.OpenSubKey("SOFTWARE")?.OpenSubKey("Wow6432Node")?.OpenSubKey("Oculus VR, LLC")?.OpenSubKey("Oculus")?.OpenSubKey("Config")?.GetValue("InitialAppLibrary").ToString(); + if (String.IsNullOrEmpty(OculusInstall)) return null; + + if (!String.IsNullOrEmpty(OculusInstall)) + { + if (File.Exists(Path.Combine(OculusInstall, @"Software\hyperbolic-magnetism-beat-saber", "Beat Saber.exe"))) + { + return SetDir(Path.Combine(OculusInstall + @"Software\hyperbolic-magnetism-beat-saber"), "Oculus"); + } + } + + // Yoinked this code from Umbranox's Mod Manager. Lot's of thanks and love for Umbra <3 + using (RegistryKey librariesKey = Registry.CurrentUser.OpenSubKey("Software")?.OpenSubKey("Oculus VR, LLC")?.OpenSubKey("Oculus")?.OpenSubKey("Libraries")) + { + // Oculus libraries uses GUID volume paths like this "\\?\Volume{0fea75bf-8ad6-457c-9c24-cbe2396f1096}\Games\Oculus Apps", we need to transform these to "D:\Game"\Oculus Apps" + WqlObjectQuery wqlQuery = new WqlObjectQuery("SELECT * FROM Win32_Volume"); + ManagementObjectSearcher searcher = new ManagementObjectSearcher(wqlQuery); + Dictionary guidLetterVolumes = new Dictionary(); + + foreach (ManagementBaseObject disk in searcher.Get()) + { + var diskId = ((string)disk.GetPropertyValue("DeviceID")).Substring(11, 36); + var diskLetter = ((string)disk.GetPropertyValue("DriveLetter")) + @"\"; + + if (!string.IsNullOrWhiteSpace(diskLetter)) + { + guidLetterVolumes.Add(diskId, diskLetter); + } + } + + // Search among the library folders + foreach (string libraryKeyName in librariesKey.GetSubKeyNames()) + { + using (RegistryKey libraryKey = librariesKey.OpenSubKey(libraryKeyName)) + { + string libraryPath = (string)libraryKey.GetValue("Path"); + string finalPath = Path.Combine(guidLetterVolumes.First(x => libraryPath.Contains(x.Key)).Value, libraryPath.Substring(49), @"Software\hyperbolic-magnetism-beat-saber"); + + if (File.Exists(Path.Combine(finalPath, "Beat Saber.exe"))) + { + return SetDir(finalPath, "Oculus"); + } + } + } + } + return null; + } + /* + public static string GetManualDir() + { + + CommonOpenFileDialog dialog = new CommonOpenFileDialog() + { + IsFolderPicker = true, + Multiselect = false, + Title = "Select your Beat Saber installation folder" + }; + + if (dialog.ShowDialog() == CommonFileDialogResult.Ok) + { + return dialog.FileName; + } + + return null; + }*/ + + public static string GetManualDir() + { + var dialog = new Microsoft.Win32.SaveFileDialog() + { + Title = "Select your Beat Saber install folder", + Filter = "Directory|*.this.directory", + FileName = "select" + }; + + if (dialog.ShowDialog() == true) + { + string path = dialog.FileName; + path = path.Replace("\\select.this.directory", ""); + path = path.Replace(".this.directory", ""); + if (!System.IO.Directory.Exists(path)) + { + System.IO.Directory.CreateDirectory(path); + } + if (File.Exists(Path.Combine(path, "Beat Saber.exe"))) + { + string store; + if (File.Exists(Path.Combine(path, "Beat Saber_Data", "Plugins", "steam_api64.dll"))) + { + store = "Steam"; + } + else + { + store = "Oculus"; + } + return SetDir(path, store); + } + } + return null; + } + + } +} diff --git a/ModAssistant/MainWindow.xaml b/ModAssistant/MainWindow.xaml new file mode 100644 index 0000000..ca2257d --- /dev/null +++ b/ModAssistant/MainWindow.xaml @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ModAssistant/MainWindow.xaml.cs b/ModAssistant/MainWindow.xaml.cs new file mode 100644 index 0000000..5a9af60 --- /dev/null +++ b/ModAssistant/MainWindow.xaml.cs @@ -0,0 +1,97 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Net; +using System.IO; +using System.Web.Script.Serialization; +using System.Runtime.Serialization; +using ModAssistant.Pages; + +namespace ModAssistant +{ + /// + /// Interaction logic for MainWindow.xaml + /// + public partial class MainWindow : Window + { + public static MainWindow Instance; + //private delegate void SetStatusCallback(string message); + //public static Mods ModWindow = new Mods(); + + public string MainText + { + get + { + return MainTextBlock.Text; + } + set + { + Dispatcher.Invoke(new Action(() => { MainWindow.Instance.MainTextBlock.Text = value; })); + } + } + + public MainWindow() + { + InitializeComponent(); + Instance = this; + + if (Properties.Settings.Default.Agreed) + { + MainWindow.Instance.ModsButton.IsEnabled = true; + } + + //Main.Content = Mods.Instance; + Main.Content = Intro.Instance; + } + + private void ModsButton_Click(object sender, RoutedEventArgs e) + { + Main.Content = Mods.Instance; + } + + private void IntroButton_Click(object sender, RoutedEventArgs e) + { + Main.Content = Intro.Instance; + } + + private void AboutButton_Click(object sender, RoutedEventArgs e) + { + Main.Content = About.Instance; + } + + private void OptionsButton_Click(object sender, RoutedEventArgs e) + { + Main.Content = Options.Instance; + } + + private void InstallButton_Click(object sender, RoutedEventArgs e) + { + Mods.Instance.InstallMods(); + } + + private void InfoButton_Click(object sender, RoutedEventArgs e) + { + Mods.ModListItem mod = ((Mods.ModListItem)Mods.Instance.ModsListView.SelectedItem); + string infoUrl = mod.ModInfo.link; + if (String.IsNullOrEmpty(infoUrl)) + { + MessageBox.Show(mod.ModName + " does not have an info page"); + } + else + { + System.Diagnostics.Process.Start(infoUrl); + } + } + } +} diff --git a/ModAssistant/ModAssistant.csproj b/ModAssistant/ModAssistant.csproj new file mode 100644 index 0000000..5c5cb52 --- /dev/null +++ b/ModAssistant/ModAssistant.csproj @@ -0,0 +1,147 @@ + + + + + Debug + AnyCPU + {6A224B82-40DA-40B3-94DC-EFBEC2BDDA39} + WinExe + ModAssistant + ModAssistant + v4.6.1 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + Resources\icon.ico + + + + + + + + + + + + + + + + + + 4.0 + + + + + + + + MSBuild:Compile + Designer + + + + Intro.xaml + + + + Mods.xaml + + + About.xaml + + + + Designer + MSBuild:Compile + + + MSBuild:Compile + Designer + + + App.xaml + Code + + + + MainWindow.xaml + Code + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + + + Options.xaml + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + ResXFileCodeGenerator + Resources.Designer.cs + + + PublicSettingsSingleFileGenerator + Settings.Designer.cs + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ModAssistant/Pages/About.xaml b/ModAssistant/Pages/About.xaml new file mode 100644 index 0000000..c7e244b --- /dev/null +++ b/ModAssistant/Pages/About.xaml @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + + + + + + About Mod Assistant + + I'm Assistant, and I made Mod Assistant as an alternative to the + + Mod Manager + + and + + BeatDrop + + with a few principles in mind: + + + + + + + + If you enjoy this program and would like to support me, please visit my + + donation page + + or my + + Patreon + + + + + + + + + + + vanZeben + + + Creating BeatMods + The current Mod repository + Used by this Installer + + + + + + + Umbranox + + + Inspiration + Creating the Mod Manager + + + + + + lolPants + + + Inspiration + Creating ModSaber + The first Mod repository + + + Donate + + + + + + + + + diff --git a/ModAssistant/Pages/About.xaml.cs b/ModAssistant/Pages/About.xaml.cs new file mode 100644 index 0000000..01ed5c6 --- /dev/null +++ b/ModAssistant/Pages/About.xaml.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace ModAssistant.Pages +{ + /// + /// Interaction logic for Page1.xaml + /// + public partial class About : Page + { + public static About Instance = new About(); + + public About() + { + InitializeComponent(); + } + + private void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e) + { + Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri)); + e.Handled = true; + } + } +} diff --git a/ModAssistant/Pages/Intro.xaml b/ModAssistant/Pages/Intro.xaml new file mode 100644 index 0000000..26b1253 --- /dev/null +++ b/ModAssistant/Pages/Intro.xaml @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + Welcome to Mod Assistant + + + + + Beat Saber does not natively support mods. This means: + + + + Mods will break every update. This is normal, and not Beat Games' fault. + + + + Mods will cause bugs and performance issues. This is not Beat Games' fault. + + + + Mods are made for free by people in their free time. Please be patient and understanding. + + + + DO NOT leave negative reviews because mods broke. This is not Beat Games' fault. They are not trying to kill mods. + + + + If I keep seeing people leave negative reviews because mods broke, I will personally kill mods with a rusty spoon + + + + Please read the Beginners Guide on the + + Wiki + . + + + + + + + + diff --git a/ModAssistant/Pages/Intro.xaml.cs b/ModAssistant/Pages/Intro.xaml.cs new file mode 100644 index 0000000..049ade7 --- /dev/null +++ b/ModAssistant/Pages/Intro.xaml.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace ModAssistant.Pages +{ + /// + /// Interaction logic for Intro.xaml + /// + public partial class Intro : Page + { + public static Intro Instance = new Intro(); + + public Intro() + { + InitializeComponent(); + } + + private void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e) + { + Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri)); + e.Handled = true; + } + + private void Disagree_Click(object sender, RoutedEventArgs e) + { + MessageBox.Show("Closing Application: You did not agree to terms and conditions."); + System.Windows.Application.Current.Shutdown(); + } + + private void Agree_Click(object sender, RoutedEventArgs e) + { + MainWindow.Instance.ModsButton.IsEnabled = true; + Properties.Settings.Default.Agreed = true; + Properties.Settings.Default.Save(); + } + } +} diff --git a/ModAssistant/Pages/Mods.xaml b/ModAssistant/Pages/Mods.xaml new file mode 100644 index 0000000..b4308b1 --- /dev/null +++ b/ModAssistant/Pages/Mods.xaml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +