Collectible Unlocked Event?
I'm trying to get my addon to trigger when a collectible is unlocked, specifically when a house is purchased so that I can update my data. However I can't seem to find the event that I thought was there a while back. The event "EVENT_COLLECTIBLE_UPDATED" doesn't seem to fire when I think it should and the "EVENT_COLLECTION_UPDATED" doesn't have any other parameters that it passes to detect what was going on. Anyone have some insight here? Even just tell me where to look in the source code. I looked there but the event that is listed in the source code doesn't exist anymore.
Thanks in advance! |
I only did a quick search, and you might have found this already:
Code:
--[[ EVENT_MANAGER:RegisterForEvent("ZO_CollectibleDataManager", EVENT_COLLECTION_UPDATED, function(_, ...) self:OnCollectionUpdated(...) end) EVENT_MANAGER:RegisterForEvent("ZO_CollectibleDataManager", EVENT_ESO_PLUS_FREE_TRIAL_STATUS_CHANGED, function(_, ...) self:OnESOPlusFreeTrialStatusChanged(...) end) EVENT_MANAGER:RegisterForEvent("ZO_CollectibleDataManager", EVENT_COLLECTIBLES_UNLOCK_STATE_CHANGED, function(_, ...) self:OnCollectiblesUnlockStateChanged(...) end) EVENT_MANAGER:RegisterForEvent("ZO_CollectibleDataManager", EVENT_COLLECTIBLE_NEW_STATUS_CLEARED, function(_, ...) self:OnCollectibleNewStatusCleared(...) end) EVENT_MANAGER:RegisterForEvent("ZO_CollectibleDataManager", EVENT_COLLECTIBLE_CATEGORY_NEW_STATUS_CLEARED, function(_, ...) self:OnCollectibleCategoryNewStatusCleared(...) end) EVENT_MANAGER:RegisterForEvent("ZO_CollectibleDataManager", EVENT_COLLECTIBLE_NOTIFICATION_NEW, function(_, ...) self:OnCollectibleNotificationNew(...) end) EVENT_MANAGER:RegisterForEvent("ZO_CollectibleDataManager", EVENT_COLLECTIBLE_NOTIFICATION_REMOVED, function(_, ...) self:OnCollectibleNotificationRemoved(...) end) EVENT_MANAGER:RegisterForEvent("ZO_CollectibleDataManager", EVENT_HOUSING_PRIMARY_RESIDENCE_SET, function(_, ...) self:OnPrimaryResidenceSet(...) end) https://github.com/esoui/esoui/blob/...atamanager.lua Maybe you can use EVENT_COLLECTIBLES_UNLOCK_STATE_CHANGED (if this is not the one which you meant was removed). Or you use the callback function "function ZO_CollectibleDataManager:OnCollectiblesUnlockStateChanged()" with a ZO_PreHook. As the are no parameter you might need to rebuild the code in there yourself to get the colelctibleIds unlocked: Lua Code:
Edit: Please check if the PreHook will break the function GetNextDirtyUnlockStateCollectibleId somehow so that the original code won't get any new collectibelids after your prehook anymore. |
I actually ended up using EVENT_COLLECTIBLE_NOTIFICATION_NEW because I realised that every time you unlock a collectible you get a notification and the collectible id is one of the parameters. Works perfectly. Thanks for looking into it though!
|
All times are GMT -6. The time now is 06:00 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI