- fixed text getting rotated along with bars when choosing the "rotate 90 degrees" option

This commit is contained in:
Parnic
2010-10-14 01:31:47 +00:00
parent d83f0b23fd
commit 272f0fd42d
5 changed files with 13 additions and 6 deletions

View File

@ -818,7 +818,7 @@ end
-- Creates background for the bar -- Creates background for the bar
function IceBarElement.prototype:CreateBackground() function IceBarElement.prototype:CreateBackground()
if not (self.frame) then if not (self.frame) then
self.frame = CreateFrame("Frame", "IceHUD_"..self.elementName, self.parent) self.frame = CreateFrame("Frame", "IceHUD_"..self.elementName, self.masterFrame)
end end
self.frame:SetFrameStrata("BACKGROUND") self.frame:SetFrameStrata("BACKGROUND")

View File

@ -9,6 +9,7 @@ IceElement.TexturePath = IceHUD.Location .. "\\textures\\"
IceElement.prototype.elementName = nil IceElement.prototype.elementName = nil
IceElement.prototype.parent = nil IceElement.prototype.parent = nil
IceElement.prototype.frame = nil IceElement.prototype.frame = nil
IceElement.prototype.masterFrame = nil
IceElement.prototype.defaultColors = {} -- Shared table for all child classes to save some memory IceElement.prototype.defaultColors = {} -- Shared table for all child classes to save some memory
IceElement.prototype.alpha = nil IceElement.prototype.alpha = nil
@ -65,6 +66,9 @@ function IceElement.prototype:Create(parent)
assert(parent, "IceElement 'parent' can't be nil") assert(parent, "IceElement 'parent' can't be nil")
self.parent = parent self.parent = parent
if not self.masterFrame then
self.masterFrame = CreateFrame("Frame", nil, self.parent)
end
self:CreateFrame() self:CreateFrame()
self:Show(false) self:Show(false)
end end
@ -206,8 +210,9 @@ end
-- This should be overwritten by inheriting classes -- This should be overwritten by inheriting classes
function IceElement.prototype:CreateFrame() function IceElement.prototype:CreateFrame()
if not (self.frame) then if not (self.frame) then
self.frame = CreateFrame("Frame", "IceHUD_"..self.elementName, self.parent) self.frame = CreateFrame("Frame", "IceHUD_"..self.elementName, self.masterFrame)
end end
self.masterFrame:SetAllPoints(self.frame)
self.frame:SetScale(self.moduleSettings.scale) self.frame:SetScale(self.moduleSettings.scale)
@ -339,7 +344,7 @@ end
function IceElement.prototype:FontFactory(size, frame, font, flags) function IceElement.prototype:FontFactory(size, frame, font, flags)
if not (frame) then if not (frame) then
frame = self.frame frame = self.masterFrame
end end
local fontString = nil local fontString = nil
@ -381,8 +386,10 @@ function IceElement.prototype:Show(bShouldShow)
self.bIsVisible = bShouldShow self.bIsVisible = bShouldShow
if not bShouldShow then if not bShouldShow then
self.masterFrame:Hide()
self.frame:Hide() self.frame:Hide()
else else
self.masterFrame:Show()
self.frame:Show() self.frame:Show()
end end
end end

View File

@ -122,7 +122,7 @@ end
function RangeCheck.prototype:CreateFrame(redraw) function RangeCheck.prototype:CreateFrame(redraw)
if not (self.frame) then if not (self.frame) then
self.frame = CreateFrame("Frame", "IceHUD_"..self.elementName, self.parent) self.frame = CreateFrame("Frame", "IceHUD_"..self.elementName, self.masterFrame)
end end
self.frame:SetScale(self.moduleSettings.scale) self.frame:SetScale(self.moduleSettings.scale)

View File

@ -776,7 +776,7 @@ end
-- OVERRIDE -- 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.masterFrame, "SecureUnitButtonTemplate")
end end
-- Parnic - yes, 200 is fairly arbitrary. make a best effort for long names to fit -- Parnic - yes, 200 is fairly arbitrary. make a best effort for long names to fit

View File

@ -289,7 +289,7 @@ end
-- OVERRIDE -- OVERRIDE
function TargetOfTarget.prototype:CreateFrame() function TargetOfTarget.prototype:CreateFrame()
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.masterFrame, "SecureUnitButtonTemplate")
self.frame:SetAttribute("unit", self.unit) self.frame:SetAttribute("unit", self.unit)
end end