Skip to content

feat: gear button on the Tool Exposure row opens settings pre-selecting the active profile#36

Open
dehuaichendragonplus wants to merge 1 commit into
FunplayAI:mainfrom
dehuaichendragonplus:feat/tool-exposure-inline-settings-button
Open

feat: gear button on the Tool Exposure row opens settings pre-selecting the active profile#36
dehuaichendragonplus wants to merge 1 commit into
FunplayAI:mainfrom
dehuaichendragonplus:feat/tool-exposure-inline-settings-button

Conversation

@dehuaichendragonplus

Copy link
Copy Markdown
Contributor

Why

The MCP Server window's Tool Exposure row is just a core/full dropdown. The fine-grained, per-tool editing lives in a separate Tool Exposure window that is only reachable through the Funplay/Tool Exposure menu item — not discoverable from the row it actually configures. Worse, that window always opened editing the core list even when full was the active profile, so a user who switched the row to full and then went to customize was silently editing the wrong list.

Approach

  • FunplayMCPToolExposurePanel: wrap the existing core/full PopupField and a new gear Button in a horizontal row — the dropdown flex-grows to fill and the gear sits on its right. The gear uses the built-in editor SettingsIcon (d_SettingsIcon on the pro skin) with a text fallback if the icon can't be resolved on some editor/skin, plus a tooltip. Clicking opens the Tool Exposure settings window.
  • FunplayToolExposureWindow: add a ShowWindow(string editProfile) overload that pre-selects which profile's tool list to edit. It handles both window lifecycles: a freshly-created window (its CreateGUI/BuildUI reads _editingProfile when it builds) and a reused, already-built window (setting the PopupField value fires its change callback, which reloads the tool list). The parameterless ShowWindow() behind the Funplay/Tool Exposure menu item is untouched.
  • The gear reads the current MCPToolExportProfile on click, so it always opens editing the list the user is actually using.

New API

  • FunplayToolExposureWindow.ShowWindow(string editProfile) — additive overload; the existing parameterless ShowWindow() is unchanged.

Benefits

  • One-click access to per-tool exposure editing straight from the row that configures it (discoverability).
  • Opening the settings edits the active profile's list, removing the silent "you switched to full but you're editing core" trap.

Test results

Verified in Unity 6000.3.13f1:

  • Compiles clean — 0 errors, 0 warnings.
  • The gear button renders in the correct position, right of the core/full dropdown (screenshot-verified).
  • ShowWindow("full") → the window's _editingProfile and the "Edit Tool List" dropdown are both full, and the header reads Editing full: 157/157 tools (verified by reflection and by screenshot). ShowWindow("core") keeps editing core.
  • Opening via the gear invokes the same wired action end-to-end (the settings window opens).

Compatibility

  • Purely an editor-UI change — no MCP wire protocol, initialize, or tool-surface change, so it is compatible with every MCP client.
  • Additive API (the ShowWindow overload); the menu-item path and all existing window behavior are unchanged.
  • Only two files touched, neither shared with any other in-flight PR — merges independently in any order.

Checklist

  • Tested in a Unity 2022.3+ project (Unity 6000.3.13f1)
  • Verified Funplay > MCP Server opens and the Funplay/Tool Exposure menu item still works
  • Did not commit local junk such as .idea/ or .DS_Store
  • Updated CHANGELOG.md

…pre-selecting the active profile

The MCP Server window's Tool Exposure row was only a core/full dropdown; per-tool
editing lived in a separate window reachable only via the Funplay/Tool Exposure menu,
and that window always opened editing the "core" list even when "full" was active.

- FunplayMCPToolExposurePanel: add a gear button (built-in SettingsIcon, with a "gear"
  text fallback + tooltip) to the right of the core/full dropdown; the dropdown flex-grows
  and the gear sits on its right. Clicking opens the Tool Exposure settings window.
- FunplayToolExposureWindow: add a ShowWindow(string editProfile) overload that pre-selects
  which profile's tool list to edit, handling both a freshly-created window (CreateGUI reads
  _editingProfile) and a reused already-built window (setting the PopupField value reloads the
  list). The parameterless ShowWindow() menu handler is unchanged.
- The gear reads the current MCPToolExportProfile on click, so with "full" selected the
  settings window opens editing the full list (157/157) instead of always starting on core.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant