private static void DisplayCommands(CommandConsoleWindow window, bool ignoreMaxCommands = false) { int index = 0; if (window.MouseActivity) { window.MouseOverField = false; } if (window.CommandResult == null) { return; } foreach (var x in window.CommandResult) { if (index >= CommandManager.MaxCommandShown && !ignoreMaxCommands) { break; } CommandDisplay.DisplayCommandInSearch(x, index, window.SelectedIndex, window.MouseActivity, window.ForceValidationKeyPressed, window.SearchTerms); if (window.MouseActivity && GUILayoutUtility.GetLastRect().Contains(Event.current.mousePosition)) { window.SelectedIndex = index; window.MouseOverField = true; window.Repaint(); } index++; } }
private void OnGUI() { GUILayout.BeginVertical(); int i = 0; foreach (CommandInfo commandInfo in RightClickContextualCommand) { CommandDisplay.DisplayCommandInSearch(commandInfo, i, -1, true, true, ""); i++; } GUILayout.EndVertical(); }