Пример #1
0
        private void ApplyConfig(MainForm.MainForm mainForm)
        {
            if (CheckForUpdatesOnStartup && AutomaticUpdater.UpdateHeroesPowerPlant(out _))
            {
                mainForm.AfterUpdate();
            }
            else
            {
                if (AutomaticallyLoadLastConfig && File.Exists(LastProjectPath))
                {
                    var config = ProjectConfig.Open(LastProjectPath);
                    ProjectConfig.ApplyInstance(mainForm, config);
                    mainForm.currentSavePath = LastProjectPath;
                }

                if (VSync)
                {
                    mainForm.EnableVSync();
                }
                else
                {
                    mainForm.DisableVSync(); // In case the program default ever changes.
                }
                mainForm.SetCheckForUpdatesOnStartup(CheckForUpdatesOnStartup);
                mainForm.SetAutoLoadLastProject(AutomaticallyLoadLastConfig);
                mainForm.SetAutomaticallySaveConfig(AutomaticallySaveConfig);
            }
        }