Exemple #1
0
        protected override void OnShown(EventArgs e)
        {
            base.OnShown(e);

            EmuApi.InitDll();
            ConfigManager.Config.Video.ApplyConfig();
            EmuApi.InitializeEmu(ConfigManager.HomeFolder, Handle, ctrlRenderer.Handle, false, false, false);

            ConfigManager.Config.InitializeDefaults();
            ConfigManager.Config.ApplyConfig();

            _displayManager = new DisplayManager(this, ctrlRenderer, pnlRenderer, mnuMain, ctrlRecentGames);
            _displayManager.UpdateViewerSize();
            _shortcuts = new ShortcutHandler(_displayManager);

            _notifListener = new NotificationListener();
            _notifListener.OnNotification += OnNotificationReceived;

            SaveStateManager.InitializeStateMenu(mnuSaveState, true, _shortcuts);
            SaveStateManager.InitializeStateMenu(mnuLoadState, false, _shortcuts);

            BindShortcuts();

            ctrlRecentGames.Initialize();
            ResizeRecentGames();

            _commandLine.LoadGameFromCommandLine();
            if (!EmuRunner.IsRunning())
            {
                ctrlRecentGames.Visible = true;
            }

            this.Resize += frmMain_Resize;
        }
Exemple #2
0
        protected override void OnShown(EventArgs e)
        {
            base.OnShown(e);

            EmuApi.InitDll();
            bool showUpgradeMessage = UpdateHelper.PerformUpgrade();

            ConfigManager.Config.Video.ApplyConfig();
            EmuApi.InitializeEmu(ConfigManager.HomeFolder, Handle, ctrlRenderer.Handle, false, false, false);

            ConfigManager.Config.InitializeDefaults();
            ConfigManager.Config.ApplyConfig();

            _displayManager = new DisplayManager(this, ctrlRenderer, pnlRenderer, mnuMain, ctrlRecentGames);
            _displayManager.SetScaleBasedOnWindowSize();
            _shortcuts = new ShortcutHandler(_displayManager);

            _notifListener = new NotificationListener();
            _notifListener.OnNotification += OnNotificationReceived;

            _commandLine.LoadGameFromCommandLine();

            SaveStateManager.InitializeStateMenu(mnuSaveState, true, _shortcuts);
            SaveStateManager.InitializeStateMenu(mnuLoadState, false, _shortcuts);
            BindShortcuts();

            Task.Run(() => {
                Thread.Sleep(25);
                this.BeginInvoke((Action)(() => {
                    ResizeRecentGames();
                    ctrlRecentGames.Initialize();

                    if (!EmuRunner.IsRunning())
                    {
                        ctrlRecentGames.Visible = true;
                    }
                }));
            });

            if (showUpgradeMessage)
            {
                MesenMsgBox.Show("UpgradeSuccess", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }

            if (ConfigManager.Config.Preferences.AutomaticallyCheckForUpdates)
            {
                UpdateHelper.CheckForUpdates(true);
            }

            InBackgroundHelper.StartBackgroundTimer();
            this.Resize += frmMain_Resize;
        }