예제 #1
0
        public Main()
        {
            string[] args = Environment.GetCommandLineArgs();
            FormLoadInitialSettings(args, out bool showChangelog, out bool BAKprompt);

            InitializeComponent();
            C_SAV.SetEditEnvironment(new SaveDataEditor <PictureBox>(new FakeSaveFile(), PKME_Tabs));
            FormLoadAddEvents();
            #if DEBUG // translation updater -- all controls are added at this point -- call translate now
            if (DevUtil.IsUpdatingTranslations)
            {
                WinFormsUtil.TranslateInterface(this, CurrentLanguage); // Translate the UI to language.
            }
            #endif
            FormInitializeSecond();
            FormLoadCheckForUpdates();

            var startup = new StartupArguments();
            startup.ReadArguments(args);
            startup.ReadSettings(Settings.Startup);
            startup.ReadTemplateIfNoEntity(TemplatePath);
            FormLoadInitialFiles(startup);

            if (Settings.Startup.PluginLoadMethod != PluginLoadSetting.DontLoad)
            {
                FormLoadPlugins();
            }

            if (HaX)
            {
                PKMConverter.AllowIncompatibleConversion = true;
                WinFormsUtil.Alert(MsgProgramIllegalModeActive, MsgProgramIllegalModeBehave);
            }
            else if (showChangelog)
            {
                ShowAboutDialog(AboutPage.Changelog);
            }

            if (BAKprompt && !Directory.Exists(BackupPath))
            {
                PromptBackup();
            }

            BringToFront();
            WindowState = FormWindowState.Minimized;
            Show();
            WindowState = FormWindowState.Normal;
        }
예제 #2
0
        public Main()
        {
            Form splash = null; // popup a splash screen in another thread

            new Task(() => (splash = new SplashScreen()).ShowDialog()).Start();
            new Task(() => EncounterEvent.RefreshMGDB(MGDatabasePath)).Start();
            string[] args = Environment.GetCommandLineArgs();
            FormLoadInitialSettings(args, out bool showChangelog, out bool BAKprompt);

            InitializeComponent();
            C_SAV.SetEditEnvironment(new SaveDataEditor <PictureBox>(null, PKME_Tabs));
            FormLoadAddEvents();
            #if DEBUG // translation updater -- all controls are added at this point -- call translate now
            if (DevUtil.IsUpdatingTranslations)
            {
                WinFormsUtil.TranslateInterface(this, CurrentLanguage); // Translate the UI to language.
            }
            #endif
            FormInitializeSecond();

            FormLoadCustomBackupPaths();
            FormLoadInitialFiles(args);
            FormLoadCheckForUpdates();
            FormLoadPlugins();

            BringToFront();
            WindowState = FormWindowState.Minimized;
            Show();
            WindowState = FormWindowState.Normal;
            splash.Invoke((MethodInvoker)(() => splash.Close())); // splash closes
            if (HaX)
            {
                PKMConverter.AllowIncompatibleConversion = true;
                WinFormsUtil.Alert(MsgProgramIllegalModeActive, MsgProgramIllegalModeBehave);
            }
            else if (showChangelog)
            {
                ShowAboutDialog(1);
            }

            if (BAKprompt && !Directory.Exists(BackupPath))
            {
                PromptBackup();
            }
        }