WoWInterface SVN NeedyGreedy

Compare Revisions

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

Rev 61 → Rev 60

NeedyGreedy.lua
21,11 → 21,8
NeedyGreedy:HideDBTooltip()
NeedyGreedy:ShowDBTooltip(frame)
NeedyGreedy:HideDetachedTooltip()
if NeedyGreedy.db.profile.detachedTooltip then
NeedyGreedy.detachedTooltipDisplayStatus = true
if NeedyGreedy:CheckDisplayOptions() then
NeedyGreedy:ShowDetachedTooltip()
end
if NeedyGreedy.db.profile.detachedTooltip and NeedyGreedy:DisplayDetachedTTCheck() then
NeedyGreedy:ShowDetachedTooltip()
end
elseif IsAltKeyDown() then
NeedyGreedy:ClearItems()
146,14 → 143,6
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"],
236,11 → 225,6
-- 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, "%(", "%%(")
379,17 → 363,21
end
 
function NeedyGreedy:PLAYER_ENTERING_WORLD()
wipe(nameList)
if self.db.profile.detachedTooltip then
if self:DisplayDetachedTTCheck() then
self:RefreshTooltip()
end
if self.db.profile.detachedTooltip and self.db.profile.detachedIsShown and
self:DisplayDetachedTTCheck() then
self:ShowDetachedTooltip()
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
 
424,12 → 412,6
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
657,29 → 639,10
-- 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
 
905,13 → 868,9
 
function NeedyGreedy:SetDetachedTooltip(info, detachedTooltip)
self.db.profile.detachedTooltip = detachedTooltip
if self.db.profile.detachedTooltip then
self.db.profile.detachedTooltipDisplayStatus = true
if self:CheckDisplayOptions() then
self:ShowDetachedTooltip()
end
if self.db.profile.detachedTooltip and self:DisplayDetachedTTCheck() then
self:ShowDetachedTooltip()
else
self.db.profile.detachedTooltipDisplayStatus = false
self:HideDetachedTooltip()
-- Return to page one
report.firstItem = 1
981,17 → 940,8
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')
 
1312,32 → 1262,15
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()
self.db.profile.detachedTooltipDisplayStatus = false
elseif self:CheckDisplayOptions() then
elseif self:DisplayDetachedTTCheck() 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
1484,7 → 1417,7
 
 
-- Unit tests
--[[
 
function NeedyGreedy:SetItems(itemList)
items = itemList
self:UpdateReport()
Localization/enUS.lua
39,7 → 39,5
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