Commit Graph
3 Commits
Author SHA1 Message Date
8e721237f6 feat(addons): zhCN localization for ClassicAPI_DebugTools and 6 missing globals fix (#141)
* feat(debugtools): add zhCN localization for ClassicAPI_DebugTools

* fix(locales): add 6 missing global strings to zhCN

* feat(debugtools): clean up slash command dispatch and add help subcommand

* fix(debugtools): use %s instead of %d in PROFILER_CALLS_FORMAT

ns.Count() always returns a string (either a formatted number or '-'),
never a number. Feeding it to %d causes format() to throw. Change the
locale template to %s so both '-', '1,234', etc. render correctly.

* fix(debugtools): repair regressions from the localization pass

- XML labels: 1.12's Button/FontString loader passes the text attribute
  verbatim to FrameScript_GetText (0x703BF0), which reads the global of
  exactly that name and falls back to the raw value. Nothing strips
  "$...$", so text="$TI_SHOW$" rendered as literal "$TI_SHOW$". Use the
  bare global name, as stock FrameXML does.
- Tabs: ns.AddTab(name, label) keeps a fixed English key for ns.ShowIn
  and a separate localized button label. Keying tabs by the translated
  name made ShowIn("Globals") return nil and error on a zhCN client.
- Frames tab state: restore visible / "shown, parent hidden" / hidden.
  The inverted branch reported a shown frame under a hidden parent as
  hidden and made the third state unreachable.
- /profiler: unknown or incomplete subcommands print the usage again
  instead of doing nothing.
- Deep Tracking / CPU Profiling buttons: split the label from ON/OFF so
  the state keeps its accent / grey colour.
- Restore the gap between owner and CPU time in the frame-stack and
  Frames-tab tooltips, and the leading space of " (replaced)".
- zhCN: ADDON_OPTIONS titles the shared Interface Options panel and the
  game-menu button, not ClassicAPI's own settings; revert to 插件设置.

---------

Co-authored-by: jilinge <jilinge@users.noreply.github.com>
Co-authored-by: Brues <5278969+brues-code@users.noreply.github.com>
2026-11-13 10:33:01 -06:00
Brues 8d22876c01 fix(debugtools): seat the table inspector's close button in its title bar
The stock 32x32 UIPanelCloseButton overhung the 19px title bar and sat on
the border. Size it 24x24 at the same inset as OpenParentButton so both
title-bar buttons share one centre line.
2026-10-27 18:56:18 -05:00
Brues e7b6c39ace feat(debugtools): port retail's table inspector
Replace the minimal /tinspect window with retail's Blizzard_TableInspector
and its anchor and attribute providers. The window lists a table's
anchors and its fields grouped by type, with child frames and regions,
editable numbers, strings and booleans, a filter, back and forward
history, open-parent, duplicate, and Show / Highlight / Dynamic Updates
toggles. The provider XML is retail's, unchanged.

1.12 changes to the main window: a backdrop and plain title bar replace
the gear-manager art, the scroll-up and plus buttons replace two retail
textures, and the scroll frame and filter box are small unnamed templates.
Windows come from a frame pool and have no names, so the stock
InputBoxTemplate's $parent-named border and UIPanelScrollFrameTemplate's
named scroll bar would be shared by every window.

/tinspect works as on retail: a table result opens on it; otherwise it
opens on the frame under the cursor, or UIParent. Ctrl in /fstack opens
TableAttributeDisplay. The frame highlight (AnchorHighlightMixin,
FrameHighlightTemplate) comes from retail's Blizzard_DebugTools.

!!!ClassicAPI gains retail's TruncatedTooltipScriptTemplate and
PanelDragBarTemplate, GetAppropriateTooltip, GameTooltip_AddNormalLine
and GameTooltip_AddColoredLine.
2026-10-27 18:06:55 -05:00