private void Window_Loaded(object sender, RoutedEventArgs rea)
        {
            RM = new ResponsiveManager(this);
            RM.Handle();

            ManageModsDialog.DialogClosing += (s, e) =>
            {
                if (UnsavedChangesDialogOpened)
                {
                    e.Cancel();
                    return;
                }
                UnsavedChangesDialogOpened = true;

                if (ManageMods_CurrentSettingType == 0)
                {
                    var changes = ConfigChanges();
                    if (changes == 1 || changes == 2)
                    {
                        MessageBoxResult dialogResult = MessageBox.Show("You have some unsaved 'Mod Settings' changes. Would you like to save them?", "Unsaved changes", MessageBoxButton.YesNo, MessageBoxImage.Warning, MessageBoxResult.OK, MessageBoxOptions.DefaultDesktopOnly);
                        if (dialogResult == MessageBoxResult.Yes)
                        {
                            if (changes == 2)
                            {
                                e.Cancel();
                            }
                            ConfigSaveButton_Click(null, null);
                        }
                    }
                    UnsavedChangesDialogOpened = false;
                }
                else if (ManageMods_CurrentSettingType == 1)
                {
                    var changes = BindChanges();
                    if (changes == 1 || changes == 2)
                    {
                        MessageBoxResult dialogResult = MessageBox.Show("You have some unsaved 'Mod Binds' changes. Would you like to save them?", "Unsaved changes", MessageBoxButton.YesNo, MessageBoxImage.Warning, MessageBoxResult.OK, MessageBoxOptions.DefaultDesktopOnly);
                        if (dialogResult == MessageBoxResult.Yes)
                        {
                            if (changes == 2)
                            {
                                e.Cancel();
                            }
                            ConfigSaveButton_Click(null, null);
                        }
                    }
                    UnsavedChangesDialogOpened = false;
                }
                else
                {
                    UnsavedChangesDialogOpened = false;
                }
            };

            Nav_Button_Overview.Click += (s, e) => SelectNavItem(0);
            Nav_Button_Mods.Click     += (s, e) => SelectNavItem(1);

            Nav_Button_Settings.Click += Nav_Button_Settings_Click;

            Overview_Button_PlayGame.MouseEnter   += Overview_Button_PlayGame_MouseEnter;
            Overview_Button_PlayGame.MouseLeave   += Overview_Button_PlayGame_MouseLeave;
            Overview_Button_ManageMods.MouseEnter += Overview_Button_ManageMods_MouseEnter;
            Overview_Button_ManageMods.MouseLeave += Overview_Button_ManageMods_MouseLeave;

            Overview_Button_PlayGame.MouseUp   += Overview_Button_PlayGame_MouseUp;
            Overview_Button_ManageMods.MouseUp += Overview_Button_ManageMods_MouseUp;

            Settings = SH2WorkshopFileHandler.GetSettings();

            if (SH2WorkshopFileHandler.IsInternalModFilesInstalled())
            {
                Overview_Button_PlayGame_Text.Text = "Play Shrek 2 Modded";
            }
            else
            {
                Overview_Button_PlayGame_Text.Text = "Install Shrek 2 Modded";
            }

            Mods = Mod.GetMods();
            OverviewModsList.ItemsSource = Mod.VisualMod.ToVisualMods(Mods.Take(4).ToList());
        }
        private async void InstallButton_Click(object sender, RoutedEventArgs e)
        {
            Settings = SH2WorkshopFileHandler.GetSettings();

            if (string.IsNullOrWhiteSpace(Settings.GameFolderLocation))
            {
                MessageBox.Show("You have not setup the Shrek 2 Game.exe in the Settings! You need to set it up before you can play mods directly!");
                return;
            }

            if (!SH2WorkshopFileHandler.IsInternalModFilesInstalled())
            {
                MessageBox.Show("Before you can install a mod you need to install the Mod Framework by pressing the button 'Install Shrek 2 Modded' on the Overview Page!");
                return;
            }

            Button btn        = sender as Button;
            var    dataObject = btn.DataContext as Mod.VisualMod;

            if (IsDownloading)
            {
                return;
            }

            var Mod = dataObject.Mod;

            if (SH2WorkshopFileHandler.IsModInstalled(Mod.ModGUID))
            {
                if (dataObject.UpdateAvailable)
                {
                    if (string.IsNullOrWhiteSpace(Settings.GameFolderLocation))
                    {
                        MessageBox.Show("You have not setup the Shrek 2 Game.exe in the Settings! You need to set it up before you can play mods directly!");
                        return;
                    }

                    IsDownloading = true;
                    var Downloaded = await SH2WorkshopFileHandler.UpdateMod(Mod, (s, p) =>
                    {
                        btn.Content = $"{p.ProgressPercentage}%";
                    });

                    if (Downloaded)
                    {
                        SH2WorkshopFileHandler.ExtractModFile(Mod.ModGUID);
                        if (SH2WorkshopFileHandler.IsModInstalled(Mod.ModGUID))
                        {
                            Downloaded = true;
                        }
                    }
                    else
                    {
                        MessageBox.Show($"Failed to download '{Mod.Name}'. Try again later!");
                    }

                    SH2WorkshopFileHandler.HandleDefUserChanges();
                    RefreshMods();
                    IsDownloading = false;
                }
                else
                {
                    if (string.IsNullOrWhiteSpace(Settings.GameFolderLocation))
                    {
                        MessageBox.Show("You have not setup the Shrek 2 Game.exe in the Settings! You need to set it up before you can play mods directly!");
                        return;
                    }

                    bool uninstalled = SH2WorkshopFileHandler.UninstallMod(Mod);
                    if (uninstalled)
                    {
                        SH2WorkshopFileHandler.HandleDefUserChanges();
                        RefreshMods();
                    }
                    IsDownloading = false;
                }
            }
            else
            {
                // Update Mod
                IsDownloading = true;
                var Downloaded = await SH2WorkshopFileHandler.DownloadMod(Mod, (s, p) =>
                {
                    btn.Content = $"{p.ProgressPercentage}%";
                });

                if (Downloaded)
                {
                    SH2WorkshopFileHandler.ExtractModFile(Mod.ModGUID);
                    if (SH2WorkshopFileHandler.IsModInstalled(Mod.ModGUID))
                    {
                        Downloaded = true;
                    }
                }
                else
                {
                    MessageBox.Show($"Failed to update '{Mod.Name}'. Try again later!");
                }

                SH2WorkshopFileHandler.HandleDefUserChanges();
                RefreshMods();
                IsDownloading = false;
            }
        }