mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 14:50:13 -05:00
Version 0.7
- Added an option to change the bar colors - Using scheduled events now instead of Metrognome - Some small bug fixes
This commit is contained in:
48
IceCore.lua
48
IceCore.lua
@ -36,7 +36,7 @@ function IceCore.prototype:init()
|
||||
local defaults = {
|
||||
gap = 150,
|
||||
verticalPos = -150,
|
||||
scale = 1,
|
||||
scale = 0.9,
|
||||
|
||||
alphaooc = 0.3,
|
||||
alphaic = 0.6,
|
||||
@ -47,7 +47,7 @@ function IceCore.prototype:init()
|
||||
alphaTargetbg = 0.25,
|
||||
|
||||
backgroundToggle = false,
|
||||
backgroundColor = {r = 0.2, g = 0.2, b = 0.2},
|
||||
backgroundColor = {r = 0.5, g = 0.5, b = 0.5},
|
||||
barTexture = "Bar",
|
||||
barPreset = defaultPreset,
|
||||
fontFamily = "IceHUD",
|
||||
@ -66,6 +66,11 @@ function IceCore.prototype:init()
|
||||
defaults.modules[name] = self.elements[i]:GetDefaultSettings()
|
||||
end
|
||||
|
||||
if (table.getn(self.elements) > 0) then
|
||||
defaults.colors = self.elements[1].defaultColors
|
||||
end
|
||||
|
||||
|
||||
self:RegisterDefaults('account', defaults)
|
||||
end
|
||||
|
||||
@ -124,6 +129,7 @@ end
|
||||
|
||||
function IceCore.prototype:GetModuleOptions()
|
||||
local options = {}
|
||||
|
||||
for i = 1, table.getn(self.elements) do
|
||||
local modName = self.elements[i]:GetElementName()
|
||||
local opt = self.elements[i]:GetOptions()
|
||||
@ -139,6 +145,31 @@ function IceCore.prototype:GetModuleOptions()
|
||||
end
|
||||
|
||||
|
||||
function IceCore.prototype:GetColorOptions()
|
||||
assert(table.getn(IceHUD.IceCore.elements) > 0, "Unable to get color options, no elements found!")
|
||||
|
||||
local options = {}
|
||||
|
||||
for k, v in pairs(self.elements[1]:GetColors()) do
|
||||
local kk, vv = k, v
|
||||
options[k] = {
|
||||
type = 'color',
|
||||
desc = k,
|
||||
name = k,
|
||||
get = function()
|
||||
return IceHUD.IceCore:GetColor(kk)
|
||||
end,
|
||||
set = function(r, g, b)
|
||||
local color = k
|
||||
IceHUD.IceCore:SetColor(kk, r, g, b)
|
||||
end
|
||||
}
|
||||
end
|
||||
|
||||
return options
|
||||
end
|
||||
|
||||
|
||||
-- Method to handle module registration
|
||||
function IceCore.prototype:Register(element)
|
||||
assert(element, "Trying to register a nil module")
|
||||
@ -330,6 +361,19 @@ function IceCore.prototype:SetDebug(value)
|
||||
end
|
||||
|
||||
|
||||
function IceCore.prototype:GetColor(color)
|
||||
return self.settings.colors[color].r,
|
||||
self.settings.colors[color].g,
|
||||
self.settings.colors[color].b
|
||||
end
|
||||
function IceCore.prototype:SetColor(color, r, g, b)
|
||||
self.settings.colors[color].r = r
|
||||
self.settings.colors[color].g = g
|
||||
self.settings.colors[color].b = b
|
||||
|
||||
self:Redraw()
|
||||
end
|
||||
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user