12/16/14, 02:31 PM | #1 |
cannot unregister EVENT_RAID_SCORE_NOTIFICATION_*
I am currently playing around with the notification system and have encountered some strangeness that I cannot explain to myself.
My test setup: Lua Code:
I expect this to hide the raid notifications until some other event refreshes the notification manager. When I load the addon I get: Code:
KeyboardNotifications true true When I already have got some of them in my notifications panel and press the delete button, it shows Code:
remove event changed from 4 to 3 Code:
[C]: in function 'error' user:/AddOns/test/test.lua:42: in function 'hookFunction' EsoUI/Libraries/Utility/ZO_Hook.lua:19: in function 'OnNumNotificationsChanged' EsoUI/Ingame/Contacts/Notifications_Common.lua:705: in function 'ZO_NotificationManager:BuildNotificationList' EsoUI/Ingame/Contacts/Notifications_Common.lua:678: in function 'ZO_NotificationManager:RefreshNotificationList' EsoUI/Ingame/Contacts/Notifications_Common.lua:58: in function 'ZO_NotificationProvider:PushUpdateToNotificationManager' EsoUI/Ingame/Contacts/Notifications_Common.lua:34: in function '(anonymous)' Notifications_Common.lua:34 is inside the handler function that gets registered to both events in question and is - as far as I can see - never used anywhere else. Maybe somebody can explain to me what is happening. |
|
12/16/14, 04:05 PM | #2 |
What is happening:
As you can see raid score notification will be eventually added to the list even if you unregister update events. |
|
12/16/14, 07:02 PM | #3 |
|
Perhaps what you need to override is ZO_NotificationList:FilterScrollList()
edit: no, that wouldn't report correct numbers. So post-hook ZO_LeaderboardRaidProvider:BuildNotificationList(), removing undesired entries (which is all of them? if so, no need to call original, just ZO_ClearNumericallyIndexedTable(self.list) and done ) edit2: lol, exactly Garkin, I just edited it before reading your post Last edited by merlight : 12/16/14 at 07:37 PM. |
12/16/14, 07:30 PM | #4 | |
I think that's the best place where you can change which notifications will be displayed. If you modify FilterScrollList instead, I believe that when you receive new notification there will be glowing notification button on the chat window. It's becuae function just counts number of items on each notification list (#provider.list), it does not check if items are filtered or not. |
||
12/17/14, 12:46 AM | #5 |
It's clear to me that it will trigger when any other notification event is fired, but that does not explain why it still happens in response to me clicking the delete button on a raid notification after I unregistered the EVENT_RAID_SCORE_NOTIFICATION_REMOVED event.
I will test it again with all other notification events unregistered in the evening. In that case the push function in line 34 should never be called, right? |
|
12/17/14, 01:57 AM | #6 | |
Last edited by Minceraft : 12/17/14 at 02:01 AM. |
||
12/17/14, 07:38 AM | #7 | ||
|
|||
12/17/14, 10:39 AM | #8 |
Just tried to unregister every event related to notifications:
Lua Code:
The messages that were showing up when I revived obviously were caused by EVENT_PLAYER_ALIVE. When I join a campaign queue I get: Code:
EVENT_CAMPAIGN_QUEUE_JOINED user:/AddOns/test/test.lua:130: test stack traceback: [C]: in function 'error' user:/AddOns/test/test.lua:130: in function 'hookFunction' EsoUI/Libraries/Utility/ZO_Hook.lua:19: in function 'OnNumNotificationsChanged' EsoUI/Ingame/Contacts/Notifications_Common.lua:705: in function 'ZO_NotificationManager:BuildNotificationList' EsoUI/Ingame/Contacts/Notifications_Common.lua:678: in function 'ZO_NotificationManager:RefreshNotificationList' EsoUI/Ingame/Contacts/Notifications_Common.lua:58: in function 'ZO_NotificationProvider:PushUpdateToNotificationManager' EsoUI/Ingame/Contacts/Notifications_Common.lua:34: in function '(anonymous)' EVENT_CAMPAIGN_QUEUE_STATE_CHANGED user:/AddOns/test/test.lua:130: test stack traceback: [C]: in function 'error' user:/AddOns/test/test.lua:130: in function 'hookFunction' EsoUI/Libraries/Utility/ZO_Hook.lua:19: in function 'OnNumNotificationsChanged' EsoUI/Ingame/Contacts/Notifications_Common.lua:705: in function 'ZO_NotificationManager:BuildNotificationList' EsoUI/Ingame/Contacts/Notifications_Common.lua:678: in function 'ZO_NotificationManager:RefreshNotificationList' EsoUI/Ingame/Contacts/Notifications_Common.lua:58: in function 'ZO_NotificationProvider:PushUpdateToNotificationManager' EsoUI/Ingame/Contacts/Notifications_Common.lua:34: in function '(anonymous)' EVENT_CAMPAIGN_QUEUE_LEFT user:/AddOns/test/test.lua:130: test stack traceback: [C]: in function 'error' user:/AddOns/test/test.lua:130: in function 'hookFunction' EsoUI/Libraries/Utility/ZO_Hook.lua:19: in function 'OnNumNotificationsChanged' EsoUI/Ingame/Contacts/Notifications_Common.lua:705: in function 'ZO_NotificationManager:BuildNotificationList' EsoUI/Ingame/Contacts/Notifications_Common.lua:678: in function 'ZO_NotificationManager:RefreshNotificationList' EsoUI/Ingame/Contacts/Notifications_Common.lua:58: in function 'ZO_NotificationProvider:PushUpdateToNotificationManager' EsoUI/Ingame/Contacts/Notifications_Common.lua:34: in function '(anonymous)' |
|
12/17/14, 10:48 AM | #9 |
|
Try unregistering for GAMEPAD_NOTIFICATIONS as well, not sure how they would only use one.
|
12/17/14, 10:57 AM | #10 |
Lua Code:
You deserve a medal merlight! |
|
ESOUI » Developer Discussions » Lua/XML Help » cannot unregister EVENT_RAID_SCORE_NOTIFICATION_* |
«
Previous Thread
|
Next Thread
»
|
Display Modes |
Linear Mode |
Switch to Hybrid Mode |
Switch to Threaded Mode |
|
|