Thread Tools Display Modes
08/20/14, 08:40 AM   #1
QuadroTony
Banned
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 828
Notification Accept and One-Click-Logout [request]

Hello, i think we really need the addon(or we already have?) to automatic accept notification about "Your guildmaster finished AA in **** minutes" really got me

Another additional idea, is it possible to make "one key logout" addon? will be usefull for some types of farm, like food/recipes/motifs farm
  Reply With Quote
08/20/14, 10:41 AM   #2
Randactyl
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 251
At the risk of sounding like an ass, the search bar is pretty great

LogOut

and these functions exist

ConfirmCampaignEntry(*integer* _campaignId_, *bool* _queueAsGroup_, *bool* _accept_)

RemoveRaidScoreNotification(*integer* _notificationId_)

among others along the same lines, so looks like something is doable.

Last edited by Randactyl : 08/20/14 at 10:43 AM.
  Reply With Quote
08/20/14, 12:12 PM   #3
QuadroTony
Banned
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 828
Appreciate this! ty
  Reply With Quote
08/21/14, 06:03 AM   #4
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
If you want to completely disable raid leaderboard notifications, just unregister notifications provider:
Lua Code:
  1. EVENT_MANAGER:UnregisterForEvent("Notifications", EVENT_RAID_SCORE_NOTIFICATION_ADDED)
  2. EVENT_MANAGER:UnregisterForEvent("Notifications", EVENT_RAID_SCORE_NOTIFICATION_REMOVED)

Right now I'm trying to figure out how to disable notifications just for selected guilds.
  Reply With Quote
08/21/14, 07:40 AM   #5
Ayantir
 
Ayantir's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 1,019
I tried those 2 lines of code Garkin, and it seems they doesn't work (Those notifs are really annoying)

https://www.dropbox.com/s/a3zvv16n1n...%20-%200.1.zip

Maybe i make someting wrong

Last edited by Ayantir : 08/21/14 at 07:43 AM.
  Reply With Quote
08/21/14, 09:46 AM   #6
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Originally Posted by Ayantir View Post
I tried those 2 lines of code Garkin, and it seems they doesn't work (Those notifs are really annoying)

https://www.dropbox.com/s/a3zvv16n1n...%20-%200.1.zip

Maybe i make someting wrong
Try to unregister it later - for example when addon is loaded of when player is activated. It is possible that you are trying to unregister it before it gets registered.


I have tried to update Thurisaz Guild Info to block raid notifications, but I didn't have time to test it yet.
https://www.dropbox.com/s/349xrkiqwb...dInfo-0.57.zip

I'm trying a bit more complex version of this code:
Lua Code:
  1. ZO_PreHook(NOTIFICATIONS.providers[10], "BuildNotificationList", function(self)
  2.     for index = 1, GetNumRaidScoreNotifications() do
  3.         local notificationId = GetRaidScoreNotificationId(index)
  4.         RemoveRaidScoreNotification(notificationId)
  5.     end
  6. end)
  Reply With Quote
08/21/14, 12:45 PM   #7
CrazyDutchGuy
 
CrazyDutchGuy's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 89
I have it disabled ages ago, but never made an addon out of it cause it is just in one of my general utility addon.

Anyways packaged it and uploaded, enjoy.

http://www.esoui.com/downloads/info7...otifySpam.html

In regards to what Garkin is doing. I never felt the need for it, cause you should know what your guild is doing, anyways
  Reply With Quote
08/21/14, 02:00 PM   #8
QuadroTony
Banned
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 828
for example im only 50 lvl
too far from Trials
i have one main guild and 4 trade guilds, 3 of the doing trials very often
so not neccessary to see this again and again i think
and you always can see the leaderboard in the group page for things you interesting in =)

Last edited by QuadroTony : 08/21/14 at 02:05 PM.
  Reply With Quote
08/21/14, 07:29 PM   #9
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
Originally Posted by Garkin View Post
If you want to completely disable raid leaderboard notifications, just unregister notifications provider:
Lua Code:
  1. EVENT_MANAGER:UnregisterForEvent("Notifications", EVENT_RAID_SCORE_NOTIFICATION_ADDED)
  2. EVENT_MANAGER:UnregisterForEvent("Notifications", EVENT_RAID_SCORE_NOTIFICATION_REMOVED)

Right now I'm trying to figure out how to disable notifications just for selected guilds.
I dont mess with pvp stuff, so I may be way off on what your trying to do, or there may be a better way but at a quick glance it looks like you could you hook this:
Lua Code:
  1. -- Notifications.lua Line 462 --
  2. function ZO_LeaderboardRaidProvider:BuildNotificationList()

Grab the raid score notifications yourself & check to see if the person is a guild member (you could also set options for showing friend notifications as well while your here it seems):
Lua Code:
  1. for notificationIndex = 1, GetNumRaidScoreNotifications() do
  2.         local notificationId = GetRaidScoreNotificationId(notificationIndex)
  3.         local raidId, raidScore, millisecondsSinceRequest = GetRaidScoreNotificationInfo(notificationId)
  4.         local numMembers = GetNumRaidScoreNotificationMembers(notificationId)
  5.         local hasFriend = false
  6.         local hasGuildMember = false
  7.         for memberIndex = 1, numMembers do
  8.             local displayName, characterName, isFriend, isGuildMember = GetRaidScoreNotificationMemberInfo(notificationId, memberIndex)
  9. ...
? Is there a way to get a list of guilds a player is in I didn't see a function for it?

If so loop through those or loop through all of the guilds to find out which guildId that characterName is in (or there may be a better way to do this part?). You all ready have the memberIndex so you dont need to check every guild member (just compare the characterNames to see if they match) using:
Lua Code:
  1. GetGuildMemberCharacterInfo(integer guildId, luaindex memberIndex)
  2.     -- Returns: bool hasCharacter, string characterName, string zoneName, integer classId, integer alliance, integer level, integer veteranRank

That would tell you which guild they are in and then decide if you want to show the notification and pass it on to the original function you hooked (or not)....or that might not work...I dont think you can pass single notifications back to the original function it checks all notifications it seems.

But, you could just rewrite the function to suit your needs. I'll leave the rest of my post up there though because it would still be the basic idea of how you would want to rewrite ZO_LeaderboardRaidProvider:BuildNotificationList() to do what your looking for.
  Reply With Quote
08/21/14, 07:41 PM   #10
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
Originally Posted by Garkin View Post
I'm trying a bit more complex version of this code:
Lua Code:
  1. ZO_PreHook(NOTIFICATIONS.providers[10], "BuildNotificationList", function(self)
  2.     for index = 1, GetNumRaidScoreNotifications() do
  3.         local notificationId = GetRaidScoreNotificationId(index)
  4.         RemoveRaidScoreNotification(notificationId)
  5.     end
  6. end)
Oh, and now I read your second post and see that. I'm assuming providers[10] refers to the leaderboard raid notifications. Which seems simpler than what I suggested (rewriting the BuildNotificationList function), but same principle looks like it would work. Inside your notification loop do something like this to check if its a guildMember:
Lua Code:
  1. for memberIndex = 1, numMembers do
  2.             local displayName, characterName, isFriend, isGuildMember = GetRaidScoreNotificationMemberInfo(notificationId, memberIndex)
  3. .....
and ...same as I said in above post to figure out which guild & if you want to remove the notification or not.
  Reply With Quote
08/21/14, 07:51 PM   #11
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Originally Posted by circonian View Post
...
I'd like to hook ZO_LeaderboardRaidProvider but it's local to EsoUI\Ingame\Contacts\Notifications.lua.
Lua Code:
  1. local ZO_LeaderboardRaidProvider = ZO_NotificationProvider:Subclass()
That's why I have hooked NOTIFICATIONS.providers[10]:BuildNotificationList() instead.

By the way did you check code in modified Thurisaz Guild Info which I have linked above?

Lua Code:
  1. ZO_PreHook(NOTIFICATIONS.providers[10], "BuildNotificationList", function(self)
  2.     for index = 1, GetNumRaidScoreNotifications() do
  3.         local notificationId = GetRaidScoreNotificationId(index)
  4.         local numMembers = GetNumRaidScoreNotificationMembers(notificationId)
  5.         local showNotification = false
  6.         local guildMembers = {}
  7.         for memberIndex = 1, numMembers do
  8.             local displayName, _, _, isGuildMember = GetRaidScoreNotificationMemberInfo(notificationId, memberIndex)
  9.             if isGuildMember then
  10.                 table.insert(guildMembers, displayName)
  11.             end
  12.         end
  13.         for _, name in ipairs(guildMembers) do
  14.             for guildIndex = 1, GetNumGuilds() do
  15.                 if not showNotification and TI.GetGuildSetting(guildIndex) and TI.GetRaidScoreNotifySetting(guildIndex) then
  16.                     local guildId = GetGuildId(guildIndex)
  17.                     for memberIndex = 1, GetNumGuildMembers(guildId) do
  18.                         local displayName = GetGuildMemberInfo(guildId, memberIndex)
  19.                         if displayName == name then
  20.                             showNotification = true
  21.                             break
  22.                         end
  23.                     end
  24.                 end
  25.             end
  26.         end
  27.         if not showNotification then
  28.             RemoveRaidScoreNotification(notificationId)
  29.         end
  30.     end
  31. end)
  Reply With Quote
08/21/14, 08:17 PM   #12
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
I had not looked at it

Oh, yeah your right it is local.
No I hadn't looked at it, but I see you were all ready doing what I suggested.

Looks like it would work to me. Although I think you could get rid of one of the loops by doing this:

Warning: Spoiler


EDIT:
Or I may have spoke to soon. I've never done any pvp/raid stuff. I have no idea how any of it even works. I may be wrong about what I said above...I thought this memberIndex:
Lua Code:
  1. local numMembers = GetNumRaidScoreNotificationMembers(notificationId)
  2.         local hasFriend = false
  3.         local hasGuildMember = false
  4.         for memberIndex = 1, numMembers do
  5.             local displayName, characterName, isFriend, isGuildMember = GetRaidScoreNotificationMemberInfo(notificationId, memberIndex)

was refering to the same memberIndex used for a guild members index,
Lua Code:
  1. local displayName = GetGuildMemberInfo(guildId, memberIndex)

but I read it again and think they might not be the same? Does the first one refer to memberIndex as the "memberIndex" for members of a raid party (people involved in that notification)? If so what I said would not work.

Last edited by circonian : 08/21/14 at 08:53 PM.
  Reply With Quote
08/21/14, 09:43 PM   #13
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
Originally Posted by Garkin View Post
I'd like to hook ZO_LeaderboardRaidProvider but it's local to EsoUI\Ingame\Contacts\Notifications.lua.
Sorry for the jumble of 1,000 different ideas :P and I still see nothing wrong with what you did, but another option is that you could also hook: NOTIFICATIONS:BuildMasterList().

It would be the same result as what you did so this may not be useful for what your doing, but I saw it & thought I would point it out in case you (or anyone else reading this post later) had any reason to hook any other notifications it might be easier to grab them all in one place:
Lua Code:
  1. -- hook this:
  2. function ZO_NotificationManager:BuildMasterList()
  3.     for i = 1, #self.providers do
  4.         self.providers[i]:BuildNotificationList()
  5.     end
  6. end
  7. -- with this:
  8. --function NOTIFICATIONS:BuildMasterList()

and just intercept self.providers[10] (or whatever provider is needed).

Last edited by circonian : 08/21/14 at 09:46 PM.
  Reply With Quote
08/22/14, 02:30 AM   #14
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Originally Posted by circonian View Post
Oh, yeah your right it is local.
No I hadn't looked at it, but I see you were all ready doing what I suggested.

Looks like it would work to me. Although I think you could get rid of one of the loops by doing this:

Warning: Spoiler


EDIT:
Or I may have spoke to soon. I've never done any pvp/raid stuff. I have no idea how any of it even works. I may be wrong about what I said above...I thought this memberIndex:
Lua Code:
  1. local numMembers = GetNumRaidScoreNotificationMembers(notificationId)
  2.         local hasFriend = false
  3.         local hasGuildMember = false
  4.         for memberIndex = 1, numMembers do
  5.             local displayName, characterName, isFriend, isGuildMember = GetRaidScoreNotificationMemberInfo(notificationId, memberIndex)

was refering to the same memberIndex used for a guild members index,
Lua Code:
  1. local displayName = GetGuildMemberInfo(guildId, memberIndex)

but I read it again and think they might not be the same? Does the first one refer to memberIndex as the "memberIndex" for members of a raid party (people involved in that notification)? If so what I said would not work.
The first member index is in the raid group and it's not the same as member index in guild.

Originally Posted by circonian View Post
Sorry for the jumble of 1,000 different ideas :P and I still see nothing wrong with what you did, but another option is that you could also hook: NOTIFICATIONS:BuildMasterList().

It would be the same result as what you did so this may not be useful for what your doing, but I saw it & thought I would point it out in case you (or anyone else reading this post later) had any reason to hook any other notifications it might be easier to grab them all in one place:
Lua Code:
  1. -- hook this:
  2. function ZO_NotificationManager:BuildMasterList()
  3.     for i = 1, #self.providers do
  4.         self.providers[i]:BuildNotificationList()
  5.     end
  6. end
  7. -- with this:
  8. --function NOTIFICATIONS:BuildMasterList()

and just intercept self.providers[10] (or whatever provider is needed).
ZO_NotificationManager is a local name, so if I want to do it this way I will have to hook NOTIFICATIONS
(global instance of ZO_NotificationManager). But I think that for my purpose is better to hook directly instance of ZO_LeaderboardRaidProvider which is NOTIFICATIONS.providers[10].
  Reply With Quote
08/22/14, 02:09 PM   #15
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
Originally Posted by Garkin View Post
The first member index is in the raid group and it's not the same as member index in guild.


ZO_NotificationManager is a local name, so if I want to do it this way I will have to hook NOTIFICATIONS
(global instance of ZO_NotificationManager). But I think that for my purpose is better to hook directly instance of ZO_LeaderboardRaidProvider which is NOTIFICATIONS.providers[10].
Yeah NotificationManager is local, that is why I said to hook it with:
Lua Code:
  1. -- with this:
  2. --function NOTIFICATIONS:BuildMasterList()
and yeah your way is better for what your doing, I just thought of it & thought I would post it in case someone else searches for NOTIFICATIONS and comes here looking for info/help & reads our discussion. The other way might end up being useful to someone.
  Reply With Quote

ESOUI » AddOns » AddOn Search/Requests » Notification Accept and One-Click-Logout [request]


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off