Beispiel #1
0
        private void PopulateHistoryHelp(List <string> StringList, bool UseHelpText)
        {
            int HelpLabelsCount = HistoryHelpBox.GetChildCount();
            int HelpCmdCount    = StringList.Count;
            int i = 0;

            // Update existing controls
            for (; i < Mathf.Min(HelpLabelsCount, HelpCmdCount); ++i)
            {
                int   StringIndex = HelpCmdCount - i - 1;
                Label HelpLabel   = HistoryHelpBox.GetChild <Label>(i);
                HelpLabel.Text =
                    UseHelpText ? MDCommands.GetHelpText(StringList[StringIndex]) : StringList[StringIndex];
                HelpLabel.Visible = true;
            }

            // Create new ones as needed
            for (; i < HelpCmdCount; ++i)
            {
                int   StringIndex = HelpCmdCount - i - 1;
                Label HelpLabel   = new Label
                {
                    Text = UseHelpText ? MDCommands.GetHelpText(StringList[StringIndex]) : StringList[StringIndex]
                };
                HistoryHelpBox.AddChild(HelpLabel);
            }

            // Hide the extras
            for (; i < HelpLabelsCount; ++i)
            {
                Label HelpLabel = HistoryHelpBox.GetChild <Label>(i);
                HelpLabel.Visible = false;
            }
        }
Beispiel #2
0
        public override void _Ready()
        {
            base._Ready();

            CommandHistory = MDCommands.GetCommandHistory();
            CommandList    = MDCommands.GetCommandList();

            CreateConsoleControls();

            SetProcessInput(true);
        }
Beispiel #3
0
        internal static void Initialize()
        {
            MDCommands.RegisterCommandAttributes(typeof(MDOnScreenDebug));
            AddBasicInfo();

            // Load hidden categories from config
            string HiddenCategoryString = MDStatics.GetGameInstance().GetConfiguration().GetString(MDConfiguration.ConfigurationSections.OnScreenDebug, MDConfiguration.HIDDEN_CATEGORIES, "");

            string[] HiddenCategoryArray = HiddenCategoryString.Replace(", ", ",").Replace(" ,", ",").Split(',');
            HiddenCategories.AddRange(HiddenCategoryArray);
        }
Beispiel #4
0
        // Called when the user hits enter on the ConsoleInput
        private void OnCommandEntered(string Command)
        {
            if (Command.ToLower().StartsWith("servercommand"))
            {
                this.GetGameSession().ServerCommand(Command.Substring(Command.IndexOf(' ') + 1));
            }
            else
            {
                MDCommands.InvokeCommand(Command);
            }

            CloseScreen();
        }
        private void ClientToServerCommand(string Command)
        {
#if DEBUG
            MDCommands.InvokeCommand(Command);
#endif
        }
Beispiel #6
0
 /// <summary>
 /// Initialize the profiler
 /// </summary>
 public static void Initialize()
 {
     _enabledProfiles = new HashSet <string>();
     MDCommands.RegisterCommandAttributes(typeof(MDProfiler));
 }
 /// <summary>Helper to unregister commands</summary>
 public static void UnregisterCommandAttributes(this Node Instance)
 {
     MDCommands.UnregisterCommandAttributes(Instance);
 }
Beispiel #8
0
 /// <summary>
 /// Initialize internal data and set the directory to store log files
 /// </summary>
 /// <param name="LogDir">The log directory to use</param>
 public static void Initialize(string LogDir)
 {
     InitLogFile(LogDir);
     MDCommands.RegisterCommandAttributes(typeof(MDLog));
 }
Beispiel #9
0
 /// <summary>
 /// Initialize internal data and set the directory to store log files
 /// </summary>
 /// <param name="LogDir">The log directory to use</param>
 public static void Initialize(string LogDir)
 {
     LogProperties = new Dictionary <string, MDLogProperties>();
     InitLogFile(LogDir);
     MDCommands.RegisterCommandAttributes(typeof(MDLog));
 }