View Single Post
01/23/24, 10:08 AM   #10
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 5,000
merTorchbug and zgoo do not show you code or let you inspet code!
It's inspecting contols and tables and variables and provides search functionality to search for function names, class names, Strings, sounds etc.


If you want to find the code have a look at GitHub and or downoad the ESOUI source code locally and search in it with your development IDE.


And control names are nither existant in the ESUI source code "in total length" as they are concatenated via the parent name + child control names.
e.g. ZO_KeybindStripButtonTemplate3
It's parent is ZO_KeybindStrip
And child control is Button
and that is parent of child control Template3 again

So you need to search in ESOUI source code in xml and lua files for e.g. ZO_KeybindStrip and then check how the child controls get added there.

Sae for the function you search, try to search for AddHotbarSlotToChampionPurchaseRequest in the esoui sources.
https://github.com/search?q=repo%3Ae...uest&type=code

And then fiddle the way back to the code that calls it, via
function ZO_ChampionAssignableActionBarSlot:CollectUnsavedChanges()
And when you see the function got a : in between then you can pretty be sure ZOs uses the class
ZO_ChampionAssignableActionBarSlot and this will create an object via
<objectName> = ZO_ChampionAssignableActionBarSlot:New

So search for ZO_ChampionAssignableActionBarSlot:New
https://github.com/esoui/esoui/blob/...ionbar.lua#L37

And you will see it generates a lcoal slot there so you need to find out where this local slot was added to a global variable
and so on.
You can see e.g. that it adds each slot to the table self.slots
table.insert(self.slots, slot)

And self of self.slots would point you to the function ZO_ChampionAssignableActionBar:Initialize(control)
and to the class ZO_ChampionAssignableActionBar
->So you again search for ZO_ChampionAssignableActionBar:New to find the object! And this object's.slots would be the table that was filled with the slots then:

https://github.com/esoui/esoui/blob/...ampion.lua#L65
self.championBar -> self -> function ChampionPerks:Initialize(control) -> ChampionPerks:New ->
https://github.com/esoui/esoui/blob/...pion.lua#L2599
Code:
CHAMPION_PERKS = ChampionPerks:New(self)
So it would be <globalObject> = CHAMPION_PERKS.championBar.slots (which is self.slots from above).
You can iterate that CHAMPION_PERKS.championBar.slots then to get each slot and then call
slot:CollectUnsavedChanges()

So whatever you want to do there with merTorchbug or zgoo is not easily doable with classes and objects and you need to read the actual game code, and then "debug" it ingaem using merTorchbug and zgoo to check what the __index entries (metatables -> e.g. object pointing to it's class) show you, and see what you can find there and use there.

And then you can do something ingaem with /script or /tb or /zgoo like this:
Code:
/tb CHAMPION_PERKS.championBar.slots[1]:CollectUnsavedChanges()
Which would point to the 1st (index 1) slot in self.slots


How to find an ingame functionality by it's shown "text" (e.g. keybind "Revert changes")
But if you want to find a function that does something to discard changes then search for that in the proper esoui/ingame/whateverFolderApplies here lua and xml files -> It should be named like discrd there too or whatever the ingame keybind says.
Easiest way to find it would be
1st) find english text shown ingame and write down
2nd) Check ingame localization in merTorchbug -> type /tb and at teh global inspector select tab "Strings" and then search for that string. You will find the SI_WHATEVER* constant then.
Or find it in the esoui sources ingame localization.lua files:
https://github.com/esoui/esoui/blob/...tedstrings.lua
https://github.com/esoui/esoui/blob/...tedstrings.lua

3rd) Search for that SI_WHATEVER* constant in the esoui sources lua and xml files then to find the place where it is used,
4rd) Check which file and folder matches your usecase if this was found more than once
5th) Read the ZOs code and find out how the funciton is called -> Read above about class and "<object>" and call it accodingly properly using the object:functionName(param1, param2, .....)

Last edited by Baertram : 01/23/24 at 10:12 AM.
  Reply With Quote