mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 14:50:13 -05:00
- 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:
@ -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 -------------------------------------------------------------
|
||||
|
||||
|
Reference in New Issue
Block a user