コード例 #1
0
ファイル: MechScope.cs プロジェクト: DRKV333/MechScope
        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);
                }
                                                       );
            }
        }