This ambitious Torchbug wants to become a more capable and less sticky alternative to Zgoo. But beware: it's not quite there yet, and has more bugs than the one in its name.
/tbug expr
If expr is omitted or evaluates to _G, Global inspector will be opened.
If expr evaluates to a table, Table inspector will be opened for the table.
If expr evaluates to a control (userdata with function IsControlHidden), Control inspector will be opened for the control.
The most recently opened object inspector window will have the Torchbug icon at the top-left corner desaturated (grayscale). Such window is subject to recycling whenever you
a) click on a table or control row in Global inspector, or
b) enter a /tbug command that evaluates to a table or control. You can force opening a new window by shift-click (in Global inspector) or shift-enter (/tbug command).
Global inspector- Classes - global tables with an __index member
- Objects - global tables without an __index member, and userdata that are neither controls nor fonts
- Controls - global userdata with function IsControlHidden
- Fonts - global userdata with function GetFontInfo
- Functions - global functions
- Constants - all other globals
- Strings - EsoStrings - with SI constant names as well as integer values displayed
- Sounds - SOUNDS - click to play
- Dialogs - ESO_Dialogs
- Libs - LibStub.libs - with minor versions displayed next to names
Next to the magnifier icon is a filter mode switch (the three-letter button) and a string/expression filter field.
- str - plain string search. Case-sensitive if there is at least one upper-case letter in the string.
- pat - string pattern search. Case-sensitive.
- val - value search. The expression is evaluated once. Items whose value compares equal to the result pass the filter.
- con - condition search. The expression is evaluated for each list item, with environment containing 'k' and 'v' as the list item key and value. Items for which the result is truthy pass the filter.
For example, this is how you can search the Constants tab for items whose key starts with "B" and whose value is an even number:k:find("^B") and v % 2 == 0
Left-click on a row with a table or control opens a new inspector for that object.
Right-click on a value - same as in Table inspector.
Table inspector
Metatable members are listed before actual table contents. Metamethods are differentiated by having
yellow keys, despite them being strings.
Left-click on a row with a table or control opens a new tab in the same inspector window. Shift-Left-click to open a new window.
Right-click on a value (the right half of the row) switches to edit mode. Whatever you type will be evaluated after you hit Enter, and unless that fails, the result will be assigned to the corresponding key in the table. Use with care.
Right-click on a tab to close it.
Control inspector
In v1.1 there are many more control properties listed, including anchors, children and properties specific to certain control types. Some are editable, but there's currently no visual cue, you'll need to right-click and see.
TODO
- String search uses tostring(value), which leads to stupid matches with table/userdata address (which may not even be displayed if it has a global name).
- Windows don't close after their last tab has been closed.
- Add color box to color properties, open color picker on click.
- Implement inserting a new key/value pair to inspected table. Also add "self" to the environment to facilitate copying another value from the same table.
- Control properties hidden/controlHidden, alpha/controlAlpha and scale have confusing set/get semantics when inheritance is involved; needs discussion.
- Toggle boolean properties with a doubleclick.