mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 06:40: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:
31
IceCore.lua
31
IceCore.lua
@ -18,20 +18,21 @@ IceCore.prototype.elements = {}
|
||||
IceCore.prototype.enabled = nil
|
||||
IceCore.prototype.presets = {}
|
||||
IceCore.prototype.settingsHash = nil
|
||||
IceCore.prototype.bConfigMode = false
|
||||
|
||||
-- Constructor --
|
||||
function IceCore.prototype:init()
|
||||
IceCore.super.prototype.init(self)
|
||||
IceHUD:Debug("IceCore.prototype:init()")
|
||||
|
||||
|
||||
self:RegisterDB("IceCoreDB")
|
||||
|
||||
|
||||
self.IceHUDFrame = CreateFrame("Frame","IceHUDFrame", UIParent)
|
||||
|
||||
|
||||
-- We are ready to load modules
|
||||
self:RegisterEvent(IceCore.RegisterModule, "Register")
|
||||
self:TriggerEvent(IceCore.Loaded)
|
||||
|
||||
|
||||
|
||||
-- DEFAULT SETTINGS
|
||||
local defaultPreset = "RoundBar"
|
||||
@ -96,6 +97,8 @@ end
|
||||
|
||||
|
||||
function IceCore.prototype:Disable()
|
||||
self:ConfigModeToggle(false)
|
||||
|
||||
for i = 1, table.getn(self.elements) do
|
||||
if (self.elements[i]:IsEnabled()) then
|
||||
self.elements[i]:Disable(true)
|
||||
@ -387,6 +390,26 @@ function IceCore.prototype:SetColor(color, r, g, b)
|
||||
end
|
||||
|
||||
|
||||
function IceCore.prototype:IsInConfigMode()
|
||||
return self.bConfigMode
|
||||
end
|
||||
|
||||
function IceCore.prototype:ConfigModeToggle(bWantConfig)
|
||||
self.bConfigMode = bWantConfig
|
||||
|
||||
if bWantConfig then
|
||||
for i = 1, table.getn(self.elements) do
|
||||
self.elements[i].frame:Show()
|
||||
end
|
||||
else
|
||||
for i = 1, table.getn(self.elements) do
|
||||
if not self.elements[i]:IsVisible() then
|
||||
self.elements[i].frame:Hide()
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
-- Presets --
|
||||
|
Reference in New Issue
Block a user