private void Open(object sender, EventArgs args)
 {
     RichHudTerminal.CloseMenu();
     HudMain.EnableCursor = true;
     window.Visible       = true;
     window.GetFocus();
 }
 public static void Init()
 {
     if (_instance == null)
     {
         _instance = new RichHudTerminal();
     }
 }
        private void AddChatCommands()
        {
            CmdManager.GetOrCreateGroup("/bv2", new CmdGroupInitializer
            {
                { "help", x => RichHudTerminal.OpenToPage(helpMain) },
                { "bind", x => UpdateBind(x[0], x.GetSubarray(1)), 2 },
                { "resetBinds", x => BvBinds.Cfg = BindsConfig.Defaults },
                { "save", x => BvConfig.SaveStart() },
                { "load", x => BvConfig.LoadStart() },
                { "resetConfig", x => BvConfig.ResetConfig() },

                // Debug/Testing
                { "open", x => QuickActionHudSpace.TryOpenMenu() },
                { "close", x => QuickActionHudSpace.CloseMenu() },
                { "reload", x => ExceptionHandler.ReloadClients() },
                { "crash", x => Crash() },
                { "printControlsToLog", x => LogIO.WriteToLogStart($"Control List:\n{HelpText.controlList}") },
                { "export", x => ExportBlockData() },
                { "import", x => TryImportBlockData() },
                { "checkType", x => ExceptionHandler.SendChatMessage($"Block Type: {(QuickActionHudSpace.Target?.SubtypeId.ToString() ?? "No Target")}") },
                { "toggleDebug", x => QuickActionMenu.DrawDebug = !QuickActionMenu.DrawDebug },
                { "toggleVisDbg", x => PropertyBlock.DebugVisibility = !PropertyBlock.DebugVisibility },
                { "toggleBoundingBox", x => QuickActionHudSpace.DrawBoundingBox = !QuickActionHudSpace.DrawBoundingBox },
                { "targetBench", TargetBench, 1 },
                { "getTarget", x => GetTarget() },
            });
        }
 /// <summary>
 /// Generates a ModMenu button for opening the Rich HUD Terminal.
 /// </summary>
 private static List <MenuUtilities.IMenuElement> GetModMenuButton()
 {
     return(new List <MenuUtilities.IMenuElement>()
     {
         new MenuUtilities.MenuButton(
             $"Open Rich Hud Terminal",
             () => RichHudTerminal.OpenMenu())
     });
 }
        private ControlCategory GetHelpSettings()
        {
            var openHelp = new TerminalButton()
            {
                Name = "Open help",
                ControlChangedHandler = (sender, args) => RichHudTerminal.OpenToPage(helpMain)
            };

            var tile1 = new ControlTile()
            {
                openHelp,
            };

            var loadCfg = new TerminalButton()
            {
                Name = "Load config",
                ControlChangedHandler = (sender, args) => BvConfig.LoadStart(),
            };

            var saveCfg = new TerminalButton()
            {
                Name = "Save config",
                ControlChangedHandler = (sender, args) => BvConfig.SaveStart()
            };

            var resetCfg = new TerminalButton()
            {
                Name = "Reset config",
                ControlChangedHandler = (sender, args) => BvConfig.ResetConfig(),
            };

            var tile2 = new ControlTile()
            {
                loadCfg,
                saveCfg,
                resetCfg
            };

            return(new ControlCategory()
            {
                HeaderText = "Help",
                SubheaderText = "Help text and config controls",
                TileContainer = { tile1, tile2 }
            });
        }
Exemple #6
0
 private CmdGroupInitializer GetChatCommands()
 {
     return(new CmdGroupInitializer
     {
         { "resetBinds", x => MasterBinds.Cfg = BindsConfig.Defaults },
         { "save", x => MasterConfig.SaveStart() },
         { "load", x => MasterConfig.LoadStart() },
         { "resetConfig", x => MasterConfig.ResetConfig() },
         { "open", x => RichHudTerminal.OpenMenu() },
         { "close", x => RichHudTerminal.CloseMenu() },
         { "toggleCursor", x => HudMain.EnableCursor = !HudMain.EnableCursor },
         { "crash", x => ThrowException() },
         { "toggleDebug", x => RichHudDebug.EnableDebug = !RichHudDebug.EnableDebug },
         { "textBench", TextBench, 2 },
         { "printConIDs", x => ExceptionHandler.WriteToLog(StringListToString(BindManager.SeControlIDs)) },
         { "printMouseConIDs", x => ExceptionHandler.WriteToLog(StringListToString(BindManager.SeMouseControlIDs)) }
     });
 }
Exemple #7
0
            public ModClient(ClientData data)
            {
                name          = data.Item1;
                SendMsgAction = data.Item2;
                ReloadAction  = data.Item3;
                apiVersionID  = data.Item4;

                hudClient  = new HudMain.TreeClient(apiVersionID);
                bindClient = new BindManager.Client(this);
                menuData   = RichHudTerminal.GetClientData(name);

                Registered = true;

                SendData(MsgTypes.RegistrationSuccessful, new ServerData(Unregister, GetApiData, apiVersionID));
                ExceptionHandler.WriteToLogAndConsole($"[RHF] Successfully registered {name} with the API.");

                ClientSubtype = ClientSubtypes.Full;
                VersionString = $"1.0.3.0- ({apiVersionID})";
            }
Exemple #8
0
        private void HudInit()
        {
            if (ExceptionHandler.IsClient)
            {
                CanUpdate = true;

                BvBinds.Init();
                BvConfig.Load();
                AddChatCommands();
                InitSettingsMenu();
                TerminalUtilities.Init();
                QuickActionHudSpace.Init();

                if (BvConfig.WasConfigOld)
                {
                    RichHudTerminal.OpenToPage(helpMain);
                }

                BvConfig.OnConfigLoad += UpdateBindPageVisibility;
                UpdateBindPageVisibility();
            }
        }
Exemple #9
0
 /// <summary>
 /// Opens the rebind dialog for the given bind for the control specified.
 /// </summary>
 private void GetNewControl(int index)
 {
     RichHudTerminal.CloseMenu();
     RebindDialog.UpdateBind(bind, index, DialogClosed);
 }
 public override void Close()
 {
     MyAPIGateway.Utilities.MessageEntered -= MessageHandler;
     _instance = null;
 }
 public override void Close()
 {
     _instance = null;
 }
 public ControlCategory() : this(RichHudTerminal.GetNewMenuCategory())
 {
 }
Exemple #13
0
 public TerminalPageCategory() : base(RichHudTerminal.GetNewPageCategory())
 {
 }
Exemple #14
0
 public TerminalControlBase(MenuControls controlEnum) : this(RichHudTerminal.GetNewMenuControl(controlEnum))
 {
     // Register event callback
     GetOrSetMember(new Action(ControlChangedCallback), (int)TerminalControlAccessors.GetOrSetControlCallback);
 }
 private void ConfirmPosition()
 {
     window.Visible = false;
     RichHudTerminal.OpenMenu();
 }
Exemple #16
0
 /// <summary>
 /// Rebind dialog callback.
 /// </summary>
 private void DialogClosed()
 {
     UpdateBindText();
     RichHudTerminal.OpenMenu();
 }
 public ControlTile() : this(RichHudTerminal.GetNewMenuTile())
 {
 }
 public TerminalPageBase(ModPages pageEnum)
 {
     data = RichHudTerminal.GetNewMenuPage(pageEnum);
 }