RynthCore/Changelog/2026-11-07-bar-menu.md
Daniel Wallace f8c41cddd7 Bar menu: front-order, queue-full reply, BarMenu contract const
Bring the dropdown to the display front each frame (igBringWindowToDisplayFront,
no focus change), reply in chat when the command queue is full, add
PluginContractVersion.BarMenu for plugins to pin against, drop a redundant Trim,
point a comment at the SectionManifest header, and list all bar menu tests
in the changelog.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 13:13:36 -08:00

3.2 KiB

Bar icon dropdown: plugin API v94

Branch up/bar-menu, from up/web-panel (0ef12d7). Not deployed. The API number 94 is provisional, as 93 is (upstream may take it first; it renumbers on merge). The manifest is parsed here; the bar draws it (below).

What changed

  • A plugin window in the sections manifest (windows, with "bar": true) may declare "barMenu": up to 6 items of { "id", "tooltip", "icon", "command" }. SectionManifest.cs parses it into SectionWindowDecl.BarMenu (SectionBarMenuItem records; Menu is the never-null view).
  • Validation, with the window always kept: the id is a short lower-case word and unique in the menu, the tooltip is non-empty and capped at 48 characters, the command is a single /... chat command (the same rule as a contribution's), the icon is one Phosphor glyph or empty (an icon that is not a glyph is kept as an empty icon, and the bar draws the tooltip's first letter). An item with a bad id, tooltip or command is dropped; items past MaxBarMenuItems (6) are ignored; a barMenu that is not an array is ignored.
  • PluginContractVersion.Current and the SDK's RynthCoreSdkApiVersion (RynthCore.PluginSdk.targets) go to 94. No function table change. Engines before v94 ignore the key, so a plugin can declare it unconditionally.

Tests

tools/SectionsTests:

  • ManifestBarMenu: valid items in order with exact fields, rejected commands (no slash, a line break, over-long), empty id, duplicate id, empty tooltip, empty icon kept, 20 items capped to 6, a non-array barMenu, no key, and the 48-character tooltip cap.
  • BarMenuHoverTiming: the 0.15 s open delay, a quick sweep never opening, the 0.30 s close delay covering the gap from icon to dropdown, switching to another icon at once, no reopen while still hovering after a click, and a clock jump or a gap over 0.5 s resetting.
  • BarMenuReload: a change to only barMenu leaves the panel signature alone (no re-registration) and changes the menu signature (so the bar rebuilds).

tools/PluginManifestTests pins the SDK and engine numbers together, and that PluginContractVersion.BarMenu is at or below Current.

Not yet tested in game.

The dropdown

  • Hovering a plugin window's bar icon for 0.15 s drops a column of icon buttons flush below it (flush above when it would cross the bottom of the screen; clamped sideways). It stays while the mouse is over the icon or the column, and for 0.30 s after it leaves both. Another icon's dropdown replaces it at once. Clicking an item runs its command as a player chat command (the hotkey path) and closes the dropdown. The icon's own click still toggles the window.
  • A plugin reload that changes only barMenu reaches the bar: PluginWindows.Sync refreshes the hosted declaration (WindowPlan.MenuSignature) without re-registering the panel, and bumps the version so the bar rebuilds its buttons.
  • The dropdown is brought to the display front every frame (cimgui igBringWindowToDisplayFront, no focus change), so a panel focused since does not cover it; without those exports it keeps its normal order and logs once.
  • Timing is ImGui/BarMenuHover.cs (pure; SectionsTests BarMenuHoverTiming). Drawing is in-game only.