View Single Post
08-29-21, 11:33 AM   #5
xubo
A Murloc Raider
Join Date: Aug 2021
Posts: 6
So the code I'm using for the ADDON_LOADED trigger is

Lua Code:
  1. function core:init(event, name)
  2.     if (name ~= "MCL") then return end
  3.     start = core.Config.Toggle();
  4.     hide = core.Config.Toggle();
  5.  
  6.     SLASH_MCL1 = "/mcl";
  7.     SlashCmdList.MCL = core.Config.Toggle; 
  8.     core:Print("Welcome back", UnitName("player").."!");
  9. end
  10.  
  11. local events = CreateFrame("Frame");
  12. events:RegisterEvent("ADDON_LOADED");
  13. events:SetScript("OnEvent", core.init);

My mountList, SectionNames are tables provided in a different file and they look like this.

Lua Code:
  1. mountList = {
  2.     SL = {
  3.         name = "SL",
  4.         Achievement = {
  5.             name = "Achievement",
  6.             mounts = {186654, 186637, 184183, 182596, 186653, 184166, 186655, 182717, 187525},
  7.             mountID = {}
  8.         },....
  9.  
  10. sectionNames = {
  11.     Classic = {
  12.         name = "Classic",
  13.         category = {"Reputation", "Dungeon Drop", "Raid Drop"},
  14.     },...

Yes I would say that is the table that is not always fully traversed. I've just tried adding a LoadAddon line for Blizzard_Collections inside the core.init function

Lua Code:
  1. SLASH_MCL1 = "/mcl";
  2.     LoadAddOn("Blizzard_Collections")
  3.     SlashCmdList.MCL = core.Config.Toggle; 
  4.     core:Print("Welcome back", UnitName("player").."!");

Still the same result. Attached is the addon, if anyone would take a look I would be appreciated.
Attached Files
File Type: zip MCL.zip (35.0 KB, 146 views)

Last edited by xubo : 08-29-21 at 01:24 PM.
  Reply With Quote