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, 07:29 PM   #7
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:51 PM   #8
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

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