View Single Post
05/18/22, 01:09 PM   #3
tim99
 
tim99's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2017
Posts: 22
Ok, thx for that! I see where we are going to.

But the funny thing is.... i even used the meantioned function before, but no difference.

Lua Code:
  1. LowPop = LowPop or {}
  2. local lp = LowPop
  3. lp.name = "LowPop"
  4.  
  5. --/script d(GetSecondsUntilCampaignEnd(GetAssignedCampaignId()))
  6. ----------------------------------------------------------------------------------------------------
  7. function lp.addonLoaded(event, addonName)
  8.     if addonName ~= lp.name then return end
  9.     EVENT_MANAGER:UnregisterForEvent(lp.name, EVENT_ADD_ON_LOADED)
  10.    
  11.     QueryCampaignSelectionData()
  12.     --QueryCampaignLeaderboardData()
  13.    
  14.     EVENT_MANAGER:RegisterForUpdate("LowPop_Update", 10000, function()
  15.         --QueryCampaignSelectionData()
  16.         d("|c00FF00 ### TEST GetSecondsUntilCampaignEnd: |r"..tostring(GetSecondsUntilCampaignEnd(GetAssignedCampaignId())))
  17.     end)
  18.    
  19. end
  20. ----------------------------------------------------------------------------------------------------
  21. EVENT_MANAGER:RegisterForEvent(lp.name, EVENT_ADD_ON_LOADED, lp.addonLoaded)

Returns "0" until "campaigns" opened. Anyone an idea why?


BTW:
What i had in mind is an addon to show when the LowPop Bonus gets enabled in Cyro. The above code is just cutted down to figure out whats going on. I used the given EVENT and not a generell 10sec timer to update. Thats just for testing!

Also changed isLowPopEnabled to the campaignEnds thing to be able to test. Was annoying in the beginning to wait until a real LowPop was enabled while spamming that L button

Also on the PTS is doesnt seem to work at all.

!!! If that helps, i can not publish that addon after figuring out, but just use myself and also can delete this post or blank out. So it will not "sum up" but is really just one call
  Reply With Quote