mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 22:51:53 -05:00
- Aura handling cleanup. Duplication is evil!
This commit is contained in:
@ -179,12 +179,14 @@ function PlayerInfo.prototype:UpdateBuffs(unit, fromRepeated)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if not self.frame.buffFrame.buffs[startingNum]:IsVisible() or self.frame.buffFrame.buffs[startingNum].type ~= "mh" then
|
if not self.frame.buffFrame.buffs[startingNum]:IsVisible() or self.frame.buffFrame.buffs[startingNum].type ~= "mh" then
|
||||||
self:SetUpBuff(startingNum,
|
self:SetupAura("buff",
|
||||||
|
startingNum,
|
||||||
GetInventoryItemTexture(self.unit, GetInventorySlotInfo("MainHandSlot")),
|
GetInventoryItemTexture(self.unit, GetInventorySlotInfo("MainHandSlot")),
|
||||||
self.mainHandEnchantEndTime,
|
self.mainHandEnchantEndTime,
|
||||||
CurrTime + (mainHandExpiration/1000),
|
CurrTime + (mainHandExpiration/1000),
|
||||||
true,
|
true,
|
||||||
mainHandCharges,
|
mainHandCharges,
|
||||||
|
nil,
|
||||||
"mh")
|
"mh")
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -199,12 +201,14 @@ function PlayerInfo.prototype:UpdateBuffs(unit, fromRepeated)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if not self.frame.buffFrame.buffs[startingNum]:IsVisible() or self.frame.buffFrame.buffs[startingNum].type ~= "oh" then
|
if not self.frame.buffFrame.buffs[startingNum]:IsVisible() or self.frame.buffFrame.buffs[startingNum].type ~= "oh" then
|
||||||
self:SetUpBuff(startingNum,
|
self:SetupAura("buff",
|
||||||
|
startingNum,
|
||||||
GetInventoryItemTexture(self.unit, GetInventorySlotInfo("SecondaryHandSlot")),
|
GetInventoryItemTexture(self.unit, GetInventorySlotInfo("SecondaryHandSlot")),
|
||||||
self.offHandEnchantEndTime,
|
self.offHandEnchantEndTime,
|
||||||
CurrTime + (offHandExpiration/1000),
|
CurrTime + (offHandExpiration/1000),
|
||||||
true,
|
true,
|
||||||
offHandCharges,
|
offHandCharges,
|
||||||
|
nil,
|
||||||
"oh")
|
"oh")
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -217,7 +221,7 @@ function PlayerInfo.prototype:UpdateBuffs(unit, fromRepeated)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local direction = self.moduleSettings.buffGrowDirection == "Left" and -1 or 1
|
local direction = self.moduleSettings.auras["buff"].growDirection == "Left" and -1 or 1
|
||||||
self.frame.buffFrame.buffs = self:CreateIconFrames(self.frame.buffFrame, direction, self.frame.buffFrame.buffs, "buff")
|
self.frame.buffFrame.buffs = self:CreateIconFrames(self.frame.buffFrame, direction, self.frame.buffFrame.buffs, "buff")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -83,11 +83,46 @@ function IceTargetInfo.prototype:Enable(core)
|
|||||||
self.moduleSettings.myTagVersion = IceHUD.CurrTagVersion
|
self.moduleSettings.myTagVersion = IceHUD.CurrTagVersion
|
||||||
end
|
end
|
||||||
|
|
||||||
if self.moduleSettings.filterBuffs == nil
|
-- Rokiyo: ye olde backwards compatibility
|
||||||
and self.moduleSettings.filterDebuffs == nil
|
if not self.moduleSettings.updateAurasIntoTable then
|
||||||
and self.moduleSettings.filter ~= nil then
|
self.moduleSettings.updateAurasIntoTable = true
|
||||||
self.moduleSettings.filterBuffs = self.moduleSettings.filter
|
|
||||||
self.moduleSettings.filterDebuffs = self.moduleSettings.filter
|
if self.moduleSettings.buffSize then self.moduleSettings.auras["buff"].size = self.moduleSettings.buffSize self.moduleSettings.buffSize = nil end
|
||||||
|
if self.moduleSettings.ownBuffSize then self.moduleSettings.auras["buff"].ownSize = self.moduleSettings.ownBuffSize self.moduleSettings.ownBuffSize = nil end
|
||||||
|
if self.moduleSettings.showBuffs then self.moduleSettings.auras["buff"].show = self.moduleSettings.showBuffs self.moduleSettings.showBuffs = nil end
|
||||||
|
if self.moduleSettings.buffGrowDirection then self.moduleSettings.auras["buff"].growDirection = self.moduleSettings.buffGrowDirection self.moduleSettings.buffGrowDirection = nil end
|
||||||
|
if self.moduleSettings.buffAnchorTo then self.moduleSettings.auras["buff"].anchorTo = self.moduleSettings.buffAnchorTo self.moduleSettings.buffAnchorTo = nil end
|
||||||
|
if self.moduleSettings.buffOffset then
|
||||||
|
if self.moduleSettings.buffOffset['x'] then self.moduleSettings.auras["buff"].offset['x'] = self.moduleSettings.buffOffset['x'] end
|
||||||
|
if self.moduleSettings.buffOffset['y'] then self.moduleSettings.auras["buff"].offset['y'] = self.moduleSettings.buffOffset['y'] end
|
||||||
|
self.moduleSettings.buffOffset = nil
|
||||||
|
end
|
||||||
|
|
||||||
|
if self.moduleSettings.debuffSize then self.moduleSettings.auras["debuff"].size = self.moduleSettings.debuffSize self.moduleSettings.debuffSize = nil end
|
||||||
|
if self.moduleSettings.ownDebuffSize then self.moduleSettings.auras["debuff"].ownSize = self.moduleSettings.ownDebuffSize self.moduleSettings.ownDebuffSize = nil end
|
||||||
|
if self.moduleSettings.showDebuffs then self.moduleSettings.auras["debuff"].show = self.moduleSettings.showDebuffs self.moduleSettings.showDebuffs = nil end
|
||||||
|
if self.moduleSettings.debuffGrowDirection then self.moduleSettings.auras["debuff"].growDirection = self.moduleSettings.debuffGrowDirection self.moduleSettings.debuffGrowDirection = nil end
|
||||||
|
if self.moduleSettings.debuffAnchorTo then self.moduleSettings.auras["debuff"].anchorTo = self.moduleSettings.debuffAnchorTo self.moduleSettings.debuffAnchorTo = nil end
|
||||||
|
if self.moduleSettings.debuffOffset then
|
||||||
|
if self.moduleSettings.debuffOffset['x'] then self.moduleSettings.auras["debuff"].offset['x'] = self.moduleSettings.debuffOffset['x'] end
|
||||||
|
if self.moduleSettings.debuffOffset['y'] then self.moduleSettings.auras["debuff"].offset['y'] = self.moduleSettings.debuffOffset['y'] end
|
||||||
|
self.moduleSettings.debuffOffset = nil
|
||||||
|
end
|
||||||
|
|
||||||
|
if self.moduleSettings.filterBuffs then
|
||||||
|
self.moduleSettings.auras["buff"].filter = self.moduleSettings.filterBuffs
|
||||||
|
elseif self.moduleSettings.filter then
|
||||||
|
self.moduleSettings.auras["buff"].filter = self.moduleSettings.filter
|
||||||
|
end
|
||||||
|
self.moduleSettings.filterBuffs = nil
|
||||||
|
|
||||||
|
if self.moduleSettings.filterDebuffs then
|
||||||
|
self.moduleSettings.auras["debuff"].filter = self.moduleSettings.filterDebuffs
|
||||||
|
elseif self.moduleSettings.filter then
|
||||||
|
self.moduleSettings.auras["debuff"].filter = self.moduleSettings.filter
|
||||||
|
end
|
||||||
|
self.moduleSettings.filterDebuffs = nil
|
||||||
|
|
||||||
self.moduleSettings.filter = nil
|
self.moduleSettings.filter = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -227,10 +262,10 @@ function IceTargetInfo.prototype:GetOptions()
|
|||||||
name = L["Buff size"],
|
name = L["Buff size"],
|
||||||
desc = L["Buff/debuff icon size"],
|
desc = L["Buff/debuff icon size"],
|
||||||
get = function()
|
get = function()
|
||||||
return self.moduleSettings.buffSize
|
return self.moduleSettings.auras["buff"].size
|
||||||
end,
|
end,
|
||||||
set = function(info, v)
|
set = function(info, v)
|
||||||
self.moduleSettings.buffSize = v
|
self.moduleSettings.auras["buff"].size = v
|
||||||
self:RedrawBuffs()
|
self:RedrawBuffs()
|
||||||
end,
|
end,
|
||||||
min = 8,
|
min = 8,
|
||||||
@ -247,10 +282,10 @@ function IceTargetInfo.prototype:GetOptions()
|
|||||||
name = L["Own buff size"],
|
name = L["Own buff size"],
|
||||||
desc = L["Buff/debuff size for buffs/debuffs that were applied by you, the player"],
|
desc = L["Buff/debuff size for buffs/debuffs that were applied by you, the player"],
|
||||||
get = function()
|
get = function()
|
||||||
return self.moduleSettings.ownBuffSize
|
return self.moduleSettings.auras["buff"].ownSize
|
||||||
end,
|
end,
|
||||||
set = function(info, v)
|
set = function(info, v)
|
||||||
self.moduleSettings.ownBuffSize = v
|
self.moduleSettings.auras["buff"].ownSize = v
|
||||||
self:RedrawBuffs()
|
self:RedrawBuffs()
|
||||||
end,
|
end,
|
||||||
min = 8,
|
min = 8,
|
||||||
@ -267,10 +302,10 @@ function IceTargetInfo.prototype:GetOptions()
|
|||||||
name = L["Show buffs"],
|
name = L["Show buffs"],
|
||||||
desc = L["Toggles whether or not buffs are displayed at all"],
|
desc = L["Toggles whether or not buffs are displayed at all"],
|
||||||
get = function()
|
get = function()
|
||||||
return self.moduleSettings.showBuffs
|
return self.moduleSettings.auras["buff"].show
|
||||||
end,
|
end,
|
||||||
set = function(info, v)
|
set = function(info, v)
|
||||||
self.moduleSettings.showBuffs = v
|
self.moduleSettings.auras["buff"].show = v
|
||||||
self:RedrawBuffs()
|
self:RedrawBuffs()
|
||||||
end,
|
end,
|
||||||
disabled = function()
|
disabled = function()
|
||||||
@ -284,14 +319,14 @@ function IceTargetInfo.prototype:GetOptions()
|
|||||||
name = L["Only show buffs by me"],
|
name = L["Only show buffs by me"],
|
||||||
desc = L["Will only show buffs that you cast instead of all buffs active"],
|
desc = L["Will only show buffs that you cast instead of all buffs active"],
|
||||||
get = function(info)
|
get = function(info)
|
||||||
return IceHUD:GetSelectValue(info, self.moduleSettings.filterBuffs)
|
return IceHUD:GetSelectValue(info, self.moduleSettings.auras["buff"].filter)
|
||||||
end,
|
end,
|
||||||
set = function(info, v)
|
set = function(info, v)
|
||||||
self.moduleSettings.filterBuffs = info.option.values[v]
|
self.moduleSettings.auras["buff"].filter = info.option.values[v]
|
||||||
self:RedrawBuffs()
|
self:RedrawBuffs()
|
||||||
end,
|
end,
|
||||||
disabled = function()
|
disabled = function()
|
||||||
return not self.moduleSettings.enabled or not self.moduleSettings.showBuffs
|
return not self.moduleSettings.enabled or not self.moduleSettings.auras["buff"].show
|
||||||
end,
|
end,
|
||||||
values = { "Never", "In Combat", "Always" },
|
values = { "Never", "In Combat", "Always" },
|
||||||
order = 36.1
|
order = 36.1
|
||||||
@ -302,10 +337,10 @@ function IceTargetInfo.prototype:GetOptions()
|
|||||||
name = L["Show debuffs"],
|
name = L["Show debuffs"],
|
||||||
desc = L["Toggles whether or not debuffs are displayed at all"],
|
desc = L["Toggles whether or not debuffs are displayed at all"],
|
||||||
get = function()
|
get = function()
|
||||||
return self.moduleSettings.showDebuffs
|
return self.moduleSettings.auras["debuff"].show
|
||||||
end,
|
end,
|
||||||
set = function(info, v)
|
set = function(info, v)
|
||||||
self.moduleSettings.showDebuffs = v
|
self.moduleSettings.auras["debuff"].show = v
|
||||||
self:RedrawBuffs()
|
self:RedrawBuffs()
|
||||||
end,
|
end,
|
||||||
disabled = function()
|
disabled = function()
|
||||||
@ -319,14 +354,14 @@ function IceTargetInfo.prototype:GetOptions()
|
|||||||
name = L["Only show debuffs by me"],
|
name = L["Only show debuffs by me"],
|
||||||
desc = L["Will only show debuffs that you cast instead of all debuffs active"],
|
desc = L["Will only show debuffs that you cast instead of all debuffs active"],
|
||||||
get = function(info)
|
get = function(info)
|
||||||
return IceHUD:GetSelectValue(info, self.moduleSettings.filterDebuffs)
|
return IceHUD:GetSelectValue(info, self.moduleSettings.auras["debuff"].filter)
|
||||||
end,
|
end,
|
||||||
set = function(info, v)
|
set = function(info, v)
|
||||||
self.moduleSettings.filterDebuffs = info.option.values[v]
|
self.moduleSettings.auras["debuff"].filter = info.option.values[v]
|
||||||
self:RedrawBuffs()
|
self:RedrawBuffs()
|
||||||
end,
|
end,
|
||||||
disabled = function()
|
disabled = function()
|
||||||
return not self.moduleSettings.enabled or not self.moduleSettings.showDebuffs
|
return not self.moduleSettings.enabled or not self.moduleSettings.auras["debuff"].show
|
||||||
end,
|
end,
|
||||||
values = { "Never", "In Combat", "Always" },
|
values = { "Never", "In Combat", "Always" },
|
||||||
order = 36.3
|
order = 36.3
|
||||||
@ -384,14 +419,14 @@ function IceTargetInfo.prototype:GetOptions()
|
|||||||
desc = L["Which direction the buffs should grow from the anchor point"],
|
desc = L["Which direction the buffs should grow from the anchor point"],
|
||||||
values = { "Left", "Right" },
|
values = { "Left", "Right" },
|
||||||
get = function(info)
|
get = function(info)
|
||||||
return IceHUD:GetSelectValue(info, self.moduleSettings.buffGrowDirection)
|
return IceHUD:GetSelectValue(info, self.moduleSettings.auras["buff"].growDirection)
|
||||||
end,
|
end,
|
||||||
set = function(info, v)
|
set = function(info, v)
|
||||||
self.moduleSettings.buffGrowDirection = info.option.values[v]
|
self.moduleSettings.auras["buff"].growDirection = info.option.values[v]
|
||||||
self:CreateBuffFrame()
|
self:CreateAuraFrame("buff")
|
||||||
end,
|
end,
|
||||||
disabled = function()
|
disabled = function()
|
||||||
return not self.moduleSettings.enabled or not self.moduleSettings.showBuffs
|
return not self.moduleSettings.enabled or not self.moduleSettings.auras["buff"].show
|
||||||
end,
|
end,
|
||||||
order = 37.1
|
order = 37.1
|
||||||
}
|
}
|
||||||
@ -402,14 +437,14 @@ function IceTargetInfo.prototype:GetOptions()
|
|||||||
desc = L["The point on the TargetInfo frame that the buff frame gets connected to"],
|
desc = L["The point on the TargetInfo frame that the buff frame gets connected to"],
|
||||||
values = ValidAnchors,
|
values = ValidAnchors,
|
||||||
get = function(info)
|
get = function(info)
|
||||||
return IceHUD:GetSelectValue(info, self.moduleSettings.buffAnchorTo)
|
return IceHUD:GetSelectValue(info, self.moduleSettings.auras["buff"].anchorTo)
|
||||||
end,
|
end,
|
||||||
set = function(info, v)
|
set = function(info, v)
|
||||||
self.moduleSettings.buffAnchorTo = info.option.values[v]
|
self.moduleSettings.auras["buff"].anchorTo = info.option.values[v]
|
||||||
self:CreateBuffFrame()
|
self:CreateAuraFrame("buff")
|
||||||
end,
|
end,
|
||||||
disabled = function()
|
disabled = function()
|
||||||
return not self.moduleSettings.enabled or not self.moduleSettings.showBuffs
|
return not self.moduleSettings.enabled or not self.moduleSettings.auras["buff"].show
|
||||||
end,
|
end,
|
||||||
order = 37.2
|
order = 37.2
|
||||||
}
|
}
|
||||||
@ -422,14 +457,14 @@ function IceTargetInfo.prototype:GetOptions()
|
|||||||
max = 500,
|
max = 500,
|
||||||
step = 1,
|
step = 1,
|
||||||
get = function()
|
get = function()
|
||||||
return self.moduleSettings.buffOffset['x']
|
return self.moduleSettings.auras["buff"].offset['x']
|
||||||
end,
|
end,
|
||||||
set = function(info, v)
|
set = function(info, v)
|
||||||
self.moduleSettings.buffOffset['x'] = v
|
self.moduleSettings.auras["buff"].offset['x'] = v
|
||||||
self:CreateBuffFrame()
|
self:CreateAuraFrame("buff")
|
||||||
end,
|
end,
|
||||||
disabled = function()
|
disabled = function()
|
||||||
return not self.moduleSettings.enabled or not self.moduleSettings.showBuffs
|
return not self.moduleSettings.enabled or not self.moduleSettings.auras["buff"].show
|
||||||
end,
|
end,
|
||||||
order = 37.3
|
order = 37.3
|
||||||
}
|
}
|
||||||
@ -442,14 +477,14 @@ function IceTargetInfo.prototype:GetOptions()
|
|||||||
max = 500,
|
max = 500,
|
||||||
step = 1,
|
step = 1,
|
||||||
get = function()
|
get = function()
|
||||||
return self.moduleSettings.buffOffset['y']
|
return self.moduleSettings.auras["buff"].offset['y']
|
||||||
end,
|
end,
|
||||||
set = function(info, v)
|
set = function(info, v)
|
||||||
self.moduleSettings.buffOffset['y'] = v
|
self.moduleSettings.auras["buff"].offset['y'] = v
|
||||||
self:CreateBuffFrame()
|
self:CreateAuraFrame("buff")
|
||||||
end,
|
end,
|
||||||
disabled = function()
|
disabled = function()
|
||||||
return not self.moduleSettings.enabled or not self.moduleSettings.showBuffs
|
return not self.moduleSettings.enabled or not self.moduleSettings.auras["buff"].show
|
||||||
end,
|
end,
|
||||||
order = 37.4
|
order = 37.4
|
||||||
}
|
}
|
||||||
@ -466,14 +501,14 @@ function IceTargetInfo.prototype:GetOptions()
|
|||||||
desc = L["Which direction the debuffs should grow from the anchor point"],
|
desc = L["Which direction the debuffs should grow from the anchor point"],
|
||||||
values = { "Left", "Right" },
|
values = { "Left", "Right" },
|
||||||
get = function(info)
|
get = function(info)
|
||||||
return IceHUD:GetSelectValue(info, self.moduleSettings.debuffGrowDirection)
|
return IceHUD:GetSelectValue(info, self.moduleSettings.auras["debuff"].growDirection)
|
||||||
end,
|
end,
|
||||||
set = function(info, v)
|
set = function(info, v)
|
||||||
self.moduleSettings.debuffGrowDirection = info.option.values[v]
|
self.moduleSettings.auras["debuff"].growDirection = info.option.values[v]
|
||||||
self:CreateDebuffFrame()
|
self:CreateAuraFrame("debuff")
|
||||||
end,
|
end,
|
||||||
disabled = function()
|
disabled = function()
|
||||||
return not self.moduleSettings.enabled or not self.moduleSettings.showDebuffs
|
return not self.moduleSettings.enabled or not self.moduleSettings.auras["debuff"].show
|
||||||
end,
|
end,
|
||||||
order = 37.81
|
order = 37.81
|
||||||
}
|
}
|
||||||
@ -484,14 +519,14 @@ function IceTargetInfo.prototype:GetOptions()
|
|||||||
desc = L["The point on the TargetInfo frame that the debuff frame gets connected to"],
|
desc = L["The point on the TargetInfo frame that the debuff frame gets connected to"],
|
||||||
values = ValidAnchors,
|
values = ValidAnchors,
|
||||||
get = function(info)
|
get = function(info)
|
||||||
return IceHUD:GetSelectValue(info, self.moduleSettings.debuffAnchorTo)
|
return IceHUD:GetSelectValue(info, self.moduleSettings.auras["debuff"].anchorTo)
|
||||||
end,
|
end,
|
||||||
set = function(info, v)
|
set = function(info, v)
|
||||||
self.moduleSettings.debuffAnchorTo = info.option.values[v]
|
self.moduleSettings.auras["debuff"].anchorTo = info.option.values[v]
|
||||||
self:CreateDebuffFrame()
|
self:CreateAuraFrame("debuff")
|
||||||
end,
|
end,
|
||||||
disabled = function()
|
disabled = function()
|
||||||
return not self.moduleSettings.enabled or not self.moduleSettings.showDebuffs
|
return not self.moduleSettings.enabled or not self.moduleSettings.auras["debuff"].show
|
||||||
end,
|
end,
|
||||||
order = 37.82
|
order = 37.82
|
||||||
}
|
}
|
||||||
@ -504,14 +539,14 @@ function IceTargetInfo.prototype:GetOptions()
|
|||||||
max = 500,
|
max = 500,
|
||||||
step = 1,
|
step = 1,
|
||||||
get = function()
|
get = function()
|
||||||
return self.moduleSettings.debuffOffset['x']
|
return self.moduleSettings.auras["debuff"].offset['x']
|
||||||
end,
|
end,
|
||||||
set = function(info, v)
|
set = function(info, v)
|
||||||
self.moduleSettings.debuffOffset['x'] = v
|
self.moduleSettings.auras["debuff"].offset['x'] = v
|
||||||
self:CreateDebuffFrame()
|
self:CreateAuraFrame("debuff")
|
||||||
end,
|
end,
|
||||||
disabled = function()
|
disabled = function()
|
||||||
return not self.moduleSettings.enabled or not self.moduleSettings.showDebuffs
|
return not self.moduleSettings.enabled or not self.moduleSettings.auras["debuff"].show
|
||||||
end,
|
end,
|
||||||
order = 37.83
|
order = 37.83
|
||||||
}
|
}
|
||||||
@ -524,14 +559,14 @@ function IceTargetInfo.prototype:GetOptions()
|
|||||||
max = 500,
|
max = 500,
|
||||||
step = 1,
|
step = 1,
|
||||||
get = function()
|
get = function()
|
||||||
return self.moduleSettings.debuffOffset['y']
|
return self.moduleSettings.auras["debuff"].offset['y']
|
||||||
end,
|
end,
|
||||||
set = function(info, v)
|
set = function(info, v)
|
||||||
self.moduleSettings.debuffOffset['y'] = v
|
self.moduleSettings.auras["debuff"].offset['y'] = v
|
||||||
self:CreateDebuffFrame()
|
self:CreateAuraFrame("debuff")
|
||||||
end,
|
end,
|
||||||
disabled = function()
|
disabled = function()
|
||||||
return not self.moduleSettings.enabled or not self.moduleSettings.showDebuffs
|
return not self.moduleSettings.enabled or not self.moduleSettings.auras["debuff"].show
|
||||||
end,
|
end,
|
||||||
order = 37.84
|
order = 37.84
|
||||||
}
|
}
|
||||||
@ -750,18 +785,8 @@ function IceTargetInfo.prototype:GetDefaultSettings()
|
|||||||
defaults["vpos"] = -50
|
defaults["vpos"] = -50
|
||||||
defaults["hpos"] = 0
|
defaults["hpos"] = 0
|
||||||
defaults["zoom"] = 0.08
|
defaults["zoom"] = 0.08
|
||||||
defaults["buffSize"] = 20
|
|
||||||
defaults["ownBuffSize"] = 20
|
|
||||||
defaults["buffOffset"] = {x=-10,y=0}
|
|
||||||
defaults["buffAnchorTo"] = "TOPLEFT"
|
|
||||||
defaults["buffGrowDirection"] = "Left"
|
|
||||||
defaults["debuffOffset"] = {x=10,y=0}
|
|
||||||
defaults["debuffAnchorTo"] = "TOPRIGHT"
|
|
||||||
defaults["debuffGrowDirection"] = "Right"
|
|
||||||
defaults["mouseTarget"] = true
|
defaults["mouseTarget"] = true
|
||||||
defaults["mouseBuff"] = true
|
defaults["mouseBuff"] = true
|
||||||
defaults["filterBuffs"] = "Never"
|
|
||||||
defaults["filterDebuffs"] = "Never"
|
|
||||||
defaults["perRow"] = 10
|
defaults["perRow"] = 10
|
||||||
defaults["line1Tag"] = "[Name:HostileColor]"
|
defaults["line1Tag"] = "[Name:HostileColor]"
|
||||||
-- defaults["line2Tag"] = "[Level:DifficultyColor] [[IsPlayer ? Race ! CreatureType]:ClassColor] [[IsPlayer ? Class]:ClassColor] [[~PvP ? \"PvE\" ! \"PvP\"]:HostileColor] [IsLeader ? \"Leader\":Yellow] [InCombat ? \"Combat\":Red] [Classification]"
|
-- defaults["line2Tag"] = "[Level:DifficultyColor] [[IsPlayer ? Race ! CreatureType]:ClassColor] [[IsPlayer ? Class]:ClassColor] [[~PvP ? \"PvE\" ! \"PvP\"]:HostileColor] [IsLeader ? \"Leader\":Yellow] [InCombat ? \"Combat\":Red] [Classification]"
|
||||||
@ -770,52 +795,57 @@ function IceTargetInfo.prototype:GetDefaultSettings()
|
|||||||
defaults["line4Tag"] = ""
|
defaults["line4Tag"] = ""
|
||||||
defaults["myTagVersion"] = 2
|
defaults["myTagVersion"] = 2
|
||||||
defaults["alwaysFullAlpha"] = true
|
defaults["alwaysFullAlpha"] = true
|
||||||
defaults["showBuffs"] = true
|
|
||||||
defaults["showDebuffs"] = true
|
|
||||||
defaults["spaceBetweenBuffs"] = 0
|
defaults["spaceBetweenBuffs"] = 0
|
||||||
defaults["displayTargetName"] = true
|
defaults["displayTargetName"] = true
|
||||||
defaults["displayTargetDetails"] = true
|
defaults["displayTargetDetails"] = true
|
||||||
defaults["displayTargetGuild"] = true
|
defaults["displayTargetGuild"] = true
|
||||||
|
defaults["auras"] = {
|
||||||
|
["buff"] = {
|
||||||
|
["size"] = 20,
|
||||||
|
["ownSize"] = 20,
|
||||||
|
["offset"] = {x=-10,y=0},
|
||||||
|
["anchorTo"] = "TOPLEFT",
|
||||||
|
["growDirection"] = "Left",
|
||||||
|
["filter"] = "Never",
|
||||||
|
["show"] = true,
|
||||||
|
},
|
||||||
|
["debuff"] = {
|
||||||
|
["size"] = 20,
|
||||||
|
["ownSize"] = 20,
|
||||||
|
["offset"] = {x=10,y=0},
|
||||||
|
["anchorTo"] = "TOPRIGHT",
|
||||||
|
["growDirection"] = "Right",
|
||||||
|
["filter"] = "Never",
|
||||||
|
["show"] = true,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return defaults
|
return defaults
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
do
|
||||||
|
local function SetFontString(self, textFrame, tag)
|
||||||
|
if textFrame and tag ~= '' then
|
||||||
|
DogTag:AddFontString(textFrame, self.frame, tag, "Unit", { unit = self.unit })
|
||||||
|
else
|
||||||
|
DogTag:RemoveFontString(textFrame)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function IceTargetInfo.prototype:RegisterFontStrings()
|
function IceTargetInfo.prototype:RegisterFontStrings()
|
||||||
if DogTag ~= nil then
|
if DogTag ~= nil then
|
||||||
if self.frame.targetName then
|
SetFontString(self, self.frame.targetName, self.moduleSettings.line1Tag)
|
||||||
if self.moduleSettings.line1Tag ~= '' then
|
SetFontString(self, self.frame.targetInfo, self.moduleSettings.line2Tag)
|
||||||
DogTag:AddFontString(self.frame.targetName, self.frame, self.moduleSettings.line1Tag, "Unit", { unit = self.unit })
|
SetFontString(self, self.frame.targetGuild, self.moduleSettings.line3Tag)
|
||||||
else
|
SetFontString(self, self.frame.targetExtra, self.moduleSettings.line4Tag)
|
||||||
DogTag:RemoveFontString(self.frame.targetName)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if self.frame.targetInfo then
|
|
||||||
if self.moduleSettings.line2Tag ~= '' then
|
|
||||||
DogTag:AddFontString(self.frame.targetInfo, self.frame, self.moduleSettings.line2Tag, "Unit", { unit = self.unit })
|
|
||||||
else
|
|
||||||
DogTag:RemoveFontString(self.frame.targetInfo)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if self.frame.targetGuild then
|
|
||||||
if self.moduleSettings.line3Tag ~= '' then
|
|
||||||
DogTag:AddFontString(self.frame.targetGuild, self.frame, self.moduleSettings.line3Tag, "Unit", { unit = self.unit })
|
|
||||||
else
|
|
||||||
DogTag:RemoveFontString(self.frame.targetGuild)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if self.frame.targetExtra then
|
|
||||||
if self.moduleSettings.line4Tag ~= '' then
|
|
||||||
DogTag:AddFontString(self.frame.targetExtra, self.frame, self.moduleSettings.line4Tag, "Unit", { unit = self.unit })
|
|
||||||
else
|
|
||||||
DogTag:RemoveFontString(self.frame.targetExtra)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
self:TargetChanged()
|
self:TargetChanged()
|
||||||
DogTag:UpdateAllForFrame(self.frame)
|
DogTag:UpdateAllForFrame(self.frame)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
function IceTargetInfo.prototype:UnregisterFontStrings()
|
function IceTargetInfo.prototype:UnregisterFontStrings()
|
||||||
if DogTag ~= nil then
|
if DogTag ~= nil then
|
||||||
@ -840,18 +870,46 @@ end
|
|||||||
|
|
||||||
function IceTargetInfo.prototype:RedrawBuffs()
|
function IceTargetInfo.prototype:RedrawBuffs()
|
||||||
if (self.moduleSettings.enabled) then
|
if (self.moduleSettings.enabled) then
|
||||||
self:CreateBuffFrame(false)
|
self:CreateAuraFrame("buff", false)
|
||||||
self:CreateDebuffFrame(false)
|
self:CreateAuraFrame("debuff", false)
|
||||||
|
|
||||||
self:TargetChanged()
|
self:TargetChanged()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- 'Protected' methods --------------------------------------------------------
|
-- 'Protected' methods --------------------------------------------------------
|
||||||
|
do -- OVERRIDE: IceTargetInfo.prototype:CreateFrame(redraw)
|
||||||
|
local function CreateTextFrame(self, textFrame, fontSize, relativePoint, offsetX, offsetY, height, show)
|
||||||
|
textFrame = self:FontFactory(fontSize, self.frame, textFrame)
|
||||||
|
textFrame:SetJustifyH("CENTER")
|
||||||
|
textFrame:SetJustifyV("TOP")
|
||||||
|
textFrame:SetPoint("TOP", self.frame, relativePoint, offsetX, offsetY)
|
||||||
|
|
||||||
|
if height then textFrame:SetHeight(height) end
|
||||||
|
if show then textFrame:Show() end
|
||||||
|
|
||||||
|
return textFrame
|
||||||
|
end
|
||||||
|
|
||||||
|
local function CreateRaidIconFrame(self)
|
||||||
|
if (not self.frame.raidIcon) then
|
||||||
|
self.frame.raidIcon = CreateFrame("Frame", nil, self.frame)
|
||||||
|
end
|
||||||
|
|
||||||
|
if (not self.frame.raidIcon.icon) then
|
||||||
|
self.frame.raidIcon.icon = self.frame.raidIcon:CreateTexture(nil, "BACKGROUND")
|
||||||
|
self.frame.raidIcon.icon:SetTexture("Interface\\TargetingFrame\\UI-RaidTargetingIcons")
|
||||||
|
end
|
||||||
|
|
||||||
|
self.frame.raidIcon:SetPoint("BOTTOM", self.frame, "TOP", 0, 1)
|
||||||
|
self.frame.raidIcon:SetWidth(16)
|
||||||
|
self.frame.raidIcon:SetHeight(16)
|
||||||
|
|
||||||
|
self.frame.raidIcon.icon:SetAllPoints(self.frame.raidIcon)
|
||||||
|
SetRaidTargetIconTexture(self.frame.raidIcon.icon, 0)
|
||||||
|
self.frame.raidIcon:Hide()
|
||||||
|
end
|
||||||
|
|
||||||
-- OVERRIDE
|
|
||||||
function IceTargetInfo.prototype:CreateFrame(redraw)
|
function IceTargetInfo.prototype:CreateFrame(redraw)
|
||||||
if not (self.frame) then
|
if not (self.frame) then
|
||||||
self.frame = CreateFrame("Button", "IceHUD_"..self.elementName, self.parent, "SecureUnitButtonTemplate")
|
self.frame = CreateFrame("Button", "IceHUD_"..self.elementName, self.parent, "SecureUnitButtonTemplate")
|
||||||
@ -918,144 +976,56 @@ function IceTargetInfo.prototype:CreateFrame(redraw)
|
|||||||
|
|
||||||
|
|
||||||
-- create rest of the frames
|
-- create rest of the frames
|
||||||
self:CreateTextFrame()
|
self.frame.targetName = CreateTextFrame(self, self.frame.targetName, self.moduleSettings.fontSize+1, "TOP", 0, 0, nil, nil)
|
||||||
self:CreateInfoTextFrame()
|
self.frame.targetInfo = CreateTextFrame(self, self.frame.targetInfo, self.moduleSettings.fontSize, "TOP", 0, -16, 14, true)
|
||||||
self:CreateGuildTextFrame()
|
self.frame.targetGuild = CreateTextFrame(self, self.frame.targetGuild, self.moduleSettings.fontSize, "BOTTOM", 0, 0, 14, true)
|
||||||
self:CreateExtraTextFrame()
|
self.frame.targetExtra = CreateTextFrame(self, self.frame.targetExtra, self.moduleSettings.fontSize, "BOTTOM", 0, -16, 14, true)
|
||||||
|
|
||||||
self:CreateBuffFrame(redraw)
|
self:CreateAuraFrame("buff", redraw)
|
||||||
self:CreateDebuffFrame(redraw)
|
self:CreateAuraFrame("debuff", redraw)
|
||||||
|
|
||||||
self:CreateRaidIconFrame()
|
CreateRaidIconFrame(self)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function IceTargetInfo.prototype:CreateAuraFrame(aura, redraw)
|
||||||
|
local auraFrame
|
||||||
|
local point
|
||||||
|
|
||||||
function IceTargetInfo.prototype:CreateTextFrame()
|
if (aura == "buff") then
|
||||||
self.frame.targetName = self:FontFactory(self.moduleSettings.fontSize+1, self.frame, self.frame.targetName)
|
auraFrame = "buffFrame"
|
||||||
|
point = "TOPRIGHT"
|
||||||
self.frame.targetName:SetJustifyH("CENTER")
|
elseif (aura == "debuff") then
|
||||||
self.frame.targetName:SetJustifyV("TOP")
|
auraFrame = "debuffFrame"
|
||||||
|
point = "TOPLEFT"
|
||||||
self.frame.targetName:SetPoint("TOP", self.frame, "TOP")
|
else
|
||||||
|
error("Invalid Auraframe")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if (not self.frame[auraFrame]) then
|
||||||
function IceTargetInfo.prototype:CreateInfoTextFrame()
|
self.frame[auraFrame] = CreateFrame("Frame", nil, self.frame)
|
||||||
self.frame.targetInfo = self:FontFactory(self.moduleSettings.fontSize, self.frame, self.frame.targetInfo)
|
self.frame[auraFrame]:SetFrameStrata("BACKGROUND")
|
||||||
|
self.frame[auraFrame]:SetWidth(1)
|
||||||
-- self.frame.targetInfo:SetWidth(self.width)
|
self.frame[auraFrame]:SetHeight(1)
|
||||||
self.frame.targetInfo:SetHeight(14)
|
self.frame[auraFrame]:Show()
|
||||||
self.frame.targetInfo:SetJustifyH("CENTER")
|
self.frame[auraFrame].buffs = {}
|
||||||
self.frame.targetInfo:SetJustifyV("TOP")
|
|
||||||
|
|
||||||
self.frame.targetInfo:SetPoint("TOP", self.frame, "TOP", 0, -16)
|
|
||||||
self.frame.targetInfo:Show()
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
self.frame[auraFrame]:ClearAllPoints()
|
||||||
function IceTargetInfo.prototype:CreateGuildTextFrame()
|
self.frame[auraFrame]:SetPoint(point, self.frame, self.moduleSettings.auras[aura].anchorTo, self.moduleSettings.auras[aura].offset['x'], self.moduleSettings.auras[aura].offset['y'])
|
||||||
self.frame.targetGuild = self:FontFactory(self.moduleSettings.fontSize, self.frame, self.frame.targetGuild)
|
|
||||||
|
|
||||||
-- self.frame.targetInfo:SetWidth(self.width)
|
|
||||||
self.frame.targetGuild:SetHeight(14)
|
|
||||||
self.frame.targetGuild:SetJustifyH("CENTER")
|
|
||||||
self.frame.targetGuild:SetJustifyV("TOP")
|
|
||||||
|
|
||||||
self.frame.targetGuild:SetPoint("TOP", self.frame, "BOTTOM", 0, 0)
|
|
||||||
self.frame.targetGuild:Show()
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
function IceTargetInfo.prototype:CreateExtraTextFrame()
|
|
||||||
self.frame.targetExtra = self:FontFactory(self.moduleSettings.fontSize, self.frame, self.frame.targetExtra)
|
|
||||||
|
|
||||||
self.frame.targetExtra:SetHeight(14)
|
|
||||||
self.frame.targetExtra:SetJustifyH("CENTER")
|
|
||||||
self.frame.targetExtra:SetJustifyV("TOP")
|
|
||||||
|
|
||||||
self.frame.targetExtra:SetPoint("TOP", self.frame, "BOTTOM", 0, -16)
|
|
||||||
self.frame.targetExtra:Show()
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
function IceTargetInfo.prototype:CreateRaidIconFrame()
|
|
||||||
if (not self.frame.raidIcon) then
|
|
||||||
self.frame.raidIcon = CreateFrame("Frame", nil, self.frame)
|
|
||||||
end
|
|
||||||
|
|
||||||
if (not self.frame.raidIcon.icon) then
|
|
||||||
self.frame.raidIcon.icon = self.frame.raidIcon:CreateTexture(nil, "BACKGROUND")
|
|
||||||
self.frame.raidIcon.icon:SetTexture("Interface\\TargetingFrame\\UI-RaidTargetingIcons")
|
|
||||||
end
|
|
||||||
|
|
||||||
self.frame.raidIcon:SetPoint("BOTTOM", self.frame, "TOP", 0, 1)
|
|
||||||
self.frame.raidIcon:SetWidth(16)
|
|
||||||
self.frame.raidIcon:SetHeight(16)
|
|
||||||
|
|
||||||
self.frame.raidIcon.icon:SetAllPoints(self.frame.raidIcon)
|
|
||||||
SetRaidTargetIconTexture(self.frame.raidIcon.icon, 0)
|
|
||||||
self.frame.raidIcon:Hide()
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
function IceTargetInfo.prototype:CreateBuffFrame(redraw)
|
|
||||||
if (not self.frame.buffFrame) then
|
|
||||||
self.frame.buffFrame = CreateFrame("Frame", nil, self.frame)
|
|
||||||
|
|
||||||
self.frame.buffFrame:SetFrameStrata("BACKGROUND")
|
|
||||||
self.frame.buffFrame:SetWidth(1)
|
|
||||||
self.frame.buffFrame:SetHeight(1)
|
|
||||||
|
|
||||||
self.frame.buffFrame:Show()
|
|
||||||
|
|
||||||
self.frame.buffFrame.buffs = {}
|
|
||||||
end
|
|
||||||
|
|
||||||
self.frame.buffFrame:ClearAllPoints()
|
|
||||||
self.frame.buffFrame:SetPoint("TOPRIGHT", self.frame, self.moduleSettings.buffAnchorTo, self.moduleSettings.buffOffset['x'], self.moduleSettings.buffOffset['y'])
|
|
||||||
|
|
||||||
if (not redraw) then
|
if (not redraw) then
|
||||||
local direction = self.moduleSettings.buffGrowDirection == "Left" and -1 or 1
|
local direction = self.moduleSettings.auras[aura].growDirection == "Left" and -1 or 1
|
||||||
self.frame.buffFrame.buffs = self:CreateIconFrames(self.frame.buffFrame, direction, self.frame.buffFrame.buffs, "buff")
|
self.frame[auraFrame].buffs = self:CreateIconFrames(self.frame[auraFrame], direction, self.frame[auraFrame].buffs, "buff")
|
||||||
end
|
end
|
||||||
|
|
||||||
if self.moduleSettings.showBuffs then
|
if self.moduleSettings.auras[aura].show then
|
||||||
self.frame.buffFrame:Show()
|
self.frame[auraFrame]:Show()
|
||||||
else
|
else
|
||||||
self.frame.buffFrame:Hide()
|
self.frame[auraFrame]:Hide()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function IceTargetInfo.prototype:CreateDebuffFrame(redraw)
|
|
||||||
if (not self.frame.debuffFrame) then
|
|
||||||
self.frame.debuffFrame = CreateFrame("Frame", nil, self.frame)
|
|
||||||
|
|
||||||
self.frame.debuffFrame:SetFrameStrata("BACKGROUND")
|
|
||||||
self.frame.debuffFrame:SetWidth(1)
|
|
||||||
self.frame.debuffFrame:SetHeight(1)
|
|
||||||
|
|
||||||
self.frame.debuffFrame:Show()
|
|
||||||
|
|
||||||
self.frame.debuffFrame.buffs = {}
|
|
||||||
end
|
|
||||||
|
|
||||||
self.frame.debuffFrame:ClearAllPoints()
|
|
||||||
self.frame.debuffFrame:SetPoint("TOPLEFT", self.frame, self.moduleSettings.debuffAnchorTo, self.moduleSettings.debuffOffset['x'], self.moduleSettings.debuffOffset['y'])
|
|
||||||
|
|
||||||
if (not redraw) then
|
|
||||||
local direction = self.moduleSettings.debuffGrowDirection == "Left" and -1 or 1
|
|
||||||
self.frame.debuffFrame.buffs = self:CreateIconFrames(self.frame.debuffFrame, direction, self.frame.debuffFrame.buffs, "debuff")
|
|
||||||
end
|
|
||||||
|
|
||||||
if self.moduleSettings.showDebuffs then
|
|
||||||
self.frame.debuffFrame:Show()
|
|
||||||
else
|
|
||||||
self.frame.debuffFrame:Hide()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
function IceTargetInfo.prototype:CreateIconFrames(parent, direction, buffs, type, skipSize)
|
function IceTargetInfo.prototype:CreateIconFrames(parent, direction, buffs, type, skipSize)
|
||||||
local lastX = 0
|
local lastX = 0
|
||||||
local lastBuffSize = 0
|
local lastBuffSize = 0
|
||||||
@ -1072,27 +1042,9 @@ function IceTargetInfo.prototype:CreateIconFrames(parent, direction, buffs, type
|
|||||||
buffs[i] = CreateFrame("Frame", nil, parent)
|
buffs[i] = CreateFrame("Frame", nil, parent)
|
||||||
buffs[i].icon = CreateFrame("Frame", nil, buffs[i])
|
buffs[i].icon = CreateFrame("Frame", nil, buffs[i])
|
||||||
buffs[i].cd = CreateFrame("Cooldown", nil, buffs[i], "CooldownFrameTemplate")
|
buffs[i].cd = CreateFrame("Cooldown", nil, buffs[i], "CooldownFrameTemplate")
|
||||||
end
|
|
||||||
|
|
||||||
buffs[i]:SetFrameStrata("BACKGROUND")
|
buffs[i]:SetFrameStrata("BACKGROUND")
|
||||||
if buffs[i].fromPlayer then
|
|
||||||
buffs[i]:SetWidth(self.moduleSettings.ownBuffSize)
|
|
||||||
buffs[i]:SetHeight(self.moduleSettings.ownBuffSize)
|
|
||||||
else
|
|
||||||
buffs[i]:SetWidth(self.moduleSettings.buffSize)
|
|
||||||
buffs[i]:SetHeight(self.moduleSettings.buffSize)
|
|
||||||
end
|
|
||||||
|
|
||||||
buffs[i].icon:SetFrameStrata("BACKGROUND")
|
buffs[i].icon:SetFrameStrata("BACKGROUND")
|
||||||
if not skipSize then
|
|
||||||
if buffs[i].fromPlayer then
|
|
||||||
buffs[i].icon:SetWidth(self.moduleSettings.ownBuffSize-2)
|
|
||||||
buffs[i].icon:SetHeight(self.moduleSettings.ownBuffSize-2)
|
|
||||||
else
|
|
||||||
buffs[i].icon:SetWidth(self.moduleSettings.buffSize-2)
|
|
||||||
buffs[i].icon:SetHeight(self.moduleSettings.buffSize-2)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
buffs[i].cd:SetFrameStrata("BACKGROUND")
|
buffs[i].cd:SetFrameStrata("BACKGROUND")
|
||||||
buffs[i].cd:SetFrameLevel(buffs[i].icon:GetFrameLevel()+1)
|
buffs[i].cd:SetFrameLevel(buffs[i].icon:GetFrameLevel()+1)
|
||||||
@ -1100,10 +1052,32 @@ function IceTargetInfo.prototype:CreateIconFrames(parent, direction, buffs, type
|
|||||||
buffs[i].cd:ClearAllPoints()
|
buffs[i].cd:ClearAllPoints()
|
||||||
buffs[i].cd:SetAllPoints(buffs[i])
|
buffs[i].cd:SetAllPoints(buffs[i])
|
||||||
|
|
||||||
|
buffs[i].icon:ClearAllPoints()
|
||||||
|
buffs[i].icon:SetPoint("CENTER", 0, 0)
|
||||||
|
end
|
||||||
|
|
||||||
local buffSize = self.moduleSettings.buffSize
|
|
||||||
if buffs[i].fromPlayer then
|
if buffs[i].fromPlayer then
|
||||||
buffSize = self.moduleSettings.ownBuffSize
|
buffs[i]:SetWidth(self.moduleSettings.auras["buff"].ownSize)
|
||||||
|
buffs[i]:SetHeight(self.moduleSettings.auras["buff"].ownSize)
|
||||||
|
else
|
||||||
|
buffs[i]:SetWidth(self.moduleSettings.auras["buff"].size)
|
||||||
|
buffs[i]:SetHeight(self.moduleSettings.auras["buff"].size)
|
||||||
|
end
|
||||||
|
|
||||||
|
if not skipSize then
|
||||||
|
if buffs[i].fromPlayer then
|
||||||
|
buffs[i].icon:SetWidth(self.moduleSettings.auras["buff"].ownSize-2)
|
||||||
|
buffs[i].icon:SetHeight(self.moduleSettings.auras["buff"].ownSize-2)
|
||||||
|
else
|
||||||
|
buffs[i].icon:SetWidth(self.moduleSettings.auras["buff"].size-2)
|
||||||
|
buffs[i].icon:SetHeight(self.moduleSettings.auras["buff"].size-2)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
local buffSize = self.moduleSettings.auras["buff"].size
|
||||||
|
if buffs[i].fromPlayer then
|
||||||
|
buffSize = self.moduleSettings.auras["buff"].ownSize
|
||||||
end
|
end
|
||||||
|
|
||||||
local pos = i % self.moduleSettings.perRow
|
local pos = i % self.moduleSettings.perRow
|
||||||
@ -1120,7 +1094,7 @@ function IceTargetInfo.prototype:CreateIconFrames(parent, direction, buffs, type
|
|||||||
local x = lastX + lastBuffSize + spaceOffset
|
local x = lastX + lastBuffSize + spaceOffset
|
||||||
lastX = x
|
lastX = x
|
||||||
lastBuffSize = (buffSize * direction)
|
lastBuffSize = (buffSize * direction)
|
||||||
local y = math.floor((i-1) / self.moduleSettings.perRow) * math.max(self.moduleSettings.buffSize, self.moduleSettings.ownBuffSize) * -1
|
local y = math.floor((i-1) / self.moduleSettings.perRow) * math.max(self.moduleSettings.auras["buff"].size, self.moduleSettings.auras["buff"].ownSize) * -1
|
||||||
|
|
||||||
buffs[i]:ClearAllPoints()
|
buffs[i]:ClearAllPoints()
|
||||||
if direction < 0 then
|
if direction < 0 then
|
||||||
@ -1129,14 +1103,7 @@ function IceTargetInfo.prototype:CreateIconFrames(parent, direction, buffs, type
|
|||||||
buffs[i]:SetPoint("TOPLEFT", x, y)
|
buffs[i]:SetPoint("TOPLEFT", x, y)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if not buffs[i].texture then
|
||||||
buffs[i].icon:ClearAllPoints()
|
|
||||||
buffs[i].icon:SetPoint("CENTER", 0, 0)
|
|
||||||
|
|
||||||
-- buffs[i]:Show()
|
|
||||||
-- buffs[i].icon:Show()
|
|
||||||
|
|
||||||
if (not buffs[i].texture) then
|
|
||||||
buffs[i].texture = buffs[i]:CreateTexture()
|
buffs[i].texture = buffs[i]:CreateTexture()
|
||||||
buffs[i].texture:ClearAllPoints()
|
buffs[i].texture:ClearAllPoints()
|
||||||
buffs[i].texture:SetAllPoints(buffs[i])
|
buffs[i].texture:SetAllPoints(buffs[i])
|
||||||
@ -1170,164 +1137,103 @@ function IceTargetInfo.prototype:CreateIconFrames(parent, direction, buffs, type
|
|||||||
return buffs
|
return buffs
|
||||||
end
|
end
|
||||||
|
|
||||||
function IceTargetInfo.prototype:SetBuffSize(buff)
|
function IceTargetInfo.prototype:UpdateBuffType(aura)
|
||||||
|
local auraFrame, reaction
|
||||||
|
local filter = false
|
||||||
|
|
||||||
|
if (aura == "buff") then
|
||||||
|
auraFrame = "buffFrame"
|
||||||
|
reaction = "HELPFUL"
|
||||||
|
elseif (aura == "debuff") then
|
||||||
|
auraFrame = "debuffFrame"
|
||||||
|
reaction = "HARMFUL"
|
||||||
|
else
|
||||||
|
error("Invalid buff frame")
|
||||||
|
end
|
||||||
|
|
||||||
|
if (self.moduleSettings.auras[aura].filter == "Always") then
|
||||||
|
filter = true
|
||||||
|
elseif (self.moduleSettings.auras[aura].filter == "In Combat") then
|
||||||
|
if (UnitAffectingCombat("player")) then
|
||||||
|
filter = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if self.moduleSettings.auras[aura].show then
|
||||||
|
for i = 1, IceCore.BuffLimit do
|
||||||
|
local name, rank, icon, count, debuffType, duration, expirationTime, unitCaster, isStealable = UnitAura(self.unit, i, reaction .. (filter and "|PLAYER" or ""))
|
||||||
|
local isFromMe = (unitCaster == "player")
|
||||||
|
|
||||||
|
if (icon) then
|
||||||
|
self:SetupAura(aura, i, icon, duration, expirationTime, isFromMe, count, isStealable)
|
||||||
|
else
|
||||||
|
self.frame[auraFrame].buffs[i]:Hide()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local direction = self.moduleSettings.auras[aura].growDirection == "Left" and -1 or 1
|
||||||
|
self.frame[auraFrame].buffs = self:CreateIconFrames(self.frame[auraFrame], direction, self.frame[auraFrame].buffs, aura, true)
|
||||||
|
end
|
||||||
|
|
||||||
|
function IceTargetInfo.prototype:SetupAura(aura, i, icon, duration, expirationTime, isFromMe, count, isStealable, auraType)
|
||||||
|
local hostile = UnitCanAttack("player", self.unit)
|
||||||
|
local zoom = self.moduleSettings.zoom
|
||||||
|
local auraFrame = aura.."Frame"
|
||||||
|
|
||||||
|
if aura == "buff" then
|
||||||
|
if isStealable and self.playerClass == "MAGE" then
|
||||||
|
self.frame[auraFrame].buffs[i].texture:SetTexture("Interface\\TargetingFrame\\UI-TargetingFrame-Stealable")
|
||||||
|
if isFromMe then
|
||||||
|
self.frame[auraFrame].buffs[i].icon:SetWidth(self.moduleSettings.auras[aura].ownSize-8)
|
||||||
|
self.frame[auraFrame].buffs[i].icon:SetHeight(self.moduleSettings.auras[aura].ownSize-8)
|
||||||
|
else
|
||||||
|
self.frame[auraFrame].buffs[i].icon:SetWidth(self.moduleSettings.auras[aura].size-8)
|
||||||
|
self.frame[auraFrame].buffs[i].icon:SetHeight(self.moduleSettings.auras[aura].size-8)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
local alpha = icon and 0.5 or 0
|
||||||
|
self.frame[auraFrame].buffs[i].texture:SetTexture(0, 0, 0, alpha)
|
||||||
|
if isFromMe then
|
||||||
|
self.frame[auraFrame].buffs[i].icon:SetWidth(self.moduleSettings.auras[aura].ownSize-2)
|
||||||
|
self.frame[auraFrame].buffs[i].icon:SetHeight(self.moduleSettings.auras[aura].ownSize-2)
|
||||||
|
else
|
||||||
|
self.frame[auraFrame].buffs[i].icon:SetWidth(self.moduleSettings.auras[aura].size-2)
|
||||||
|
self.frame[auraFrame].buffs[i].icon:SetHeight(self.moduleSettings.auras[aura].size-2)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
elseif aura == "debuff" and (not hostile or not filter or (filter and duration)) then
|
||||||
|
local alpha = icon and 1 or 0
|
||||||
|
self.frame[auraFrame].buffs[i].texture:SetTexture(1, 1, 1, alpha)
|
||||||
|
|
||||||
|
local color = debuffType and DebuffTypeColor[debuffType] or DebuffTypeColor["none"]
|
||||||
|
self.frame[auraFrame].buffs[i].texture:SetVertexColor(color.r, color.g, color.b)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- cooldown frame
|
||||||
|
if (duration and duration > 0 and expirationTime and expirationTime > 0) then
|
||||||
|
local start = expirationTime - duration
|
||||||
|
|
||||||
|
self.frame[auraFrame].buffs[i].cd:SetCooldown(start, duration)
|
||||||
|
self.frame[auraFrame].buffs[i].cd:Show()
|
||||||
|
else
|
||||||
|
self.frame[auraFrame].buffs[i].cd:Hide()
|
||||||
|
end
|
||||||
|
|
||||||
|
self.frame[auraFrame].buffs[i].type = auraType or aura
|
||||||
|
self.frame[auraFrame].buffs[i].fromPlayer = isFromMe
|
||||||
|
|
||||||
|
self.frame[auraFrame].buffs[i].icon.texture:SetTexture(icon)
|
||||||
|
self.frame[auraFrame].buffs[i].icon.texture:SetTexCoord(zoom, 1-zoom, zoom, 1-zoom)
|
||||||
|
self.frame[auraFrame].buffs[i].icon.stack:SetText((count and (count > 1)) and count or nil)
|
||||||
|
|
||||||
|
self.frame[auraFrame].buffs[i]:Show()
|
||||||
end
|
end
|
||||||
|
|
||||||
function IceTargetInfo.prototype:UpdateBuffs()
|
function IceTargetInfo.prototype:UpdateBuffs()
|
||||||
local zoom = self.moduleSettings.zoom
|
self:UpdateBuffType("buff")
|
||||||
local filterBuffs = false
|
self:UpdateBuffType("debuff")
|
||||||
local filterDebuffs = false
|
|
||||||
|
|
||||||
if (self.moduleSettings.filterBuffs == "Always") then
|
|
||||||
filterBuffs = true
|
|
||||||
elseif (self.moduleSettings.filterBuffs == "In Combat") then
|
|
||||||
if (UnitAffectingCombat("player")) then
|
|
||||||
filterBuffs = true
|
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
if (self.moduleSettings.filterDebuffs == "Always") then
|
|
||||||
filterDebuffs = true
|
|
||||||
elseif (self.moduleSettings.filterDebuffs == "In Combat") then
|
|
||||||
if (UnitAffectingCombat("player")) then
|
|
||||||
filterDebuffs = true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local hostile = UnitCanAttack("player", self.unit)
|
|
||||||
|
|
||||||
|
|
||||||
if self.moduleSettings.showBuffs then
|
|
||||||
for i = 1, IceCore.BuffLimit do
|
|
||||||
local buffName, buffRank, buffTexture, buffApplications, buffType, buffDuration, buffTimeLeft, isFromMe, unitCaster, isStealable;
|
|
||||||
if IceHUD.WowVer >= 30000 then
|
|
||||||
buffName, buffRank, buffTexture, buffApplications, buffType, buffDuration, buffTimeLeft, unitCaster, isStealable
|
|
||||||
= UnitAura(self.unit, i, "HELPFUL" .. (filterBuffs and "|PLAYER" or "")) --UnitBuff(self.unit, i, filterBuffs and not hostile)
|
|
||||||
|
|
||||||
isFromMe = (unitCaster == "player")
|
|
||||||
else
|
|
||||||
buffName, buffRank, buffTexture, buffApplications, buffDuration, buffTimeLeft
|
|
||||||
= UnitBuff(self.unit, i, filterBuffs and not hostile)
|
|
||||||
|
|
||||||
isFromMe = buffDuration and buffTimeLeft
|
|
||||||
end
|
|
||||||
|
|
||||||
if (buffTexture) then
|
|
||||||
self:SetUpBuff(i, buffTexture, buffDuration, buffTimeLeft, isFromMe, buffApplications, "buff", isStealable)
|
|
||||||
else
|
|
||||||
self.frame.buffFrame.buffs[i]:Hide()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local direction = self.moduleSettings.buffGrowDirection == "Left" and -1 or 1
|
|
||||||
self.frame.buffFrame.buffs = self:CreateIconFrames(self.frame.buffFrame, direction, self.frame.buffFrame.buffs, "buff", true)
|
|
||||||
|
|
||||||
if self.moduleSettings.showDebuffs then
|
|
||||||
for i = 1, IceCore.BuffLimit do
|
|
||||||
local buffName, buffRank, buffTexture, buffApplications, debuffDispelType,
|
|
||||||
debuffDuration, debuffTimeLeft, unitCaster = UnitAura(self.unit, i, "HARMFUL" .. (filterDebuffs and "|PLAYER" or "")) --UnitDebuff(self.unit, i, filterDebuffs and not hostile)
|
|
||||||
|
|
||||||
local isFromMe = (unitCaster == "player")
|
|
||||||
|
|
||||||
if (buffTexture and (not hostile or not filterDebuffs or (filterDebuffs and debuffDuration))) then
|
|
||||||
local alpha = buffTexture and 1 or 0
|
|
||||||
self.frame.debuffFrame.buffs[i].texture:SetTexture(1, 1, 1, alpha)
|
|
||||||
|
|
||||||
local color = debuffDispelType and DebuffTypeColor[debuffDispelType] or DebuffTypeColor["none"]
|
|
||||||
self.frame.debuffFrame.buffs[i].texture:SetVertexColor(color.r, color.g, color.b)
|
|
||||||
|
|
||||||
-- cooldown frame
|
|
||||||
if (debuffDuration and debuffDuration > 0 and
|
|
||||||
debuffTimeLeft and debuffTimeLeft > 0) then
|
|
||||||
local start
|
|
||||||
if IceHUD.WowVer >= 30000 then
|
|
||||||
-- in wotlk, the "bufftimeleft" parameter is actually the ending time for the buff
|
|
||||||
start = debuffTimeLeft - debuffDuration
|
|
||||||
else
|
|
||||||
start = GetTime() - debuffDuration + debuffTimeLeft
|
|
||||||
end
|
|
||||||
self.frame.debuffFrame.buffs[i].cd:SetCooldown(start, debuffDuration)
|
|
||||||
self.frame.debuffFrame.buffs[i].cd:Show()
|
|
||||||
else
|
|
||||||
self.frame.debuffFrame.buffs[i].cd:Hide()
|
|
||||||
end
|
|
||||||
|
|
||||||
self.frame.debuffFrame.buffs[i].type = "debuff"
|
|
||||||
self.frame.debuffFrame.buffs[i].fromPlayer = isFromMe
|
|
||||||
|
|
||||||
self.frame.debuffFrame.buffs[i].icon.texture:SetTexture(buffTexture)
|
|
||||||
self.frame.debuffFrame.buffs[i].icon.texture:SetTexCoord(zoom, 1-zoom, zoom, 1-zoom)
|
|
||||||
|
|
||||||
if (buffApplications and (buffApplications > 1)) then
|
|
||||||
self.frame.debuffFrame.buffs[i].icon.stack:SetText(buffApplications)
|
|
||||||
else
|
|
||||||
self.frame.debuffFrame.buffs[i].icon.stack:SetText(nil)
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
self.frame.debuffFrame.buffs[i]:Show()
|
|
||||||
else
|
|
||||||
self.frame.debuffFrame.buffs[i]:Hide()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local direction = self.moduleSettings.debuffGrowDirection == "Left" and -1 or 1
|
|
||||||
self.frame.debuffFrame.buffs = self:CreateIconFrames(self.frame.debuffFrame, direction, self.frame.debuffFrame.buffs, "debuff")
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
function IceTargetInfo.prototype:SetUpBuff(i, buffTexture, buffDuration, buffTimeLeft, isFromMe, buffApplications, buffType, isStealable)
|
|
||||||
local zoom = self.moduleSettings.zoom
|
|
||||||
|
|
||||||
if isStealable and self.playerClass == "MAGE" then
|
|
||||||
self.frame.buffFrame.buffs[i].texture:SetTexture("Interface\\TargetingFrame\\UI-TargetingFrame-Stealable")
|
|
||||||
if isFromMe then
|
|
||||||
self.frame.buffFrame.buffs[i].icon:SetWidth(self.moduleSettings.ownBuffSize-8)
|
|
||||||
self.frame.buffFrame.buffs[i].icon:SetHeight(self.moduleSettings.ownBuffSize-8)
|
|
||||||
else
|
|
||||||
self.frame.buffFrame.buffs[i].icon:SetWidth(self.moduleSettings.buffSize-8)
|
|
||||||
self.frame.buffFrame.buffs[i].icon:SetHeight(self.moduleSettings.buffSize-8)
|
|
||||||
end
|
|
||||||
else
|
|
||||||
local alpha = buffTexture and 0.5 or 0
|
|
||||||
self.frame.buffFrame.buffs[i].texture:SetTexture(0, 0, 0, alpha)
|
|
||||||
if isFromMe then
|
|
||||||
self.frame.buffFrame.buffs[i].icon:SetWidth(self.moduleSettings.ownBuffSize-2)
|
|
||||||
self.frame.buffFrame.buffs[i].icon:SetHeight(self.moduleSettings.ownBuffSize-2)
|
|
||||||
else
|
|
||||||
self.frame.buffFrame.buffs[i].icon:SetWidth(self.moduleSettings.buffSize-2)
|
|
||||||
self.frame.buffFrame.buffs[i].icon:SetHeight(self.moduleSettings.buffSize-2)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
self.frame.buffFrame.buffs[i].type = buffType
|
|
||||||
self.frame.buffFrame.buffs[i].icon.texture:SetTexture(buffTexture)
|
|
||||||
self.frame.buffFrame.buffs[i].icon.texture:SetTexCoord(zoom, 1-zoom, zoom, 1-zoom)
|
|
||||||
|
|
||||||
-- cooldown frame
|
|
||||||
if (buffDuration and buffDuration > 0 and
|
|
||||||
buffTimeLeft and buffTimeLeft > 0) then
|
|
||||||
local start = buffTimeLeft - buffDuration
|
|
||||||
self.frame.buffFrame.buffs[i].cd:SetCooldown(start, buffDuration)
|
|
||||||
self.frame.buffFrame.buffs[i].cd:Show()
|
|
||||||
else
|
|
||||||
self.frame.buffFrame.buffs[i].cd:Hide()
|
|
||||||
end
|
|
||||||
|
|
||||||
self.frame.buffFrame.buffs[i].fromPlayer = isFromMe
|
|
||||||
|
|
||||||
if (buffApplications and (buffApplications > 1)) then
|
|
||||||
self.frame.buffFrame.buffs[i].icon.stack:SetText(buffApplications)
|
|
||||||
else
|
|
||||||
self.frame.buffFrame.buffs[i].icon.stack:SetText(nil)
|
|
||||||
end
|
|
||||||
|
|
||||||
self.frame.buffFrame.buffs[i]:Show()
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function IceTargetInfo.prototype:AuraChanged(event, unit)
|
function IceTargetInfo.prototype:AuraChanged(event, unit)
|
||||||
if (unit == self.unit) then
|
if (unit == self.unit) then
|
||||||
@ -1335,7 +1241,6 @@ function IceTargetInfo.prototype:AuraChanged(event, unit)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function IceTargetInfo.prototype:UpdateRaidTargetIcon()
|
function IceTargetInfo.prototype:UpdateRaidTargetIcon()
|
||||||
if not (UnitExists(self.unit)) then
|
if not (UnitExists(self.unit)) then
|
||||||
self.frame.raidIcon:Hide()
|
self.frame.raidIcon:Hide()
|
||||||
@ -1546,32 +1451,11 @@ function IceTargetInfo.prototype:BuffOnEnter(this)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local type = nil
|
|
||||||
for i = 1, IceCore.BuffLimit do
|
|
||||||
if self.frame.buffFrame.buffs[i] and self.frame.buffFrame.buffs[i] == this then
|
|
||||||
type = self.frame.buffFrame.buffs[i].type
|
|
||||||
break
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if not type then
|
|
||||||
for i = 1, IceCore.BuffLimit do
|
|
||||||
if self.frame.debuffFrame.buffs[i] and self.frame.debuffFrame.buffs[i] == this then
|
|
||||||
type = self.frame.debuffFrame.buffs[i].type
|
|
||||||
break
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if not type then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
GameTooltip:SetOwner(this, "ANCHOR_BOTTOMRIGHT")
|
GameTooltip:SetOwner(this, "ANCHOR_BOTTOMRIGHT")
|
||||||
if (type == "buff") then
|
if this.type == "buff" then
|
||||||
GameTooltip:SetUnitBuff(self.unit, this.id)
|
GameTooltip:SetUnitBuff(self.unit, this.id)
|
||||||
elseif (type == "mh" or type == "oh") then
|
elseif this.type == "mh" or this.type == "oh" then
|
||||||
GameTooltip:SetInventoryItem("player", type == "mh" and GetInventorySlotInfo("MainHandSlot") or GetInventorySlotInfo("SecondaryHandSlot"))
|
GameTooltip:SetInventoryItem("player", this.type == "mh" and GetInventorySlotInfo("MainHandSlot") or GetInventorySlotInfo("SecondaryHandSlot"))
|
||||||
else
|
else
|
||||||
GameTooltip:SetUnitDebuff(self.unit, this.id)
|
GameTooltip:SetUnitDebuff(self.unit, this.id)
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user