View Single Post
01/03/21, 05:08 PM   #3
QuantumPie
AddOn Author - Click to view addons
Join Date: Sep 2019
Posts: 32
Originally Posted by Baertram View Post
The hook should work as the ACHIEVEMENTS global exists, is the correct object of the Achievment class.
I've read the code this way:
https://github.com/esoui/esoui/blob/...ents.lua#L1893

Called by the XML's OnInitialized event -> ZO_Achievements_OnInitialize(self) -> ACHIEVEMENTS = Achievements:New(self) ->
https://github.com/esoui/esoui/blob/...ments.lua#L949
-> object:Initialize(...) -> https://github.com/esoui/esoui/blob/...ments.lua#L963
-> function Achievements:Initialize(control) -> self:InitializeSummary()
-> function Achievements:InitializeSummary()


Try to use MerTorchbug Updated or zgoo to inspect the ACHIEVEMENTS table if the function InitializeSummary is given (maybe below the __index sub-metatables) and try to run it via SHIFT or CTRL+click. Does your d() mesages show then? Or if you explicitly call it like
/tb ACHIEVEMENTS:InitializeSummary()

Or it was done before the chat output is ready so you are not seeing it (will first be visible at event_player_activated!).
-> Install the addon pChat which should fix this.
-> OR/AND use the LibDebugLogger and the DebugLogViewer UI to see the addon debug messages prior the chat output is ready + stored in your SavedVariables.

But: I've added your code to any of my addons event_player_activated callback function and I also do not see it.
So maybe it's a oo generic achievement class you try to hook there.
Or you expect this to be something that is not the UI element you want to get into depth with?
Manually calling the function showed the output. LibDebugLogger is what I was already using to inspect the chat output. Do I need to set the time to "Current Session"? When I did that, I saw thousands of prints along the line of "Avoiding cycle on table..." which originated from my addon.

Stacktrace:
Lua Code:
  1. .              Avoiding cycle on table...
  2. |rstack traceback:
  3. user:/AddOns/LibDebugLogger/Initialization.lua:80: in function 'LogChatMessage'
  4. EsoUI/Libraries/Utility/ZO_Hook.lua:18: in function 'AddDebugMessage'
  5. EsoUI/Libraries/Globals/DebugUtils.lua:7: in function 'EmitMessage'
  6. EsoUI/Libraries/Globals/DebugUtils.lua:27: in function 'EmitTable'
  7. EsoUI/Libraries/Globals/DebugUtils.lua:30: in function 'EmitTable'
  8. EsoUI/Libraries/Globals/DebugUtils.lua:30: in function 'EmitTable'
  9. EsoUI/Libraries/Globals/DebugUtils.lua:30: in function 'EmitTable'
  10. EsoUI/Libraries/Globals/DebugUtils.lua:30: in function 'EmitTable'
  11. EsoUI/Libraries/Globals/DebugUtils.lua:30: in function 'EmitTable'
  12. EsoUI/Libraries/Globals/DebugUtils.lua:30: in function 'EmitTable'
  13. EsoUI/Libraries/Globals/DebugUtils.lua:30: in function 'EmitTable'
  14. EsoUI/Libraries/Globals/DebugUtils.lua:41: in function 'd'
  15. user:/AddOns/QuantumsGlobalAchievements/QuantumsGlobalAchievements.lua:12: in function 'addon:Test'
  16. user:/AddOns/QuantumsGlobalAchievements/QuantumsGlobalAchievements.lua:25: in function 'addon:Initialize'
  17. user:/AddOns/QuantumsGlobalAchievements/QuantumsGlobalAchievements.lua:32: in function 'OnAddOnLoaded'
  Reply With Quote