- added a configuration mode to show all bars temporarily so they can be placed

- changed how frames are shown and hidden so we don't call show/hide unnecessarily
- widened the min/max offset numbers to allow greater placement flexibility
This commit is contained in:
Parnic
2008-04-17 02:38:54 +00:00
parent 9555a3db77
commit 3dc2f7f80f
13 changed files with 107 additions and 51 deletions

View File

@ -20,6 +20,8 @@ IceElement.moduleSettings = nil
IceElement.prototype.configColor = "ff8888ff"
IceElement.prototype.scalingEnabled = nil
IceElement.prototype.bIsVisible = true
-- Constructor --
-- IceElements are to be instantiated before IceCore is loaded.
-- Therefore we can wait for IceCore to load and then register our
@ -57,7 +59,7 @@ function IceElement.prototype:Create(parent)
self.parent = parent
self:CreateFrame()
self.frame:Hide()
self:Show(false)
end
@ -76,7 +78,7 @@ function IceElement.prototype:Enable(core)
if (not core) then
self.moduleSettings.enabled = true
end
self.frame:Show()
self:Show(true)
end
@ -84,7 +86,7 @@ function IceElement.prototype:Disable(core)
if (not core) then
self.moduleSettings.enabled = false
end
self.frame:Hide()
self:Show(false)
self:UnregisterAllEvents()
end
@ -262,6 +264,25 @@ function IceElement.prototype:FontFactory(size, frame, font, flags)
end
function IceElement.prototype:IsVisible()
return self.bIsVisible
end
function IceElement.prototype:Show(bShouldShow)
if self.bIsVisible == bShouldShow then
return
end
self.bIsVisible = bShouldShow
if not bShouldShow then
self.frame:Hide()
else
self.frame:Show()
end
end
-- Event Handlers -------------------------------------------------------------