WoWInterface SVN NeedyGreedy

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk
    from Rev 60 to Rev 61
    Reverse comparison

Rev 60 → Rev 61

NeedyGreedy.lua
21,8 → 21,11
NeedyGreedy:HideDBTooltip()
NeedyGreedy:ShowDBTooltip(frame)
NeedyGreedy:HideDetachedTooltip()
if NeedyGreedy.db.profile.detachedTooltip and NeedyGreedy:DisplayDetachedTTCheck() then
NeedyGreedy:ShowDetachedTooltip()
if NeedyGreedy.db.profile.detachedTooltip then
NeedyGreedy.detachedTooltipDisplayStatus = true
if NeedyGreedy:CheckDisplayOptions() then
NeedyGreedy:ShowDetachedTooltip()
end
end
elseif IsAltKeyDown() then
NeedyGreedy:ClearItems()
143,6 → 146,14
get = "GetDetachedTooltip",
set = "SetDetachedTooltip",
},
autoPopUp = {
name = L["Popup when rolling"],
desc = L["Automatically show the detached tooltip when an item is being rolled on"],
type = "toggle",
order = 11,
get = "GetAutoPopUp",
set = "SetAutoPopUp",
},
onlyShowInParty = {
name = L["Show only in party"],
desc = L["Only display the detached window when in a party"],
225,6 → 236,11
-- For tracking combat status
local IS_IN_COMBAT = nil
 
-- We track rolling on items like this to avoid the scenario where you're in
-- combat the window pops up, you leave combat briefly before another add
-- attacks and the window disappears as you're deciding
local ITEM_IS_BEING_ROLLED_ON = nil
 
-- Utility functions
local function sanitizePattern(pattern)
pattern = string.gsub(pattern, "%(", "%%(")
363,21 → 379,17
end
 
function NeedyGreedy:PLAYER_ENTERING_WORLD()
if self.db.profile.detachedTooltip and self.db.profile.detachedIsShown and
self:DisplayDetachedTTCheck() then
self:ShowDetachedTooltip()
wipe(nameList)
if self.db.profile.detachedTooltip then
if self:DisplayDetachedTTCheck() then
self:RefreshTooltip()
end
end
 
self:SetShowLootSpam()
end
 
function NeedyGreedy:PLAYER_LEAVING_WORLD()
if self.detachedTooltip and self.detachedTooltip:IsShown() then
self.db.profile.detachedIsShown = true
elseif self.detachedTooltip then
self.db.profile.detachedIsShown = false
end
 
self:ResetShowLootSpam()
end
 
412,6 → 424,12
choices = {},
rolls = {}
}
 
if self.db.profile.detachedTooltip and self.db.profile.autoPopUp then
ITEM_IS_BEING_ROLLED_ON = true
self:ShowDetachedTooltip()
end
 
self:UpdateReport()
end
end
639,10 → 657,29
-- would have automatically received the item anyway.
if record.choices[player] == "disenchant" and record.assigned == player and record.received == 0 then
record.received = GetTime()
-- It's ok to put in the break since each disenchanted
-- result will trigger a received message
break
end
end
end
 
-- This could be done in one of the other loops, but since I live with
-- pedantic man, we will do this as a separate scan
if ITEM_IS_BEING_ROLLED_ON then
local itemsStillBeingRolledOn = 0
for _, record in pairs(items) do
if record.received == 0 then
itemsStillBeingRolledOn = itemsStillBeingRolledOn + 1
end
end
 
if itemsStillBeingRolledOn == 0 then
ITEM_IS_BEING_ROLLED_ON = false
self:RefreshTooltip()
end
end
 
self:UpdateReport()
end
 
868,9 → 905,13
 
function NeedyGreedy:SetDetachedTooltip(info, detachedTooltip)
self.db.profile.detachedTooltip = detachedTooltip
if self.db.profile.detachedTooltip and self:DisplayDetachedTTCheck() then
self:ShowDetachedTooltip()
if self.db.profile.detachedTooltip then
self.db.profile.detachedTooltipDisplayStatus = true
if self:CheckDisplayOptions() then
self:ShowDetachedTooltip()
end
else
self.db.profile.detachedTooltipDisplayStatus = false
self:HideDetachedTooltip()
-- Return to page one
report.firstItem = 1
940,8 → 981,17
self:RefreshTooltip()
end
 
function NeedyGreedy:GetAutoPopUp(info)
return self.db.profile.autoPopUp
end
 
function NeedyGreedy:SetAutoPopUp(info, autoPopUp)
self.db.profile.autoPopUp = autoPopUp
self:RefreshTooltip()
end
 
 
 
-- Detachable QTip Frames
local LibQTip = LibStub('LibQTip-1.0')
 
1262,15 → 1312,32
function NeedyGreedy:ToggleDisplay()
if not self.db.profile.detachedTooltip then return end
 
-- Don't toggle display status if we can't see anything to toggle
if self.detachedTooltip and self.detachedTooltip:IsShown() then
self:HideDetachedTooltip()
elseif self:DisplayDetachedTTCheck() then
self.db.profile.detachedTooltipDisplayStatus = false
elseif self:CheckDisplayOptions() then
self:ShowDetachedTooltip()
self.db.profile.detachedTooltipDisplayStatus = true
end
 
end
 
-- Only use this when not forcing display e.g. RefreshTooltip
function NeedyGreedy:DisplayDetachedTTCheck()
if self.db.profile.autoPopUp and ITEM_IS_BEING_ROLLED_ON then
return true
end
 
if not self.db.profile.detachedTooltipDisplayStatus then
return false
end
 
return self:CheckDisplayOptions()
end
 
-- Use this when forcing display of detached tooltip
function NeedyGreedy:CheckDisplayOptions()
if self:CheckOnlyShowInParty() and self:CheckShowInCombat() then
return true
end
1417,7 → 1484,7
 
 
-- Unit tests
 
--[[
function NeedyGreedy:SetItems(itemList)
items = itemList
self:UpdateReport()
Localization/enUS.lua
39,5 → 39,7
L["Only display the names of members currently in your party"] = true
L["Valid commands are: config, report"] = true
L["Nothing to report"] = true
L["Popup when rolling"] = true
L["Automatically show the detached tooltip when an item is being rolled on"] = true
 
end