Skip to content

Commit

Permalink
Can now correctly announce "No priority". Will by default only trigge…
Browse files Browse the repository at this point in the history
…r if an epic was found in the loot (but triggers on all loot of course)
  • Loading branch information
dieck committed Jun 9, 2020
1 parent 2f76d58 commit dbf4e8f
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 6 deletions.
39 changes: 33 additions & 6 deletions core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ local defaults = {
enabled = true,
debug = false,
raidannounce = true,
noprioannounce = false,
noprioannounce = true,
noprioannounce_noepic = false,
ignorereopen = 90,
charannounce = false,
whisperimport = false,
Expand Down Expand Up @@ -99,13 +100,21 @@ prioOptionsTable = {
newline1 = { name="", type="description", order=21 },
noprio = {
name = L["Announce No Priority"],
desc = L["Announces if there is no priority on an item. Be careful: Will trigger on all mobs, not only bosses..."],
desc = L["Announces if there is no priority on an item. Will only trigger if at least one Epic is found."],
type = "toggle",
order = 30,
set = function(info,val) Prio3.db.profile.noprioannounce = val end,
get = function(info) return Prio3.db.profile.noprioannounce end,
},
newline2 = { name="", type="description", order=31 },
noprionoepic = {
name = L["also announce without Epic"],
desc = L["Announces if there is no priority on an item. Be careful: Will trigger on all mobs, not only bosses..."],
type = "toggle",
order = 31,
set = function(info,val) Prio3.db.profile.noprioannounce_noepic = val end,
get = function(info) return Prio3.db.profile.noprioannounce_noepic end,
},
newline2 = { name="", type="description", order=32 },
whisper = {
name = L["Whisper to Char"],
desc = L["Announces Loot Priority list to char by whisper"],
Expand Down Expand Up @@ -422,8 +431,24 @@ function Prio3:LOOT_OPENED()
loot = GetLootInfo()
numLootItems = GetNumLootItems();

-- look if epics are found (for No prio announces)
local epicFound = false

for i=1,numLootItems do
Prio3:HandleLoot(i)
itemLink = GetLootSlotLink(i)
if itemLink then
-- if no itemLink, it's most likely money
local d, itemId, enchantId, jewelId1, jewelId2, jewelId3, jewelId4, suffixId, uniqueId, linkLevel, specializationID, reforgeId, unknown1, unknown2 = strsplit(":", itemLink)
-- identifying Epics by color... (should I do Legendary as well? meh)
if d == "\124cffa335ee\124Hitem" then
epicFound = true
end
end
end

-- handle loot
for i=1,numLootItems do
Prio3:HandleLoot(i, epicFound)
end

end
Expand Down Expand Up @@ -462,7 +487,7 @@ function Prio3:Announce(itemLink, prio, chars, hasPreviousPrio)

end

function Prio3:HandleLoot(slotid)
function Prio3:HandleLoot(slotid, epicFound)

itemLink = GetLootSlotLink(slotid)

Expand Down Expand Up @@ -520,7 +545,9 @@ function Prio3:HandleLoot(slotid)

if table.getn(itemprios.p1) == 0 and table.getn(itemprios.p2) == 0 and table.getn(itemprios.p3) == 0 then
if Prio3.db.profile.noprioannounce then
Prio3:Output(L["No priorities found for playerOrItem"](itemLink))
if epicFound or Prio3.db.profile.noprioannounce_noepic then
Prio3:Output(L["No priorities found for playerOrItem"](itemLink))
end
end
end
if table.getn(itemprios.p1) > 0 then
Expand Down
2 changes: 2 additions & 0 deletions locale-deDE.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ if L then
L["Enabled"] = "Aktiv"
L["Enables / disables the addon"] = "Aktiviert / deaktivert das Addon"
L["Announce No Priority"] = "Keine Priorität auch bekanntgeben"
L["also announce without Epic"] = "auch ohne Epic"
L["Announce to Raid"] = "Raid benachrichtigen"
L["Announces Loot Priority list to raid chat"] = "Gibt die Loot-Priorität an den Raid-Chat aus."
L["Whisper to Char"] = "Spieler anflüstern"
L["Announces Loot Priority list to char by whisper"] = "Gibt die Loot-Priorität an den Spieler geflüstert aus."
L["Announces if there is no priority on an item. Be careful: Will trigger on all mobs, not only bosses..."] = "Gibt aus wenn es keine Priorität auf einem Item gibt. Vorsicht, greift bei allen Mobs, nicht nur Bosse..."
L["Announces if there is no priority on an item. Will only trigger if at least one Epic is found."] = "Gibt aus wenn es keine Priorität auf einem Item gibt. Greift nur wenn mindestens ein Epic gefunden wurde"
L["Mute (sec)"] = "Stummschaltung (Sek)"
L["Ignores loot encountered a second time for this amount of seconds. 0 to turn off."] = "Ignoriert Loot der zum zweiten Mal gefunden wird für diese Anzahl Sekunden. 0 um nie zu ignorieren."
L["Import String"] = "Import String"
Expand Down
2 changes: 2 additions & 0 deletions locale-enUS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ if L then
L["Enabled"] = "Enabled"
L["Enables / disables the addon"] = "Enables / disables the addon"
L["Announce No Priority"] = "Announce No Priority"
L["also announce without Epic"] = "all w/o Epic"
L["Announce to Raid"] = "Announce to Raid"
L["Enables / disables the addon"] = "Enables / disables the addon"
L["Announces Loot Priority list to raid chat"] = "Announces Loot Priority list to raid chat"
L["Whisper to Char"] = "Whisper to Char"
L["Announces Loot Priority list to char by whisper"] = "Announces Loot Priority list to char by whisper"
L["Announces if there is no priority on an item. Be careful: Will trigger on all mobs, not only bosses..."] = "Announces if there is no priority on an item. Be careful: Will trigger on all mobs, not only bosses..."
L["Announces if there is no priority on an item. Will only trigger if at least one Epic is found."] = "Announces if there is no priority on an item. Will only trigger if at least one Epic is found."
L["Mute (sec)"] = "Mute (sec)"
L["Ignores loot encountered a second time for this amount of seconds. 0 to turn off."] = "Ignores loot encountered a second time for this amount of seconds. 0 to turn off."
L["Import String"] = "Import String"
Expand Down

0 comments on commit dbf4e8f

Please sign in to comment.