/trunk
}, |
}, |
dataBrokerOptions = { |
name = L["DataBroker Tooltip"], |
type = "group", |
args = { |
suppressInRaid = { |
name = L["Hide In Raid"], |
desc = L["Suppress the display of the LibDataBroker tooltip when in a raid"], |
type = "toggle", |
order = 10, |
get = "GetSuppressInRaid", |
set = "SetSuppressInRaid", |
}, |
}, |
}, |
} |
} |
resetInNewInstance = "ask", |
tooltipScale = 1, |
lockTooltip = false, |
suppressInRaid = false, |
} |
} |
-- For tracking grouped status |
local IS_IN_PARTY = nil |
local IS_IN_RAID = nil |
-- For tracking ghost status |
local WAS_GHOST = nil |
local ACD = LibStub("AceConfigDialog-3.0") |
ACD:AddToBlizOptions("NeedyGreedy", "NeedyGreedy", nil, "general") |
ACD:AddToBlizOptions("NeedyGreedy", L["Detached Tooltip"], "NeedyGreedy", "detachedTooltipOptions") |
ACD:AddToBlizOptions("NeedyGreedy", L["DataBroker Tooltip"], "NeedyGreedy", "dataBrokerOptions") |
ACD:AddToBlizOptions("NeedyGreedy", L["Profile"], "NeedyGreedy", "profile") |
-- Register slash options table |
self:RegisterEvent("PLAYER_REGEN_DISABLED") |
self:RegisterEvent("PLAYER_REGEN_ENABLED") |
self:RegisterEvent("PLAYER_ALIVE") |
self:RegisterEvent("RAID_ROSTER_UPDATE") |
self:ScheduleRepeatingTimer("ExpireItems", 10) |
elseif (GetNumPartyMembers() == 0 and GetNumRaidMembers() == 0) then |
IS_IN_PARTY = false |
IS_IN_RAID = false |
if self.db.profile.showOnParty and self.db.profile.detachedTooltip and self.db.profile.displayStatus then |
self.db.profile.displayStatus = false |
end |
end |
function NeedyGreedy:RAID_ROSTER_UPDATE() |
if GetNumRaidMembers() > 0 then |
IS_IN_RAID = true |
else |
IS_IN_RAID = false |
end |
end |
-- Chat scanning and loot recording |
function NeedyGreedy:START_LOOT_ROLL(event, rollid, rollTime) |
local texture, name, count, quality = GetLootRollItemInfo(rollid) |
self:RefreshTooltip() |
end |
function NeedyGreedy:GetSuppressInRaid(info) |
return self.db.profile.suppressInRaid |
end |
function NeedyGreedy:SetSuppressInRaid(info, suppressInRaid) |
self.db.profile.suppressInRaid = suppressInRaid |
self:RefreshTooltip() |
end |
-- QTip Frames |
local LibQTip = LibStub('LibQTip-1.0') |
local COL_MIN_WIDTH = 60 |
function NeedyGreedy:BuildDBReportTooltip(tooltip) |
tooltip:Clear() |
self:AddHeaderText(tooltip) |
self:PopulateReportTooltip(tooltip) |
self:AddPagerArrows(tooltip) |
if self:DisplayLDBTTCheck() then |
self:PopulateReportTooltip(tooltip) |
self:AddPagerArrows(tooltip) |
end |
self:AddInfoText(tooltip) |
end |
return true |
end |
function NeedyGreedy:DisplayLDBTTCheck() |
if self:CheckSuppressInRaid() then |
return false |
end |
return true |
end |
function NeedyGreedy:CheckSuppressInRaid() |
if IS_IN_RAID and self.db.profile.suppressInRaid then |
return true |
end |
return false |
end |
-- Chat filter functions |
local FILTER_CHAT_LOOT_MSGS = { |
--LOOT_ROLL_ALL_PASSED, |
L["Detached Tooltip"] = true |
L["Lock Tooltip"] = true |
L["Adjust the position of the detached tooltip"] = true |
L["DataBroker Tooltip"] = true |
L["Hide In Raid"] = true |
L["Suppress the display of the LibDataBroker tooltip when in a raid"] = true |
end |