/trunk
get = "GetOnlyShowInParty", |
set = "SetOnlyShowInParty", |
}, |
hideInCombat = { |
name = L["Hide in combat"], |
desc = L["Only display the roll window when not in combat"], |
type = "toggle", |
order = 60, |
get = "GetHideInCombat", |
set = "SetHideInCombat", |
}, |
}, |
}, |
} |
-- For tracking original state of detailed loot information |
local originalSpamFilterSetting = nil |
-- For tracking combat status |
local IS_IN_COMBAT = nil |
-- Utility functions |
local function sanitizePattern(pattern) |
pattern = string.gsub(pattern, "%(", "%%(") |
ACD:AddToBlizOptions("NeedyGreedy", "NeedyGreedy", nil, "general") |
ACD:AddToBlizOptions("NeedyGreedy", L["Profile"], "NeedyGreedy", "profile") |
self:RegisterChatCommand("needygreedy", function() InterfaceOptionsFrame_OpenToCategory("NeedyGreedy") end) |
self:RegisterChatCommand("ng", function() InterfaceOptionsFrame_OpenToCategory("NeedyGreedy") end) |
-- self:RegisterChatCommand("ngt", "TestItemList") |
-- self.items = items |
self:RegisterEvent("PARTY_MEMBERS_CHANGED") |
self:RegisterEvent("START_LOOT_ROLL") |
self:RegisterEvent("CHAT_MSG_LOOT") |
self:RegisterEvent("PLAYER_REGEN_DISABLED") |
self:RegisterEvent("PLAYER_REGEN_ENABLED") |
self:ScheduleRepeatingTimer("ExpireItems", 1) |
-- Delay frame display so that player does not show as offline |
self:RefreshTooltip() |
end |
function NeedyGreedy:PLAYER_REGEN_DISABLED() |
IS_IN_COMBAT = true |
self:RefreshTooltip() |
end |
function NeedyGreedy:PLAYER_REGEN_ENABLED() |
IS_IN_COMBAT = false |
self:RefreshTooltip() |
end |
-- Chat scanning and loot recording |
function NeedyGreedy:START_LOOT_ROLL(event, rollid) |
local texture, name, count, quality = GetLootRollItemInfo(rollid) |
self:RefreshTooltip() |
end |
function NeedyGreedy:GetHideInCombat(info) |
return self.db.profile.hideInCombat |
end |
function NeedyGreedy:SetHideInCombat(info, hideInCombat) |
self.db.profile.hideInCombat = hideInCombat |
self:RefreshTooltip() |
end |
-- Detachable QTip Frames |
local LibQTip = LibStub('LibQTip-1.0') |
end |
function NeedyGreedy:DisplayRollTableCheck() |
if self:CheckOnlyShowInParty() then |
if self:CheckOnlyShowInParty() and self:CheckShowInCombat() then |
return true |
end |
return true |
end |
function NeedyGreedy:CheckShowInCombat() |
if self.db.profile.hideInCombat and IS_IN_COMBAT then |
return false |
end |
return true |
end |
-- Chat filter functions |
local filter = function() return true end |
local FILTER_CHAT_LOOT_MSGS = { |
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 |
L["Hide in combat"] = true |
L["Only display the roll window when not in combat"] = true |
end |