# HG changeset patch # User James D. Callahan III # Date 1348745981 18000 # Node ID f45ff137cf8ff72c293d7394a6ca8ae1378f79ca # Parent aa48190cb5eb7ad5cfeaca57de8ba9931b255361 Improved detection of fishing nodes on mouseover. diff -r aa48190cb5eb -r f45ff137cf8f Main.lua --- a/Main.lua Thu Sep 27 04:16:54 2012 -0500 +++ b/Main.lua Thu Sep 27 06:39:41 2012 -0500 @@ -58,6 +58,7 @@ CHAT_MSG_SYSTEM = true, COMBAT_LOG_EVENT_UNFILTERED = true, COMBAT_TEXT_UPDATE = true, + CURSOR_UPDATE = true, FORGE_MASTER_OPENED = true, GOSSIP_SHOW = true, GUILDBANKFRAME_OPENED = true, @@ -1029,6 +1030,21 @@ end -- do-block +function WDP:CURSOR_UPDATE(event_name) + if current_action.fishing_target or _G.Minimap:IsMouseOver() or not private.SPELL_FLAGS_BY_LABEL[current_action.spell_label] then + return + end + local text = _G["GameTooltipTextLeft1"]:GetText() + + if not text or text == "Fishing Bobber" then + text = "NONE" + else + current_action.fishing_target = true + end + current_action.identifier = ("%s:%s"):format(current_action.spell_label, text) +end + + function WDP:ITEM_TEXT_BEGIN(event_name) local unit_type, unit_idnum = ParseGUID(_G.UnitGUID("npc")) @@ -1088,7 +1104,11 @@ end, [AF.OBJECT] = true, [AF.ZONE] = function() - return _G.IsFishingLoot() + if not _G.IsFishingLoot() then + return false + end + current_action.zone_data = UpdateDBEntryLocation("zones", current_action.identifier) + return true end, } @@ -1739,10 +1759,7 @@ current_action.object_name = target_name current_action.target_type = AF.OBJECT elseif bit.band(spell_flags, AF.ZONE) == AF.ZONE then - local identifier = ("%s:%s"):format(spell_label, _G["GameTooltipTextLeft1"]:GetText() or "NONE") -- Possible fishing pool name. - current_action.zone_data = UpdateDBEntryLocation("zones", identifier) current_action.target_type = AF.ZONE - current_action.identifier = identifier end end private.tracked_line = spell_line