Пример #1
0
        public override void Load()
        {
            if (harmonyInstance == null)
            {
                harmonyInstance = HarmonyInstance.Create(Name);
            }

            harmonyInstance.PatchAll();

            keyToggle   = RegisterHotKey("Toggle", "NumPad1");
            keyStep     = RegisterHotKey("Step", "NumPad2");
            keyAutoStep = RegisterHotKey("Auto step", "NumPad3");
            keySettings = RegisterHotKey("Settings", "NumPad5");

            if (!Main.dedServ)
            {
                settingsUI    = new SettingsUI();
                userInterface = new UserInterface();
                userInterface.SetState(settingsUI);
                settingsUI.Activate();
                UILayer = new LegacyGameInterfaceLayer("MechScope: Settings menu",
                                                       delegate
                {
                    if (settingsUI.Visible)
                    {
                        settingsUI.Draw(Main.spriteBatch);
                        userInterface.Update(Main._drawInterfaceGameTime);
                    }
                    return(true);
                }
                                                       );
            }
        }
Пример #2
0
        public void Show()
        {
            if (SettingsUi == null)
            {
                SettingsUi = new SettingsUI(_cairoApplication, this, _shellManager, _updateService, _appGrabber, _themeService);
            }

            SettingsUi.Show();
            SettingsUi.Activate();
        }