Пример #1
0
        /// <summary>
        /// Registers simple click handlers
        /// </summary>
        private void RegisterClickHandlers()
        {
            this.btnClearArguments.Click += (o, args) => this.tbArguments.Clear();

            this.btnClose.Click += (o, args) => LaunchManager.Exit();

            this.btnHelp.Click += (o, args) => LaunchManager.TryOpenTextFile(LaunchManager.TxtPathReadme);

            this.btnPatreon.Click += (o, args) => GoToURL("https://www.patreon.com/fireundubh");

            this.btnPayPal.Click += (o, args) => GoToURL("https://www.nexusmods.com/Core/Libs/Common/Widgets/PayPalPopUp?user=513981");

            this.btnLaunchNoMods.Click += (o, args) =>
            {
                ResetData();
                this.ClientType = SetClientType();
                LaunchManager.LaunchProcess(this.ClientType);
            };

            this.btnLaunchWithMods.Click += async(o, args) =>
            {
                ResetData();
                this.ClientType = SetClientType();
                await this.btnLaunchWithMods_ClickAsync(o, args).ConfigureAwait(false);
            };

            this.btnTestRun.Click += (o, args) =>
            {
                ResetData();
                this.btnTestRun_Click(o, args);
            };

            this.lblPatchwork.LinkClicked += (o, args) => GoToURL(PatchworkInfo.PatchworkSite);
        }
Пример #2
0
        public static void Initialize()
        {
            // we need to run setup here so we can combine the registry path with the executable filename
            Logger.Debug("Trying to set up AppContextManager for first time. Due to serialization speed, this could fail. Retry after initializing PatchManager.");
            AppContextManager.Setup();

            // try to get game path from xml settings
            string gamePath = SettingsManager.XmlData.GamePath;

            if (!File.Exists(gamePath))
            {
                // try to get game path from windows registry
                if (Environment.OSVersion.Platform == PlatformID.Win32NT)
                {
                    if (string.IsNullOrEmpty(gamePath) || !Directory.Exists(gamePath))
                    {
                        gamePath = SettingsManager.GetGamePathFromRegistry();
                        SettingsManager.XmlData.GamePath = gamePath;
                    }
                }

                // try to get game path from user
                if (string.IsNullOrEmpty(gamePath) || !Directory.Exists(gamePath))
                {
                    DialogResult result = AppContextManager.AskPath(new GameFolderBrowserDialogSettings
                    {
                        Description = "Select folder containing game executable"
                    });

                    if (result == DialogResult.Cancel)
                    {
                        LaunchManager.Exit();
                    }
                }
            }

            AddPatchesFromFolder();
        }
 private void btnClose_Click(object sender, EventArgs e)
 {
     LaunchManager.Exit();
 }