示例#1
0
        private void MetroWindow_ContentRendered(object sender, EventArgs e)
        {
            string installPath = GameFinder.GetLocationViaUninstallEntry();

            if (GameFinder.VerifyInstallPath(installPath))
            {
                ConfirmButton.IsEnabled = true;
                PathTextBox.Text        = installPath;
            }
            else
            {
                BannerlordPathFailed(0);
            }
        }
示例#2
0
        private void ButtonClick_Manager(object sender, RoutedEventArgs e)
        {
            if (sender == BrowsePathButton)
            {
                using (var folderBrowser = new WinForms.FolderBrowserDialog())
                {
                    folderBrowser.RootFolder          = Environment.SpecialFolder.MyComputer;
                    folderBrowser.ShowNewFolderButton = false;
                    folderBrowser.Description         = "Browse to M&B 2: Bannerlord Root Folder";

                    WinForms.DialogResult dialogResult = folderBrowser.ShowDialog();
                    if (dialogResult == WinForms.DialogResult.OK)
                    {
                        if (GameFinder.VerifyInstallPath(folderBrowser.SelectedPath))
                        {
                            ConfirmButton.IsEnabled = true;
                            PathTextBox.Text        = folderBrowser.SelectedPath;
                        }
                        else
                        {
                            BannerlordPathFailed(1);
                        }
                    }
                    else
                    {
                        // User cancelled or closed the dialog
                    }
                }
            }

            if (sender == ConfirmButton)
            {
                this.DialogResult = true;
            }

            if (sender == CancelButton)
            {
                this.DialogResult = false;
            }

            if (sender == GitHubButton)
            {
                System.Diagnostics.Process.Start("https://github.com/Dealman/BannerlordModTemplate");
            }

            if (sender == ForumButton)
            {
                System.Diagnostics.Process.Start("https://forums.taleworlds.com/index.php?threads/release-mod-template-for-visual-studio-automatically-configs-adds-references-and-more.413981/");
            }
        }