# HG changeset patch # User James D. Callahan III # Date 1351999892 18000 # Node ID ac673d315d612730691dcc2d71ad57917014436d # Parent 2fdc940c1748922183a23ef860de3c1898ed323b Trying SHOW_LOOT_TOAST instead of CHAT_MSG_LOOT. diff -r 2fdc940c1748 -r ac673d315d61 Main.lua --- a/Main.lua Sat Nov 03 16:39:07 2012 -0500 +++ b/Main.lua Sat Nov 03 22:31:32 2012 -0500 @@ -82,6 +82,7 @@ QUEST_DETAIL = true, QUEST_LOG_UPDATE = true, QUEST_PROGRESS = true, + SHOW_LOOT_TOAST = true, TAXIMAP_OPENED = true, TRADE_SKILL_SHOW = true, TRAINER_CLOSED = true, @@ -975,20 +976,32 @@ end +function WDP:SHOW_LOOT_TOAST(event_name, loot_type, item_link, quantity) + if loot_type ~= "item" then + return + end + local npc = NPCEntry(private.raid_finder_boss_id) + + if not npc then + return + end + local item_id = ItemLinkToID(item_link) + + if not item_id then + return + end + local loot_type = "raid_finder_loot" + local encounter_data = npc.encounter_data[InstanceDifficultyToken()] + encounter_data[loot_type] = encounter_data[loot_type] or {} + encounter_data.loot_counts = encounter_data.loot_counts or {} + encounter_data.loot_counts[loot_type] = (encounter_data.loot_counts[loot_type] or 0) + 1 + + table.insert(encounter_data[loot_type], ("%d:%d"):format(item_id, quantity)) +end + + local CHAT_MSG_LOOT_UPDATE_FUNCS = { [AF.NPC] = function(item_id, quantity) - local npc = NPCEntry(private.raid_finder_boss_id) - - if not npc then - return - end - local loot_type = "raid_finder_loot" - local encounter_data = npc.encounter_data[InstanceDifficultyToken()] - encounter_data[loot_type] = encounter_data[loot_type] or {} - encounter_data.loot_counts = encounter_data.loot_counts or {} - encounter_data.loot_counts[loot_type] = (encounter_data.loot_counts[loot_type] or 0) + 1 - - table.insert(encounter_data[loot_type], ("%d:%d"):format(item_id, quantity)) end, [AF.ZONE] = function(item_id, quantity) current_loot = {