- fixed 'inverse' mode to work with potential SnD bar

- expanded range of class power counters (shards, holy power) by request
- fixed lacerate and sunder count modules to work with 3 max charges instead of 5 as per the new patch (these *really* need to go away and be auto-replaced by custom counters...)
- yet another fix for text sometimes displaying the unit name for PetHealth
- fixed how the 'second highest threat' bar is drawn so that it actually works with all textures
This commit is contained in:
Parnic
2010-10-17 20:20:00 +00:00
parent 3af07ee30d
commit cb77e8358b
7 changed files with 58 additions and 53 deletions

View File

@ -55,7 +55,7 @@ function IceBarElement.prototype:Enable()
self.moduleSettings.reverse = false self.moduleSettings.reverse = false
self.moduleSettings.inverse = true self.moduleSettings.inverse = true
self:SetBarFramePoints() self:SetBarFramePoints(self.barFrame)
end end
end end
@ -224,7 +224,7 @@ function IceBarElement.prototype:GetOptions()
end, end,
set = function(info, value) set = function(info, value)
self.moduleSettings.inverse = value self.moduleSettings.inverse = value
self:SetBarFramePoints() self:SetBarFramePoints(self.barFrame)
self:Redraw() self:Redraw()
end, end,
disabled = function() disabled = function()
@ -243,7 +243,7 @@ function IceBarElement.prototype:GetOptions()
end, end,
set = function(info, value) set = function(info, value)
self.moduleSettings.reverse = value self.moduleSettings.reverse = value
self:SetBarFramePoints() self:SetBarFramePoints(self.barFrame)
self:Redraw() self:Redraw()
end, end,
disabled = function() disabled = function()
@ -770,12 +770,12 @@ function IceBarElement.prototype:SetBarVisibility(visible)
end end
end end
function IceBarElement.prototype:SetBarFramePoints() function IceBarElement.prototype:SetBarFramePoints(frame)
self.barFrame:ClearAllPoints() frame:ClearAllPoints()
if (self.moduleSettings.inverse) then if (self.moduleSettings.inverse) then
self.barFrame:SetPoint("TOPLEFT", self.frame, "TOPLEFT") frame:SetPoint("TOPLEFT", self.frame, "TOPLEFT")
else else
self.barFrame:SetPoint("BOTTOMLEFT", self.frame, "BOTTOMLEFT") frame:SetPoint("BOTTOMLEFT", self.frame, "BOTTOMLEFT")
end end
end end
@ -894,7 +894,7 @@ function IceBarElement.prototype:CreateBar()
end end
self.barFrame:SetFrameStrata("LOW") self.barFrame:SetFrameStrata("LOW")
self:SetBarFramePoints() self:SetBarFramePoints(self.barFrame)
self.barFrame:SetWidth(self.settings.barWidth + (self.moduleSettings.widthModifier or 0)) self.barFrame:SetWidth(self.settings.barWidth + (self.moduleSettings.widthModifier or 0))
self.barFrame:SetHeight(self.settings.barHeight) self.barFrame:SetHeight(self.settings.barHeight)

View File

@ -35,7 +35,7 @@ function IceClassPowerCounter.prototype:GetOptions()
self:Redraw() self:Redraw()
end, end,
min = -300, min = -300,
max = 300, max = 700,
step = 1, step = 1,
disabled = function() disabled = function()
return not self.moduleSettings.enabled return not self.moduleSettings.enabled

View File

@ -2,6 +2,7 @@ local L = LibStub("AceLocale-3.0"):GetLocale("IceHUD", false)
local LacerateCount = IceCore_CreateClass(IceElement) local LacerateCount = IceCore_CreateClass(IceElement)
LacerateCount.prototype.lacerateSize = 20 LacerateCount.prototype.lacerateSize = 20
LacerateCount.prototype.numLacerates = 3
-- Constructor -- -- Constructor --
function LacerateCount.prototype:init() function LacerateCount.prototype:init()
@ -137,6 +138,8 @@ function LacerateCount.prototype:GetOptions()
order = 34 order = 34
} }
opts.gradient.desc = string.gsub(opts.gradient.desc, "5", tostring(self.numLacerates))
return opts return opts
end end
@ -188,7 +191,7 @@ function LacerateCount.prototype:CreateFrame()
LacerateCount.super.prototype.CreateFrame(self) LacerateCount.super.prototype.CreateFrame(self)
self.frame:SetFrameStrata("BACKGROUND") self.frame:SetFrameStrata("BACKGROUND")
self.frame:SetWidth(self.lacerateSize*5) self.frame:SetWidth(self.lacerateSize*self.numLacerates)
self.frame:SetHeight(1) self.frame:SetHeight(1)
self.frame:ClearAllPoints() self.frame:ClearAllPoints()
self.frame:SetPoint("TOP", self.parent, "BOTTOM", self.moduleSettings.hpos, self.moduleSettings.vpos) self.frame:SetPoint("TOP", self.parent, "BOTTOM", self.moduleSettings.hpos, self.moduleSettings.vpos)
@ -216,7 +219,7 @@ function LacerateCount.prototype:CreateLacerateFrame(doTextureUpdate)
end end
-- create backgrounds -- create backgrounds
for i = 1, 5 do for i = 1, self.numLacerates do
if (not self.frame.graphicalBG[i]) then if (not self.frame.graphicalBG[i]) then
local frame = CreateFrame("Frame", nil, self.frame) local frame = CreateFrame("Frame", nil, self.frame)
self.frame.graphicalBG[i] = frame self.frame.graphicalBG[i] = frame
@ -247,7 +250,7 @@ function LacerateCount.prototype:CreateLacerateFrame(doTextureUpdate)
end end
-- create lacerates -- create lacerates
for i = 1, 5 do for i = 1, self.numLacerates do
if (not self.frame.graphical[i]) then if (not self.frame.graphical[i]) then
local frame = CreateFrame("Frame", nil, self.frame) local frame = CreateFrame("Frame", nil, self.frame)
self.frame.graphical[i] = frame self.frame.graphical[i] = frame
@ -272,7 +275,7 @@ function LacerateCount.prototype:CreateLacerateFrame(doTextureUpdate)
local r, g, b = self:GetColor("LacerateCount") local r, g, b = self:GetColor("LacerateCount")
if (self.moduleSettings.gradient) then if (self.moduleSettings.gradient) then
g = g - (0.15*i) g = g - ((0.75 / self.numLacerates) * i)
end end
self.frame.graphical[i].texture:SetVertexColor(r, g, b) self.frame.graphical[i].texture:SetVertexColor(r, g, b)
@ -284,7 +287,7 @@ end
function LacerateCount.prototype:UpdateLacerateCount() function LacerateCount.prototype:UpdateLacerateCount()
local points local points
if IceHUD.IceCore:IsInConfigMode() then if IceHUD.IceCore:IsInConfigMode() then
points = 5 points = self.numLacerates
else else
points = IceHUD:GetDebuffCount("target", "Ability_Druid_Lacerate", true) points = IceHUD:GetDebuffCount("target", "Ability_Druid_Lacerate", true)
end end
@ -296,7 +299,7 @@ function LacerateCount.prototype:UpdateLacerateCount()
if (self.moduleSettings.lacerateMode == "Numeric") then if (self.moduleSettings.lacerateMode == "Numeric") then
local r, g, b = self:GetColor("LacerateCount") local r, g, b = self:GetColor("LacerateCount")
if (self.moduleSettings.gradient and points) then if (self.moduleSettings.gradient and points) then
g = g - (0.15*points) g = g - ((0.75 / self.numLacerates) * points)
end end
self.frame.numeric:SetTextColor(r, g, b, 0.7) self.frame.numeric:SetTextColor(r, g, b, 0.7)

View File

@ -34,21 +34,14 @@ end
-- OVERRIDE -- OVERRIDE
--[[
function PetHealth.prototype:CreateFrame() function PetHealth.prototype:CreateFrame()
PetHealth.super.prototype.CreateFrame(self) PetHealth.super.prototype.CreateFrame(self)
local point, relativeTo, relativePoint, xoff, yoff = self.frame.bottomUpperText:GetPoint() if not UnitExists(self.unit) then
if (point == "TOPLEFT") then self.frame.bottomUpperText:Hide()
point = "BOTTOMLEFT" self.frame.bottomLowerText:Hide()
else
point = "BOTTOMRIGHT"
end end
self.frame.bottomUpperText:ClearAllPoints()
self.frame.bottomUpperText:SetPoint(point, relativeTo, relativePoint, 0, 0)
end end
]]
function PetHealth.prototype:Enable(core) function PetHealth.prototype:Enable(core)
PetHealth.super.prototype.Enable(self, core) PetHealth.super.prototype.Enable(self, core)

View File

@ -141,6 +141,7 @@ function SliceAndDice.prototype:CreateDurationBar()
end end
self.durationFrame:SetFrameStrata("BACKGROUND") self.durationFrame:SetFrameStrata("BACKGROUND")
self:SetBarFramePoints(self.durationFrame)
self.durationFrame:SetWidth(self.settings.barWidth + (self.moduleSettings.widthModifier or 0)) self.durationFrame:SetWidth(self.settings.barWidth + (self.moduleSettings.widthModifier or 0))
self.durationFrame:SetHeight(self.settings.barHeight) self.durationFrame:SetHeight(self.settings.barHeight)
@ -149,17 +150,12 @@ function SliceAndDice.prototype:CreateDurationBar()
end end
self.durationFrame.bar:SetTexture(IceElement.TexturePath .. self:GetMyBarTexture()) self.durationFrame.bar:SetTexture(IceElement.TexturePath .. self:GetMyBarTexture())
self.durationFrame.bar:SetPoint("BOTTOMLEFT",self.frame,"BOTTOMLEFT") self.durationFrame.bar:SetAllPoints(self.durationFrame)
self.durationFrame.bar:SetPoint("BOTTOMRIGHT",self.frame,"BOTTOMRIGHT")
self.durationFrame.bar:SetVertexColor(self:GetColor("SliceAndDicePotential", self.alpha * self.moduleSettings.durationAlpha)) self.durationFrame.bar:SetVertexColor(self:GetColor("SliceAndDicePotential", self.alpha * self.moduleSettings.durationAlpha))
self.durationFrame.bar:SetHeight(0) self.durationFrame.bar:SetHeight(0)
self:UpdateBar(1, "undef") self:UpdateBar(1, "undef")
self.durationFrame:ClearAllPoints()
self.durationFrame:SetPoint("BOTTOM", self.frame, "BOTTOM", 0, 0)
-- force update the bar...if we're in here, then either the UI was just loaded or the player is jacking with the options. -- force update the bar...if we're in here, then either the UI was just loaded or the player is jacking with the options.
-- either way, make sure the duration bar matches accordingly -- either way, make sure the duration bar matches accordingly
self:UpdateDurationBar() self:UpdateDurationBar()
@ -295,12 +291,23 @@ function SliceAndDice.prototype:UpdateDurationBar(event, unit)
scale = IceHUD:Clamp(PotentialSnDDuration / CurrMaxSnDDuration, 0, 1) scale = IceHUD:Clamp(PotentialSnDDuration / CurrMaxSnDDuration, 0, 1)
-- sadly, animation uses bar-local variables so we can't use the animation for 2 bar textures on the same bar element -- sadly, animation uses bar-local variables so we can't use the animation for 2 bar textures on the same bar element
if (self.moduleSettings.side == IceCore.Side.Left) then if (self.moduleSettings.reverse) then
self.durationFrame.bar:SetTexCoord(1, 0, 1-scale, 1) scale = 1 - scale
else
self.durationFrame.bar:SetTexCoord(0, 1, 1-scale, 1)
end end
self.durationFrame.bar:SetHeight(self.settings.barHeight * scale) if (self.moduleSettings.inverse) then
min_y = 0
max_y = scale
else
min_y = 1-scale
max_y = 1
end
if (self.moduleSettings.side == IceCore.Side.Left) then
self.durationFrame.bar:SetTexCoord(1, 0, min_y, max_y)
else
self.durationFrame.bar:SetTexCoord(0, 1, min_y, max_y)
end
self.durationFrame:SetHeight(self.settings.barHeight * scale)
if scale == 0 then if scale == 0 then
self.durationFrame.bar:Hide() self.durationFrame.bar:Hide()

View File

@ -2,6 +2,7 @@ local L = LibStub("AceLocale-3.0"):GetLocale("IceHUD", false)
local SunderCount = IceCore_CreateClass(IceElement) local SunderCount = IceCore_CreateClass(IceElement)
SunderCount.prototype.sunderSize = 20 SunderCount.prototype.sunderSize = 20
SunderCount.prototype.numSunders = 3
-- Constructor -- -- Constructor --
function SunderCount.prototype:init() function SunderCount.prototype:init()
@ -117,6 +118,8 @@ function SunderCount.prototype:GetOptions()
order = 34 order = 34
} }
opts.gradient.desc = string.gsub(opts.gradient.desc, "5", tostring(self.numSunders))
return opts return opts
end end
@ -167,7 +170,7 @@ function SunderCount.prototype:CreateFrame()
SunderCount.super.prototype.CreateFrame(self) SunderCount.super.prototype.CreateFrame(self)
self.frame:SetFrameStrata("BACKGROUND") self.frame:SetFrameStrata("BACKGROUND")
self.frame:SetWidth(self.sunderSize*5) self.frame:SetWidth(self.sunderSize*self.numSunders)
self.frame:SetHeight(1) self.frame:SetHeight(1)
self.frame:ClearAllPoints() self.frame:ClearAllPoints()
self.frame:SetPoint("TOP", self.parent, "BOTTOM", 0, self.moduleSettings.vpos) self.frame:SetPoint("TOP", self.parent, "BOTTOM", 0, self.moduleSettings.vpos)
@ -195,7 +198,7 @@ function SunderCount.prototype:CreateSunderFrame(doTextureUpdate)
end end
-- create backgrounds -- create backgrounds
for i = 1, 5 do for i = 1, self.numSunders do
if (not self.frame.graphicalBG[i]) then if (not self.frame.graphicalBG[i]) then
local frame = CreateFrame("Frame", nil, self.frame) local frame = CreateFrame("Frame", nil, self.frame)
self.frame.graphicalBG[i] = frame self.frame.graphicalBG[i] = frame
@ -226,7 +229,7 @@ function SunderCount.prototype:CreateSunderFrame(doTextureUpdate)
end end
-- create sunders -- create sunders
for i = 1, 5 do for i = 1, self.numSunders do
if (not self.frame.graphical[i]) then if (not self.frame.graphical[i]) then
local frame = CreateFrame("Frame", nil, self.frame) local frame = CreateFrame("Frame", nil, self.frame)
self.frame.graphical[i] = frame self.frame.graphical[i] = frame
@ -251,7 +254,7 @@ function SunderCount.prototype:CreateSunderFrame(doTextureUpdate)
local r, g, b = self:GetColor("SunderCount") local r, g, b = self:GetColor("SunderCount")
if (self.moduleSettings.gradient) then if (self.moduleSettings.gradient) then
g = g - (0.15*i) g = g - ((0.75 / self.numSunders) * i)
end end
self.frame.graphical[i].texture:SetVertexColor(r, g, b) self.frame.graphical[i].texture:SetVertexColor(r, g, b)
@ -263,7 +266,7 @@ end
function SunderCount.prototype:UpdateSunderCount() function SunderCount.prototype:UpdateSunderCount()
local points local points
if IceHUD.IceCore:IsInConfigMode() then if IceHUD.IceCore:IsInConfigMode() then
points = 5 points = self.numSunders
else else
points = IceHUD:GetDebuffCount("target", "Ability_Warrior_Sunder") points = IceHUD:GetDebuffCount("target", "Ability_Warrior_Sunder")
end end
@ -275,7 +278,7 @@ function SunderCount.prototype:UpdateSunderCount()
if (self.moduleSettings.sunderMode == "Numeric") then if (self.moduleSettings.sunderMode == "Numeric") then
local r, g, b = self:GetColor("SunderCount") local r, g, b = self:GetColor("SunderCount")
if (self.moduleSettings.gradient and points) then if (self.moduleSettings.gradient and points) then
g = g - (0.15*points) g = g - ((0.75 / self.numSunders) * points)
end end
self.frame.numeric:SetTextColor(r, g, b, 0.7) self.frame.numeric:SetTextColor(r, g, b, 0.7)

View File

@ -240,12 +240,7 @@ function IceThreat.prototype:CreateSecondThreatBar()
self.secondThreatBar:SetFrameStrata("MEDIUM") self.secondThreatBar:SetFrameStrata("MEDIUM")
self.secondThreatBar:SetWidth(self.settings.barWidth + (self.moduleSettings.widthModifier or 0)) self.secondThreatBar:SetWidth(self.settings.barWidth + (self.moduleSettings.widthModifier or 0))
self.secondThreatBar:SetHeight(self.settings.barHeight) self.secondThreatBar:SetHeight(self.settings.barHeight)
self.secondThreatBar:ClearAllPoints() self:SetBarFramePoints(self.secondThreatBar)
if self.moduleSettings.inverse then
self.secondThreatBar:SetPoint("TOPLEFT", self.frame, "TOPLEFT")
else
self.secondThreatBar:SetPoint("BOTTOMLEFT", self.frame, "BOTTOMLEFT")
end
if not (self.secondThreatBar.bar) then if not (self.secondThreatBar.bar) then
self.secondThreatBar.bar = self.secondThreatBar:CreateTexture(nil, "OVERLAY") self.secondThreatBar.bar = self.secondThreatBar:CreateTexture(nil, "OVERLAY")
@ -416,17 +411,21 @@ function IceThreat.prototype:UpdateSecondHighestThreatBar(secondHighestThreat, t
pos = 1-pos pos = 1-pos
end end
local min_y = 0 if (self.moduleSettings.reverse) then
local max_y = pos pos = 1 - pos
if self.moduleSettings.inverse then end
if (self.moduleSettings.inverse) then
min_y = 0
max_y = pos
else
min_y = 1-pos min_y = 1-pos
max_y = 1 max_y = 1
end end
if ( self.moduleSettings.side == IceCore.Side.Left ) then if ( self.moduleSettings.side == IceCore.Side.Left ) then
self.secondThreatBar.bar:SetTexCoord(1, 0, max_y, min_y) self.secondThreatBar.bar:SetTexCoord(1, 0, min_y, max_y)
else else
self.secondThreatBar.bar:SetTexCoord(0, 1, max_y, min_y) self.secondThreatBar.bar:SetTexCoord(0, 1, min_y, max_y)
end end
local r, g, b = self:GetColor("ThreatSecondPlace") local r, g, b = self:GetColor("ThreatSecondPlace")