Quantcast
Download
(46 Kb)
Download
Updated: 06/23/20 11:21 AM
Patch for:
Mer Torchbug.
Compatibility:
Greymoor (6.0.5)
Harrowstorm (5.3.4)
Dragonhold (5.2.5)
Scalebreaker (5.1.5)
Elsweyr (5.0.5)
Updated:06/23/20 11:21 AM
Created:04/27/20 01:52 AM
Monthly downloads:162
Total downloads:435
Favorites:1
MD5:
6.0.5
Mer Torchbug - Fixed and Improved
Version: 1.34
by: Baertram [More]
This is a patch for Merlight's mer Torchbug inspection tool. Thanks merlight for this great inspector tool!


Optional dependencies:
If you want to use the context menu functions you need to install this library: LibCustomMenu

What is mer Torchbug?
The idea behind this tool is (like with Zgoo as well) to inspect global variables/controls ingame to see their current attributes/parents/variables/values.
You can e.g. use /tbug <globalVariableNameOrFunction> (where <globalVariableNameOrFunction> could be e.g. MyAddon or GetUnitName("player")) to inspect this global variable, or show the results of the function call in the chat.

/tbug alone shows you the "global inspector" which holds texts, global variables, sounds, libraries etc.

An inspector (global, normal, table, control) is a window with possible tabs where you can click the different variables etc. and it will open another tab for them, so you are able to inspect (and change, if possible) some of the values of the inspected variables.


What has been changed compared to the official merTorchbug v1.1:
Please read the changelog for the changed/fixed/added features, slash commands etc.

Key changes:
  • Slash command /tb -> Sames as /tbug
  • Slash command /tbugm or /tbm -> Inspect below mouse cursor
  • Slash command /zgoo (if not addon Zgoo is loaded) -> Sames as /tbug
  • -Collapse/Expand inspector window with v^ icons (top right corner)
  • -Refresh inspector window with o icon (top right corner)
  • -Context menu at inspector values: Copy raw data / Copy special (bagId, slotIndex e.g.) / Change boolean value (true/false/NIL)
  • -Scripts history added to global inspector. All /script chat commands will be automatically saved there so you can reuse them. Double click to paste the entry to your chatbox. Right click to edit it. Right click the key number to show a context menu (delete entry e.g.)
  • Slash command /tbugs -> Show the scripts history
  • Slash command /tbug <globalInspectorTab> will directly open the tab at the global inspector. Values of <globalInspectorTab> can be:
    • addons
    • classes
    • objects
    • controls
    • fonts
    • functions
    • constants
    • strings
    • sounds
    • dialogs
    • libs
    • scripts
    • -all-
  • Clicked table keys (numerical) will open as tableName[keyNr] now and not only as [keyNr] anymore
  • Added support for non-LibStub libraries in the "Libs" tab
  • Added support for some list row entries. If the control inspector recognizes them (e.g. ZO_PlayerInventoryList1Row...) it will add the dataEntry.data table and the bagId and slotIndex to the List row properties at the top of the Anchor properties, so you have them directly in view after using e.g. /tbugm on that list row.


Known bugs:
#1) Opening the global inspector will sometimes open already closed and empty (no tabs) inspector windows as well



Original addon's description:
The original addon can be found here: mer Torchbug

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.


Original addon's 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. -> Fixed in mer Torchbug - Fixed and improved
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. -> Fixed in mer Torchbug - Fixed and improved
Optional dependencies:
If you want to use the context menu functions you need to install this library: LibCustomMenu

Version 1.34
Updated (2020-06-23):
Fixed variable chnages from the table inspector: Double click, context menu and manually changed values

Version 1.33
Updated (2020-06-01):
Fixed slash command /rl to start endless loop as it was repeating RealodUI("ingame") all the time. Thanks to Jarth for the hint!

Version 1.32
Updated (2020-05-23):
-Added "AddOns" tab to the global inspector listing all addons&libraries currently loaded in their load order, providing their version (if given), and some details if you click the addon (table containing the addon's title, description, author, version, globalvariable if it's a lib, library flag, date and time as it got loaded etc.
It also shows if the addon/lib was loaded via LibStub or not and colors the obsoletely via LibStub loaded addons "red" at their version.
-Added slash commands to open the AddOns panel
/tbug addons
/tbuga
/tba
-Added keybinding for "Reload UI"


Version 1.31
Updated (2020-04-28):
-Updated version and name in global TBUG
-Changed chat text input usage to function StartChatInput


Version 1.3
Updated (2020-04-27):
Fixed resizing problems with the collapsed inspectors. Width can be changed as it is collapsed, height not anymore.
Fixed min width and height of the windows.
Fixed inspector opening empty if it once was opened and then closed, and afterwards any script without object (e.g. d("hello world") was run.
Fixed refresh button not usable if inspector window is collapsed to the title bar.
Fixed list entries, height and scrollbar updating after resize of the inspector window.
Added tooltips to the window buttons collapse/expand, refresh and close.
Added context menu to the torchbug icon of the inspectors, giving the possibilities to
--Resize to standard size of the window
--Refresh contents (if not collapsed)
--Collapse/Expand
--Change the drawlayer: Bring to front / normal / send to back
--Hide
--Close and destroy tabs
Added more and shorter slash commands, if they do not exist already (created by other addons):
/tb -> Same as /tbug
/tbm -> Same as /tbugm or /tbug m or /tbug mouse



Version 1.2.1
-Changed the control below mosue calls so they add a new tab to one (first created) inspector window
-Changed the inspector window's tab switch to update the title of the inspector window accordingly to the tab name (and respecting control below mouse tabs -> "MOC_" prefix). Also works with mouse wheel tab change
-Last tab removed from an inspector window will clear the title of the window (and could also close the window, but currentl this code line is commented. Your TODO said "Windows don't close after their last tab has been closed." but I feel this is not needed as one can click the X icon for this.)
-Allowed functions to be used via /tbug and inspector row left mouse button clicks (with SHIFT key pressed) and show their return values, or error message
-Selecting a tab (mouse click, mouse scroll wheel) or opening the same object via /tbug again will refresh the panel
-Added refresh button (o) left to the close button (x) at the inspector windows title
-Added collapse button (^) and (v) left to the refresh button (o) at the inspector window title. This will collapse the window to the title only, and back (to save space if you want to see values below the window at the UI).
-Added double click on boolean value to change it between true/false
-Added [] at tab and title if the shown item is a table.
-Fixed inspector window context menu for boolean values to be able to set NIL -> Attention: This will remove the variable from the inspector as it does not exist anymore afterwards! Good to clear SavedVariable data e.g.


Added new (2020-01-18):
-The global inspector holds a "Script" tab now. Each /script command you run in teh chat will be automatically added there. You are able to right click it to change it in the insepctor. Double click it to post the script as /script ... command to the chat edit box. Right click the left key column (number) to show a context menu (currently: Delete row)
-Added chat commands to open the global inspector tabsdirectly:
Code:
/tbug <globalInspectorTabNameLowerCase>
Where <globalInspectorTabNameLowerCase> can be one of the following
  • classes
  • objects
  • controls
  • fonts
  • functions
  • constants
  • strings
  • sounds
  • dialogs
  • libs
  • scripts
  • -all-
-> The -all- command (/tbug -all-) will recreate all tabs at the global inspector if you accidently closed one or need all of them back
-Added 3rd column "comment" in scripts tab (to the right of the script column) where you can right click and add a comment text for your script


Added new (2020-04-13):
Clicked table keys (numerical) will open as tableName[keyNr] now and not only as [keyNr] anymore.

Added support for non-LibStub libraries in the "Libs" tab.
Marked LibStub loaded libraries with the red"LibStub" hint.
After the LibStub hint the minor version of LiBStub is shown in ().
If the library is not a LibStub supported one the ## AddOnVersion version is shown instead of the LibStub hint and version!

Libs need their own txt file to be detected! The txt file needs the ## IsLibrary: true tag!
The global variables of the lib need to be the same like the lib name, or similar, like LibAddonMenu-2.0 will be split at the - and the 2.0 turned into a number and attached to the LibAddonMenu again -> LibAddonMenu2
Some special ones exists like LibBinaryEncode = LBE, which I for now have hardcoded. If you miss others in the list tell me which ones are missing.


Added new (2020-04-16):
Added support for some list row entries. If the control inspector recognizes them (e.g. ZO_PlayerInventoryList1Row...) it will add the dataEntry.data table and the bagId and slotIndex to the List row properties at the top of the Anchor properties, so you have them directly in view after using e.g. /tbugm on that list row.

Added context menus to numbers and strings to copy the raw value shown to the chat.
Added context menu for special entries like bagid / slotIndex to copy the raw value, the 2 as a pair, as itemlink or name of the item to the chat.


Updated (2020-04-18):
Made the XML look better to show the different columns: Key, script, comment about the script.
Fixed scripts tab to save the script comments properly to the selected row if you have scrolled.
Hide/Show 2nd value column (comment) properly after edit was active/aborted.
Added color for script comments, generel "comment" colortype was added with color "white".
Made the context menu for scripts work (remove script from list).
Made updating the librray / scripts panels work.
Added slash command /tbugs to directly show the scripts.
Added slash command /rl for reloadui, if /rl does not exist yet.
Added the text via GetText function next to the value, if a table key is "text" and the value is a number.
Added a font preview at the fonts tab (each row shows the font name with it's own font style now).



Version 1.2
-Adding keybindings for /tbug and /tbug moc() -> new slash command /tbugm as well
-Added /tbug mouse for the same control unde rmouse inspection
-Adding LibCustomMenu to ## OptionalDependsOn: and adding a context menu to the boolean entries in the inspectors to allow true/false selection + manual text edit entry.

-Added mana's function to show TopLevelControls, but with another name as "vis" is a bit short for a global func:
Code:
/tbug ListTLC(boolean: onlyVisible)
Shows the list with currently visible/non visible GuiRoot children
-Workaround for current client crash on PTS with API 100029 because of zo_nextinsecure bug in _G[]. Will show a debug message if you call /tbug without any parameter instead of trying to read _G and crash the client.
-Added global variable TBUG to make the keybindings work
-Added compatibility chat command /zgoo (if ZGOO is not loaded). I'm so used to /zgoo that I sometimes type it in and wonder it does not show anything :p
Archived Files (4)
File Name
Version
Size
Uploader
Date
1.33
45kB
Baertram
06/01/20 05:41 AM
1.32
45kB
Baertram
05/23/20 08:37 AM
1.31
44kB
Baertram
04/28/20 02:33 AM
1.3
44kB
Baertram
04/27/20 01:52 AM


Post A Reply Comment Options
Unread 06/01/20, 05:40 AM  
Baertram
 
Baertram's Avatar
AddOn Author - Click to view AddOns

Forum posts: 2964
File comments: 3581
Uploads: 62
Thanks, update coming
Report comment to moderator  
Reply With Quote
Unread 06/01/20, 05:22 AM  
Jarth
AddOn Author - Click to view AddOns

Forum posts: 2
File comments: 78
Uploads: 2
Re: Re: Comments to Version 1.32

Hello again

That does the trick yes.

Originally Posted by Baertram
Thanks for the report.

/rl can be added by any addon and it actually is by FCOChangeStuff e.g.
There alsoe exist others like the Reloadui Extra Slash Commands addon.

Torchbug is just checking if it exists already and if not, it defines it.

Not sure why this would do a reloadui in a loop here but I'll change that to be called from an anonymous function then.

Could you please test with this change:
Lua Code:
  1. if SLASH_COMMANDS["/rl"] == nil then
  2.         SLASH_COMMANDS["/rl"] = function() ReloadUI("ingame") end
  3.     end

Should fix it (hopefully).

Originally Posted by Jarth
First off, thanks for keeping the addon alive.

I had an issue where the system loaded fine on first load (most of the times), but sometimes kept reloading over and over.

I found the issue to be in main.lua:681, where it called ReloadUI on load, and not when the key slash command was executed
I don't use ZGOO so SLASH_COMMANDS["/rl"] is never set in my case.
Code:
if SLASH_COMMANDS["/rl"] == nil then
  SLASH_COMMANDS["/rl"] = ReloadUI("ingame")
end
Though "/rl" would have no function without ZGOO?
Report comment to moderator  
Reply With Quote
Unread 06/01/20, 05:05 AM  
Baertram
 
Baertram's Avatar
AddOn Author - Click to view AddOns

Forum posts: 2964
File comments: 3581
Uploads: 62
Re: Comments to Version 1.32

Thanks for the report.

/rl can be added by any addon and it actually is by FCOChangeStuff e.g.
There alsoe exist others like the Reloadui Extra Slash Commands addon.

Torchbug is just checking if it exists already and if not, it defines it.

Not sure why this would do a reloadui in a loop here but I'll change that to be called from an anonymous function then.

Could you please test with this change:
Lua Code:
  1. if SLASH_COMMANDS["/rl"] == nil then
  2.         SLASH_COMMANDS["/rl"] = function() ReloadUI("ingame") end
  3.     end

Should fix it (hopefully).

Originally Posted by Jarth
First off, thanks for keeping the addon alive.

I had an issue where the system loaded fine on first load (most of the times), but sometimes kept reloading over and over.

I found the issue to be in main.lua:681, where it called ReloadUI on load, and not when the key slash command was executed
I don't use ZGOO so SLASH_COMMANDS["/rl"] is never set in my case.
Code:
if SLASH_COMMANDS["/rl"] == nil then
  SLASH_COMMANDS["/rl"] = ReloadUI("ingame")
end
Though "/rl" would have no function without ZGOO?
Last edited by Baertram : 06/01/20 at 05:07 AM.
Report comment to moderator  
Reply With Quote
Unread 06/01/20, 04:43 AM  
Jarth
AddOn Author - Click to view AddOns

Forum posts: 2
File comments: 78
Uploads: 2
Comments to Version 1.32

First off, thanks for keeping the addon alive.

I had an issue where the system loaded fine on first load (most of the times), but sometimes kept reloading over and over.

I found the issue to be in main.lua:681, where it called ReloadUI on load, and not when the key slash command was executed
I don't use ZGOO so SLASH_COMMANDS["/rl"] is never set in my case.
Code:
if SLASH_COMMANDS["/rl"] == nil then
  SLASH_COMMANDS["/rl"] = ReloadUI("ingame")
end
Though "/rl" would have no function without ZGOO?
Last edited by Jarth : 06/01/20 at 04:48 AM.
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: