/trunk
L["to clear item list"] = true |
L["General"] = true |
L["Profile"] = true |
L["Show only in party"] = true |
L["Only display the roll window when in a party"] = true |
L["You are not in a party"] = true |
end |
name = L["Display Items"], |
desc = L["Number of item columns in the display window"], |
type = "range", |
order = 50, |
order = 100, |
min = 1, |
max = 10, |
step = 1, |
type = "range", |
order = 60, |
min = 0, |
max = 60, |
max = 110, |
step = 1, |
get = "GetExpiry", |
set = "SetExpiry" |
name = L["Minimum Quality"], |
desc = L["Minimum quality of item to be displayed"], |
type = "select", |
order = 70, |
order = 120, |
values = { |
[ITEM_QUALITY_UNCOMMON] = ITEM_QUALITY2_DESC, |
[ITEM_QUALITY_RARE] = ITEM_QUALITY3_DESC, |
get = "GetFilterLootMsgs", |
set = "SetFilterLootMsgs", |
}, |
onlyShowInParty = { |
name = L["Show only in party"], |
desc = L["Only display the roll window when in a party"], |
type = "toggle", |
order = 50, |
get = "GetOnlyShowInParty", |
set = "SetOnlyShowInParty", |
}, |
}, |
}, |
} |
displayDetached = false, |
minimap = { hide = false }, |
filterLootMsgs = false, |
onlyShowInParty = false, |
} |
} |
end |
end |
function NeedyGreedy:GetOnlyShowInParty(info) |
return self.db.profile.onlyShowInParty |
end |
function NeedyGreedy:SetOnlyShowInParty(info, onlyShowInParty) |
self.db.profile.onlyShowInParty = onlyShowInParty |
self:RefreshTooltip() |
end |
-- Detachable QTip Frames |
local LibQTip = LibStub('LibQTip-1.0') |
function NeedyGreedy:ShowDetachedTooltip() |
if not self:DisplayRollTableCheck() then return end |
-- Acquire a tooltip |
self.detachedTooltip = LibQTip:Acquire("NeedyGreedyReport", 1, "LEFT") |
-- Acquire a tooltip |
self.dbTooltip = LibQTip:Acquire("NeedyGreedyDBReport", 1, "LEFT") |
self:AddHeaderText(self.dbTooltip) |
if not self.db.profile.detachedTooltip then |
-- Add columns here because tooltip:Clear() preserves columns |
for i = 1, self.db.profile.nItems do |
self.dbTooltip:AddColumn("LEFT") |
if self:DisplayRollTableCheck() then |
-- Add columns here because tooltip:Clear() preserves columns |
for i = 1, self.db.profile.nItems do |
self.dbTooltip:AddColumn("LEFT") |
end |
-- Fill in the info |
self:PopulateReportTooltip(self.dbTooltip) |
end |
-- Fill in the info |
self:PopulateReportTooltip(self.dbTooltip) |
else |
-- Fill in the info |
self:AddHeaderText(self.dbTooltip) |
self:AddInfoText(self.dbTooltip) |
end |
self:AddInfoText(self.dbTooltip) |
if frame then self.dbTooltip:SmartAnchorTo(frame) end |
-- Display left and right arrows if frame is detached |
if self.db.profile.detachedTooltip then |
self:AddPagerArrows(tooltip) |
else |
self:AddInfoText(tooltip) |
end |
end |
end |
function NeedyGreedy:AddInfoText(tooltip) |
local helpText = "" |
local lineNum |
local helpText |
if self.db.profile.onlyShowInParty and not self:CheckOnlyShowInParty() then |
lineNum = tooltip:AddLine() |
tooltip:SetCell(lineNum, 1, L["You are not in a party"], nil, tooltip:GetColumnCount()) |
end |
tooltip:AddLine("") |
helpText = "" |
if self.db.profile.detachedTooltip then |
helpText = helpText .. eC .. L["Click"] .. "|r " .. gC .. L["to hide/show detached tooltip"] .. "|r" |
helpText = helpText .. eC .. L["Click"] .. "|r " .. gC .. L["to hide/show detached tooltip"] .. "|r\n" |
end |
helpText = helpText .. "\n" .. eC .. L["Shift-Click"] .. "|r " .. gC .. L["to attach/detach tooltip"] .. "|r" |
helpText = helpText .. "\n" .. eC .. L["Alt-Click"] .. "|r " .. gC .. L["to clear item list"] .. "|r" |
tooltip:AddLine("") |
local lineNum = tooltip:AddLine() |
helpText = helpText .. eC .. L["Shift-Click"] .. "|r " .. gC .. L["to attach/detach tooltip"] .. "|r\n" |
helpText = helpText .. eC .. L["Alt-Click"] .. "|r " .. gC .. L["to clear item list"] .. "|r" |
lineNum = tooltip:AddLine() |
tooltip:SetCell(lineNum, 1, helpText, nil, tooltip:GetColumnCount()) |
end |
self.db.profile.displayDetached = not self.db.profile.displayDetached |
end |
function NeedyGreedy:DisplayRollTableCheck() |
if self:CheckOnlyShowInParty() then |
return true |
end |
return false |
end |
function NeedyGreedy:CheckOnlyShowInParty() |
if self.db.profile.onlyShowInParty and (GetNumPartyMembers() == 0) then |
return false |
end |
return true |
end |
-- Chat filter functions |
local filter = function() return true end |
local FILTER_CHAT_LOOT_MSGS = { |