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; } }
public override void _Ready() { base._Ready(); CommandHistory = MDCommands.GetCommandHistory(); CommandList = MDCommands.GetCommandList(); CreateConsoleControls(); SetProcessInput(true); }
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); }
// 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 }
/// <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); }
/// <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)); }
/// <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)); }