using System; using System.Collections.Generic; using System.Linq; using MCPForUnity.Editor.Constants; using MCPForUnity.Editor.Helpers; using MCPForUnity.Editor.Services; using MCPForUnity.Editor.Tools; using UnityEditor; using UnityEngine.UIElements; namespace MCPForUnity.Editor.Windows.Components.Tools { /// /// Controller for the Tools section inside the MCP For Unity editor window. /// Provides discovery, filtering, and per-tool enablement toggles. /// public class McpToolsSection { private readonly Dictionary toolToggleMap = new(); private Toggle projectScopedToolsToggle; private Label summaryLabel; private Label noteLabel; private Button enableAllButton; private Button disableAllButton; private Button rescanButton; private VisualElement categoryContainer; private List allTools = new(); public VisualElement Root { get; } public McpToolsSection(VisualElement root) { Root = root; CacheUIElements(); RegisterCallbacks(); } private void CacheUIElements() { projectScopedToolsToggle = Root.Q("project-scoped-tools-toggle"); summaryLabel = Root.Q