mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 22:51:53 -05:00
- added highlighting around buffs on the targetinfo module (and other *info modules) that are spellstealable if the player is a mage
This commit is contained in:
@ -28,6 +28,7 @@ IceTargetInfo.prototype.reaction = nil
|
|||||||
IceTargetInfo.prototype.tapped = nil
|
IceTargetInfo.prototype.tapped = nil
|
||||||
|
|
||||||
IceTargetInfo.prototype.isPlayer = nil
|
IceTargetInfo.prototype.isPlayer = nil
|
||||||
|
IceTargetInfo.prototype.playerClass = nil
|
||||||
|
|
||||||
|
|
||||||
-- Constructor --
|
-- Constructor --
|
||||||
@ -51,6 +52,8 @@ end
|
|||||||
function IceTargetInfo.prototype:Enable(core)
|
function IceTargetInfo.prototype:Enable(core)
|
||||||
IceTargetInfo.super.prototype.Enable(self, core)
|
IceTargetInfo.super.prototype.Enable(self, core)
|
||||||
|
|
||||||
|
_, self.playerClass = UnitClass("player")
|
||||||
|
|
||||||
if IceHUD.IceCore:ShouldUseDogTags() then
|
if IceHUD.IceCore:ShouldUseDogTags() then
|
||||||
DogTag = LibStub("LibDogTag-3.0", true)
|
DogTag = LibStub("LibDogTag-3.0", true)
|
||||||
if DogTag then
|
if DogTag then
|
||||||
@ -946,7 +949,7 @@ function IceTargetInfo.prototype:CreateDebuffFrame(redraw)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function IceTargetInfo.prototype:CreateIconFrames(parent, direction, buffs, type)
|
function IceTargetInfo.prototype:CreateIconFrames(parent, direction, buffs, type, skipSize)
|
||||||
local lastX = 0
|
local lastX = 0
|
||||||
local lastBuffSize = 0
|
local lastBuffSize = 0
|
||||||
|
|
||||||
@ -967,6 +970,7 @@ function IceTargetInfo.prototype:CreateIconFrames(parent, direction, buffs, type
|
|||||||
end
|
end
|
||||||
|
|
||||||
buffs[i].icon:SetFrameStrata("BACKGROUND")
|
buffs[i].icon:SetFrameStrata("BACKGROUND")
|
||||||
|
if not skipSize then
|
||||||
if buffs[i].fromPlayer then
|
if buffs[i].fromPlayer then
|
||||||
buffs[i].icon:SetWidth(self.moduleSettings.ownBuffSize-2)
|
buffs[i].icon:SetWidth(self.moduleSettings.ownBuffSize-2)
|
||||||
buffs[i].icon:SetHeight(self.moduleSettings.ownBuffSize-2)
|
buffs[i].icon:SetHeight(self.moduleSettings.ownBuffSize-2)
|
||||||
@ -974,6 +978,7 @@ function IceTargetInfo.prototype:CreateIconFrames(parent, direction, buffs, type
|
|||||||
buffs[i].icon:SetWidth(self.moduleSettings.buffSize-2)
|
buffs[i].icon:SetWidth(self.moduleSettings.buffSize-2)
|
||||||
buffs[i].icon:SetHeight(self.moduleSettings.buffSize-2)
|
buffs[i].icon:SetHeight(self.moduleSettings.buffSize-2)
|
||||||
end
|
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)
|
||||||
@ -1075,7 +1080,7 @@ function IceTargetInfo.prototype:UpdateBuffs()
|
|||||||
|
|
||||||
if self.moduleSettings.showBuffs then
|
if self.moduleSettings.showBuffs then
|
||||||
for i = 1, IceCore.BuffLimit do
|
for i = 1, IceCore.BuffLimit do
|
||||||
local buffName, buffRank, buffTexture, buffApplications, buffType, buffDuration, buffTimeLeft, isFromMe, unitCaster;
|
local buffName, buffRank, buffTexture, buffApplications, buffType, buffDuration, buffTimeLeft, isFromMe, unitCaster, isStealable;
|
||||||
if IceHUD.WowVer >= 30000 then
|
if IceHUD.WowVer >= 30000 then
|
||||||
buffName, buffRank, buffTexture, buffApplications, buffType, buffDuration, buffTimeLeft, unitCaster, isStealable
|
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)
|
= UnitAura(self.unit, i, "HELPFUL" .. (filterBuffs and "|PLAYER" or "")) --UnitBuff(self.unit, i, filterBuffs and not hostile)
|
||||||
@ -1089,7 +1094,7 @@ function IceTargetInfo.prototype:UpdateBuffs()
|
|||||||
end
|
end
|
||||||
|
|
||||||
if (buffTexture) then
|
if (buffTexture) then
|
||||||
self:SetUpBuff(i, buffTexture, buffDuration, buffTimeLeft, isFromMe, buffApplications)
|
self:SetUpBuff(i, buffTexture, buffDuration, buffTimeLeft, isFromMe, buffApplications, buffType, isStealable)
|
||||||
else
|
else
|
||||||
self.frame.buffFrame.buffs[i]:Hide()
|
self.frame.buffFrame.buffs[i]:Hide()
|
||||||
end
|
end
|
||||||
@ -1097,7 +1102,7 @@ function IceTargetInfo.prototype:UpdateBuffs()
|
|||||||
end
|
end
|
||||||
|
|
||||||
local direction = self.moduleSettings.buffGrowDirection == "Left" and -1 or 1
|
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")
|
self.frame.buffFrame.buffs = self:CreateIconFrames(self.frame.buffFrame, direction, self.frame.buffFrame.buffs, "buff", true)
|
||||||
|
|
||||||
if self.moduleSettings.showDebuffs then
|
if self.moduleSettings.showDebuffs then
|
||||||
for i = 1, IceCore.BuffLimit do
|
for i = 1, IceCore.BuffLimit do
|
||||||
@ -1107,10 +1112,10 @@ function IceTargetInfo.prototype:UpdateBuffs()
|
|||||||
local isFromMe = (unitCaster == "player")
|
local isFromMe = (unitCaster == "player")
|
||||||
|
|
||||||
if (buffTexture and (not hostile or not filterDebuffs or (filterDebuffs and debuffDuration))) then
|
if (buffTexture and (not hostile or not filterDebuffs or (filterDebuffs and debuffDuration))) then
|
||||||
|
|
||||||
local color = debuffDispelType and DebuffTypeColor[debuffDispelType] or DebuffTypeColor["none"]
|
|
||||||
local alpha = buffTexture and 1 or 0
|
local alpha = buffTexture and 1 or 0
|
||||||
self.frame.debuffFrame.buffs[i].texture:SetTexture(1, 1, 1, alpha)
|
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)
|
self.frame.debuffFrame.buffs[i].texture:SetVertexColor(color.r, color.g, color.b)
|
||||||
|
|
||||||
-- cooldown frame
|
-- cooldown frame
|
||||||
@ -1153,16 +1158,34 @@ function IceTargetInfo.prototype:UpdateBuffs()
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function IceTargetInfo.prototype:SetUpBuff(i, buffTexture, buffDuration, buffTimeLeft, isFromMe, buffApplications, buffType)
|
function IceTargetInfo.prototype:SetUpBuff(i, buffTexture, buffDuration, buffTimeLeft, isFromMe, buffApplications, buffType, isStealable)
|
||||||
local zoom = self.moduleSettings.zoom
|
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].type = buffType
|
||||||
self.frame.buffFrame.buffs[i].icon.texture:SetTexture(buffTexture)
|
self.frame.buffFrame.buffs[i].icon.texture:SetTexture(buffTexture)
|
||||||
self.frame.buffFrame.buffs[i].icon.texture:SetTexCoord(zoom, 1-zoom, zoom, 1-zoom)
|
self.frame.buffFrame.buffs[i].icon.texture:SetTexCoord(zoom, 1-zoom, zoom, 1-zoom)
|
||||||
|
|
||||||
local alpha = buffTexture and 0.5 or 0
|
|
||||||
self.frame.buffFrame.buffs[i].texture:SetTexture(0, 0, 0, alpha)
|
|
||||||
|
|
||||||
-- cooldown frame
|
-- cooldown frame
|
||||||
if (buffDuration and buffDuration > 0 and
|
if (buffDuration and buffDuration > 0 and
|
||||||
buffTimeLeft and buffTimeLeft > 0) then
|
buffTimeLeft and buffTimeLeft > 0) then
|
||||||
|
Reference in New Issue
Block a user