mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 06:40:13 -05:00
Version 0.4
- New bar type - More configuration options
This commit is contained in:
@ -3,17 +3,10 @@ local AceOO = AceLibrary("AceOO-2.0")
|
||||
IceBarElement = AceOO.Class(IceElement)
|
||||
IceBarElement.virtual = true
|
||||
|
||||
IceBarElement.BackgroundAlpha = 0.25
|
||||
|
||||
IceBarElement.TexturePath = IceHUD.Location .. "\\textures\\"
|
||||
IceBarElement.BackgroundTexture = IceHUD.Location .. "\\textures\\HiBarBG"
|
||||
IceBarElement.BarProportion = 0.36
|
||||
IceBarElement.BarTextureWidth = 128
|
||||
|
||||
IceBarElement.prototype.barFrame = nil
|
||||
IceBarElement.prototype.width = nil
|
||||
IceBarElement.prototype.height = nil
|
||||
IceBarElement.prototype.backgroundAlpha = nil
|
||||
|
||||
IceBarElement.prototype.combat = nil
|
||||
|
||||
@ -23,20 +16,17 @@ IceBarElement.prototype.combat = nil
|
||||
function IceBarElement.prototype:init(name)
|
||||
IceBarElement.super.prototype.init(self, name)
|
||||
|
||||
self.width = 77
|
||||
self.height = 154
|
||||
|
||||
self.backgroundAlpha = IceBarElement.BackgroundAlpha
|
||||
self:SetColor("background", 50, 50, 50)
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
-- 'Public' methods -----------------------------------------------------------
|
||||
|
||||
-- OVERRIDE
|
||||
function IceBarElement.prototype:Enable()
|
||||
IceBarElement.super.prototype.Enable(self)
|
||||
|
||||
self:RegisterEvent("PLAYER_REGEN_DISABLED", "InCombat")
|
||||
self:RegisterEvent("PLAYER_REGEN_ENABLED", "OutCombat")
|
||||
self:RegisterEvent("PLAYER_ENTERING_WORLD", "CheckCombat")
|
||||
@ -133,25 +123,25 @@ function IceBarElement.prototype:CreateBackground()
|
||||
end
|
||||
|
||||
self.frame:SetFrameStrata("BACKGROUND")
|
||||
self.frame:SetWidth(self.width)
|
||||
self.frame:SetHeight(self.height)
|
||||
self.frame:SetWidth(self.settings.barWidth)
|
||||
self.frame:SetHeight(self.settings.barHeight)
|
||||
|
||||
if not (self.frame.bg) then
|
||||
self.frame.bg = self.frame:CreateTexture(nil, "BACKGROUND")
|
||||
end
|
||||
|
||||
self.frame.bg:SetTexture(IceBarElement.BackgroundTexture)
|
||||
self.frame.bg:SetTexture(IceBarElement.TexturePath .. self.settings.barTexture.."BG")
|
||||
self.frame.bg:ClearAllPoints()
|
||||
self.frame.bg:SetAllPoints(self.frame)
|
||||
|
||||
if (self.moduleSettings.side == IceCore.Side.Left) then
|
||||
self.frame.bg:SetTexCoord(1, 0, 0, 1)
|
||||
else
|
||||
self.frame.bg:SetTexCoord(1, 0, 1, 0)
|
||||
self.frame.bg:SetTexCoord(0, 1, 0, 1)
|
||||
end
|
||||
|
||||
self.frame:SetStatusBarTexture(self.frame.bg)
|
||||
self.frame:SetStatusBarColor(self:GetColor("undef", self.backgroundAlpha))
|
||||
self.frame:SetStatusBarColor(self:GetColor("undef", self.settings.alphabg))
|
||||
|
||||
local ownPoint = "LEFT"
|
||||
if (self.moduleSettings.side == ownPoint) then
|
||||
@ -159,8 +149,8 @@ function IceBarElement.prototype:CreateBackground()
|
||||
end
|
||||
|
||||
-- ofxx = (bar width) + (extra space in between the bars)
|
||||
local offx = (IceBarElement.BarProportion * self.width * self.moduleSettings.offset)
|
||||
+ (self.moduleSettings.offset * 5)
|
||||
local offx = (self.settings.barProportion * self.settings.barWidth * self.moduleSettings.offset)
|
||||
+ (self.moduleSettings.offset * self.settings.barSpace)
|
||||
if (self.moduleSettings.side == IceCore.Side.Left) then
|
||||
offx = offx * -1
|
||||
end
|
||||
@ -177,8 +167,8 @@ function IceBarElement.prototype:CreateBar()
|
||||
end
|
||||
|
||||
self.barFrame:SetFrameStrata("BACKGROUND")
|
||||
self.barFrame:SetWidth(self.width)
|
||||
self.barFrame:SetHeight(self.height)
|
||||
self.barFrame:SetWidth(self.settings.barWidth)
|
||||
self.barFrame:SetHeight(self.settings.barHeight)
|
||||
|
||||
|
||||
if not (self.barFrame.bar) then
|
||||
@ -203,8 +193,8 @@ end
|
||||
|
||||
|
||||
function IceBarElement.prototype:CreateTexts()
|
||||
self.frame.bottomUpperText = self:FontFactory(nil, self.settings.barFontSize, nil, self.frame.bottomUpperText)
|
||||
self.frame.bottomLowerText = self:FontFactory(nil, self.settings.barFontSize, nil, self.frame.bottomLowerText)
|
||||
self.frame.bottomUpperText = self:FontFactory(self.settings.barFontBold, self.settings.barFontSize, nil, self.frame.bottomUpperText)
|
||||
self.frame.bottomLowerText = self:FontFactory(self.settings.barFontBold, self.settings.barFontSize, nil, self.frame.bottomLowerText)
|
||||
|
||||
self.frame.bottomUpperText:SetWidth(80)
|
||||
self.frame.bottomLowerText:SetWidth(120)
|
||||
@ -232,10 +222,10 @@ function IceBarElement.prototype:CreateTexts()
|
||||
local parentPoint = self:Flip(self.moduleSettings.side)
|
||||
|
||||
|
||||
local offx = 2
|
||||
local offx = 0
|
||||
-- adjust offset for bars where text is aligned to the outer side
|
||||
if (self.moduleSettings.offset <= 1) then
|
||||
offx = IceBarElement.BarProportion * self.width - offx
|
||||
offx = self.settings.barProportion * self.settings.barWidth - offx
|
||||
end
|
||||
|
||||
|
||||
@ -248,6 +238,18 @@ function IceBarElement.prototype:CreateTexts()
|
||||
|
||||
self.frame.bottomUpperText:SetPoint("TOP"..ownPoint , self.frame, "BOTTOM"..parentPoint, offx, -1)
|
||||
self.frame.bottomLowerText:SetPoint("TOP"..ownPoint , self.frame, "BOTTOM"..parentPoint, offx, -15)
|
||||
|
||||
if (self.settings.textVisible["upper"]) then
|
||||
self.frame.bottomUpperText:Show()
|
||||
else
|
||||
self.frame.bottomUpperText:Hide()
|
||||
end
|
||||
|
||||
if (self.settings.textVisible["lower"]) then
|
||||
self.frame.bottomLowerText:Show()
|
||||
else
|
||||
self.frame.bottomLowerText:Hide()
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@ -273,7 +275,8 @@ function IceBarElement.prototype:UpdateBar(scale, color, alpha)
|
||||
alpha = alpha or 1
|
||||
self.frame:SetAlpha(alpha)
|
||||
|
||||
self.frame:SetStatusBarColor(self:GetColor(color, self.alpha))
|
||||
local c = self.settings.backgroundColor
|
||||
self.frame:SetStatusBarColor(c.r, c.g, c.b, self.settings.alphabg)
|
||||
|
||||
self.barFrame:SetStatusBarColor(self:GetColor(color))
|
||||
|
||||
@ -284,6 +287,10 @@ end
|
||||
|
||||
-- Bottom line 1
|
||||
function IceBarElement.prototype:SetBottomText1(text, color)
|
||||
if not (self.settings.textVisible["upper"]) and not (self.moduleSettings.alwaysShowText) then
|
||||
return
|
||||
end
|
||||
|
||||
if not (color) then
|
||||
color = "text"
|
||||
end
|
||||
@ -309,6 +316,10 @@ end
|
||||
|
||||
-- Bottom line 2
|
||||
function IceBarElement.prototype:SetBottomText2(text, color, alpha)
|
||||
if not (self.settings.textVisible["lower"]) and not (self.moduleSettings.alwaysShowText) then
|
||||
return
|
||||
end
|
||||
|
||||
if not (color) then
|
||||
color = "text"
|
||||
end
|
||||
@ -341,10 +352,8 @@ end
|
||||
function IceBarElement.prototype:Update()
|
||||
if (self.combat) then
|
||||
self.alpha = self.settings.alphaic
|
||||
self.backgroundAlpha = IceBarElement.BackgroundAlpha
|
||||
else
|
||||
self.alpha = self.settings.alphaooc
|
||||
self.backgroundAlpha = IceBarElement.BackgroundAlpha
|
||||
end
|
||||
end
|
||||
|
||||
|
148
IceCore.lua
148
IceCore.lua
@ -14,7 +14,7 @@ IceCore.prototype.settings = nil
|
||||
IceCore.prototype.IceHUDFrame = nil
|
||||
IceCore.prototype.elements = {}
|
||||
IceCore.prototype.enabled = nil
|
||||
|
||||
IceCore.prototype.presets = {}
|
||||
|
||||
-- Constructor --
|
||||
function IceCore.prototype:init()
|
||||
@ -32,17 +32,28 @@ function IceCore.prototype:init()
|
||||
|
||||
|
||||
-- DEFAULT SETTINGS
|
||||
local defaultPreset = "RoundBar"
|
||||
local defaults = {
|
||||
gap = 150,
|
||||
verticalPos = -150,
|
||||
scale = 1,
|
||||
alphaooc = 0.3,
|
||||
alphaic = 0.6,
|
||||
alphabg = 0.2,
|
||||
backgroundColor = {r = 0.2, g = 0.2, b = 0.2},
|
||||
lockTextAlpha = true,
|
||||
barTexture = "Bar",
|
||||
barFontSize = 13,
|
||||
textVisible = {upper = true, lower = true},
|
||||
barPreset = defaultPreset,
|
||||
debug = false
|
||||
}
|
||||
|
||||
self:LoadPresets()
|
||||
for k, v in pairs(self.presets[defaultPreset]) do
|
||||
defaults[k] = v
|
||||
end
|
||||
|
||||
-- get default settings from the modules
|
||||
defaults.modules = {}
|
||||
for i = 1, table.getn(self.elements) do
|
||||
@ -158,6 +169,7 @@ end
|
||||
function IceCore.prototype:SetGap(value)
|
||||
self.settings.gap = value
|
||||
self.IceHUDFrame:SetWidth(self.settings.gap)
|
||||
self:Redraw()
|
||||
end
|
||||
|
||||
|
||||
@ -189,6 +201,27 @@ function IceCore.prototype:SetAlphaIC(value)
|
||||
end
|
||||
|
||||
|
||||
function IceCore.prototype:GetAlphaBG()
|
||||
return self.settings.alphabg
|
||||
end
|
||||
function IceCore.prototype:SetAlphaBG(value)
|
||||
self.settings.alphabg = value
|
||||
self:Redraw()
|
||||
end
|
||||
|
||||
|
||||
function IceCore.prototype:GetBackgroundColor()
|
||||
local c = self.settings.backgroundColor
|
||||
return c.r, c.g, c.b
|
||||
end
|
||||
function IceCore.prototype:SetBackgroundColor(r, g, b)
|
||||
self.settings.backgroundColor.r = r
|
||||
self.settings.backgroundColor.g = g
|
||||
self.settings.backgroundColor.b = b
|
||||
self:Redraw()
|
||||
end
|
||||
|
||||
|
||||
function IceCore.prototype:GetLockTextAlpha()
|
||||
return self.settings.lockTextAlpha
|
||||
end
|
||||
@ -207,6 +240,24 @@ function IceCore.prototype:SetBarFontSize(value)
|
||||
end
|
||||
|
||||
|
||||
function IceCore.prototype:GetBarFontBold()
|
||||
return self.settings.barFontBold
|
||||
end
|
||||
function IceCore.prototype:SetBarFontBold(value)
|
||||
self.settings.barFontBold = value
|
||||
self:Redraw()
|
||||
end
|
||||
|
||||
|
||||
function IceCore.prototype:GetTextVisibility(text)
|
||||
return self.settings.textVisible[text]
|
||||
end
|
||||
function IceCore.prototype:SetTextVisibility(text, value)
|
||||
self.settings.textVisible[text] = value
|
||||
self:Redraw()
|
||||
end
|
||||
|
||||
|
||||
function IceCore.prototype:GetBarTexture()
|
||||
return self.settings.barTexture
|
||||
end
|
||||
@ -215,3 +266,98 @@ function IceCore.prototype:SetBarTexture(value)
|
||||
self:Redraw()
|
||||
end
|
||||
|
||||
|
||||
function IceCore.prototype:GetBarWidth()
|
||||
return self.settings.barWidth
|
||||
end
|
||||
function IceCore.prototype:SetBarWidth(value)
|
||||
self.settings.barWidth = value
|
||||
self:Redraw()
|
||||
end
|
||||
|
||||
|
||||
function IceCore.prototype:GetBarHeight()
|
||||
return self.settings.barHeight
|
||||
end
|
||||
function IceCore.prototype:SetBarHeight(value)
|
||||
self.settings.barHeight = value
|
||||
self:Redraw()
|
||||
end
|
||||
|
||||
|
||||
function IceCore.prototype:GetBarProportion()
|
||||
return self.settings.barProportion
|
||||
end
|
||||
function IceCore.prototype:SetBarProportion(value)
|
||||
self.settings.barProportion = value
|
||||
self:Redraw()
|
||||
end
|
||||
|
||||
|
||||
function IceCore.prototype:GetBarSpace()
|
||||
return self.settings.barSpace
|
||||
end
|
||||
function IceCore.prototype:SetBarSpace(value)
|
||||
self.settings.barSpace = value
|
||||
self:Redraw()
|
||||
end
|
||||
|
||||
|
||||
function IceCore.prototype:GetBarPreset()
|
||||
return self.settings.barPreset
|
||||
end
|
||||
function IceCore.prototype:SetBarPreset(value)
|
||||
self.settings.barPreset = value
|
||||
self:ChangePreset(value)
|
||||
self:Redraw()
|
||||
end
|
||||
function IceCore.prototype:ChangePreset(value)
|
||||
self:SetBarTexture(self.presets[value].barTexture)
|
||||
self:SetBarHeight(self.presets[value].barHeight)
|
||||
self:SetBarWidth(self.presets[value].barWidth)
|
||||
self:SetBarSpace(self.presets[value].barSpace)
|
||||
self:SetBarProportion(self.presets[value].barProportion)
|
||||
end
|
||||
|
||||
|
||||
function IceCore.prototype:GetDebug()
|
||||
return self.settings.debug
|
||||
end
|
||||
function IceCore.prototype:SetDebug(value)
|
||||
self.settings.debug = value
|
||||
IceHUD:SetDebugging(value)
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
-- Presets --
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
function IceCore.prototype:LoadPresets()
|
||||
self.presets["Bar"] = {
|
||||
barTexture = "Bar",
|
||||
barWidth = 63,
|
||||
barHeight = 150,
|
||||
barProportion = 0.34,
|
||||
barSpace = 4,
|
||||
}
|
||||
|
||||
self.presets["HiBar"] = {
|
||||
barTexture = "HiBar",
|
||||
barWidth = 63,
|
||||
barHeight = 150,
|
||||
barProportion = 0.34,
|
||||
barSpace = 4,
|
||||
}
|
||||
|
||||
self.presets["RoundBar"] = {
|
||||
barTexture = "RoundBar",
|
||||
barWidth = 155,
|
||||
barHeight = 220,
|
||||
barProportion = 0.14,
|
||||
barSpace = 1,
|
||||
}
|
||||
end
|
||||
|
||||
|
@ -174,8 +174,11 @@ end
|
||||
|
||||
|
||||
function IceElement.prototype:FontFactory(weight, size, frame, font)
|
||||
weight = weight or ""
|
||||
local fontFile = IceHUD.Location .. "\\fonts\\Calibri" .. weight ..".ttf"
|
||||
local weightString = ""
|
||||
if (weight) then
|
||||
weightString = "Bold"
|
||||
end
|
||||
local fontFile = IceHUD.Location .. "\\fonts\\Calibri" .. weightString ..".ttf"
|
||||
|
||||
if not (frame) then
|
||||
frame = self.frame
|
||||
|
246
IceHUD.lua
246
IceHUD.lua
@ -14,6 +14,12 @@ IceHUD.options =
|
||||
order = 10
|
||||
},
|
||||
|
||||
positioningSettings = {
|
||||
type = 'group',
|
||||
name = 'Positioning Settings',
|
||||
desc = 'Settings related to positioning and alpha',
|
||||
order = 11,
|
||||
args = {
|
||||
vpos = {
|
||||
type = 'range',
|
||||
name = 'Vertical position',
|
||||
@ -59,25 +65,19 @@ IceHUD.options =
|
||||
min = 0.5,
|
||||
max = 1.5,
|
||||
step = 0.05,
|
||||
isPercent = true,
|
||||
order = 13,
|
||||
},
|
||||
|
||||
alphaooc = {
|
||||
type = 'range',
|
||||
name = 'Alpha OOC',
|
||||
desc = 'Bar alpha Out Of Combat',
|
||||
get = function()
|
||||
return IceHUD.IceCore:GetAlphaOOC()
|
||||
end,
|
||||
set = function(v)
|
||||
IceHUD.IceCore:SetAlphaOOC(v)
|
||||
end,
|
||||
min = 0,
|
||||
max = 1,
|
||||
step = 0.05,
|
||||
order = 14,
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
alphaSettings = {
|
||||
type = 'group',
|
||||
name = 'Transparency Settings',
|
||||
desc = 'Settings for bar transparencies',
|
||||
order = 12,
|
||||
args = {
|
||||
alphaic = {
|
||||
type = 'range',
|
||||
name = 'Alpha IC',
|
||||
@ -91,7 +91,8 @@ IceHUD.options =
|
||||
min = 0,
|
||||
max = 1,
|
||||
step = 0.05,
|
||||
order = 15
|
||||
isPercent = true,
|
||||
order = 14,
|
||||
},
|
||||
|
||||
alphaooc = {
|
||||
@ -107,22 +108,48 @@ IceHUD.options =
|
||||
min = 0,
|
||||
max = 1,
|
||||
step = 0.05,
|
||||
isPercent = true,
|
||||
order = 15,
|
||||
},
|
||||
|
||||
alphabg = {
|
||||
type = 'range',
|
||||
name = 'Background Alpha',
|
||||
desc = 'Background alpha for bars',
|
||||
get = function()
|
||||
return IceHUD.IceCore:GetAlphaBG()
|
||||
end,
|
||||
set = function(v)
|
||||
IceHUD.IceCore:SetAlphaBG(v)
|
||||
end,
|
||||
min = 0,
|
||||
max = 1,
|
||||
step = 0.05,
|
||||
isPercent = true,
|
||||
order = 16,
|
||||
},
|
||||
|
||||
lockFontAlpha = {
|
||||
type = "toggle",
|
||||
name = "Lock Bar Text Alpha",
|
||||
desc = "Lock Bar Text Alpha",
|
||||
backgroundColor = {
|
||||
type = 'color',
|
||||
name = 'Background Color',
|
||||
desc = 'Background Color',
|
||||
get = function()
|
||||
return IceHUD.IceCore:GetLockTextAlpha()
|
||||
return IceHUD.IceCore:GetBackgroundColor()
|
||||
end,
|
||||
set = function(value)
|
||||
IceHUD.IceCore:SetLockTextAlpha(value)
|
||||
set = function(r, g, b)
|
||||
IceHUD.IceCore:SetBackgroundColor(r, g, b)
|
||||
end,
|
||||
order = 17
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
textSettings = {
|
||||
type = 'group',
|
||||
name = 'Text Settings',
|
||||
desc = 'Settings related to texts',
|
||||
order = 15,
|
||||
args = {
|
||||
fontsize = {
|
||||
type = 'range',
|
||||
name = 'Bar Font Size',
|
||||
@ -136,7 +163,89 @@ IceHUD.options =
|
||||
min = 8,
|
||||
max = 20,
|
||||
step = 1,
|
||||
order = 18
|
||||
order = 11
|
||||
},
|
||||
|
||||
fontBold = {
|
||||
type = 'toggle',
|
||||
name = 'Bar Font Bold',
|
||||
desc = 'Bar Font Bold',
|
||||
get = function()
|
||||
return IceHUD.IceCore:GetBarFontBold()
|
||||
end,
|
||||
set = function(v)
|
||||
IceHUD.IceCore:SetBarFontBold(v)
|
||||
end,
|
||||
order = 12
|
||||
},
|
||||
|
||||
lockFontAlpha = {
|
||||
type = "toggle",
|
||||
name = "Lock Bar Text Alpha",
|
||||
desc = "Lock Bar Text Alpha",
|
||||
get = function()
|
||||
return IceHUD.IceCore:GetLockTextAlpha()
|
||||
end,
|
||||
set = function(value)
|
||||
IceHUD.IceCore:SetLockTextAlpha(value)
|
||||
end,
|
||||
order = 13
|
||||
},
|
||||
|
||||
upperTextVisible = {
|
||||
type = 'toggle',
|
||||
name = 'Upper text visible',
|
||||
desc = 'Toggle upper text visibility',
|
||||
get = function()
|
||||
return IceHUD.IceCore:GetTextVisibility("upper")
|
||||
end,
|
||||
set = function(v)
|
||||
IceHUD.IceCore:SetTextVisibility("upper", v)
|
||||
end,
|
||||
order = 14
|
||||
},
|
||||
|
||||
lowerTextVisible = {
|
||||
type = 'toggle',
|
||||
name = 'Lower text visible',
|
||||
desc = 'Toggle lower text visibility',
|
||||
get = function()
|
||||
return IceHUD.IceCore:GetTextVisibility("lower")
|
||||
end,
|
||||
set = function(v)
|
||||
IceHUD.IceCore:SetTextVisibility("lower", v)
|
||||
end,
|
||||
order = 15
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
barSettings = {
|
||||
type = 'group',
|
||||
name = 'Bar Settings',
|
||||
desc = 'Settings related to bars',
|
||||
order = 20,
|
||||
args = {
|
||||
barPresets = {
|
||||
type = 'text',
|
||||
name = 'Presets',
|
||||
desc = 'Predefined settings for different bars',
|
||||
get = function()
|
||||
return IceHUD.IceCore:GetBarPreset()
|
||||
end,
|
||||
set = function(value)
|
||||
IceHUD.IceCore:SetBarPreset(value)
|
||||
end,
|
||||
validate = { "Bar", "HiBar", "RoundBar" },
|
||||
order = 9
|
||||
},
|
||||
|
||||
|
||||
headerBarAdvancedBlank = { type = 'header', name = " ", order = 10 },
|
||||
headerBarAdvanced = {
|
||||
type = 'header',
|
||||
name = "Advanced Bar Settings",
|
||||
order = 10
|
||||
},
|
||||
|
||||
barTexture = {
|
||||
@ -149,8 +258,75 @@ IceHUD.options =
|
||||
set = function(value)
|
||||
IceHUD.IceCore:SetBarTexture(value)
|
||||
end,
|
||||
validate = { "Bar", "HiBar" },
|
||||
order = 19
|
||||
validate = { "Bar", "HiBar", "RoundBar" },
|
||||
order = 11
|
||||
},
|
||||
|
||||
barWidth = {
|
||||
type = 'range',
|
||||
name = 'Bar Width',
|
||||
desc = 'Bar texture width (not the actual bar!)',
|
||||
get = function()
|
||||
return IceHUD.IceCore:GetBarWidth()
|
||||
end,
|
||||
set = function(v)
|
||||
IceHUD.IceCore:SetBarWidth(v)
|
||||
end,
|
||||
min = 20,
|
||||
max = 200,
|
||||
step = 1,
|
||||
order = 12
|
||||
},
|
||||
|
||||
barHeight = {
|
||||
type = 'range',
|
||||
name = 'Bar Height',
|
||||
desc = 'Bar texture height (not the actual bar!)',
|
||||
get = function()
|
||||
return IceHUD.IceCore:GetBarHeight()
|
||||
end,
|
||||
set = function(v)
|
||||
IceHUD.IceCore:SetBarHeight(v)
|
||||
end,
|
||||
min = 100,
|
||||
max = 300,
|
||||
step = 1,
|
||||
order = 13
|
||||
},
|
||||
|
||||
barProportion = {
|
||||
type = 'range',
|
||||
name = 'Bar Proportion',
|
||||
desc = 'Determines the bar width compared to the whole texture width',
|
||||
get = function()
|
||||
return IceHUD.IceCore:GetBarProportion()
|
||||
end,
|
||||
set = function(v)
|
||||
IceHUD.IceCore:SetBarProportion(v)
|
||||
end,
|
||||
min = 0.01,
|
||||
max = 0.5,
|
||||
step = 0.01,
|
||||
isPercent = true,
|
||||
order = 14
|
||||
},
|
||||
|
||||
barSpace = {
|
||||
type = 'range',
|
||||
name = 'Bar Space',
|
||||
desc = 'Space between bars on the same side',
|
||||
get = function()
|
||||
return IceHUD.IceCore:GetBarSpace()
|
||||
end,
|
||||
set = function(v)
|
||||
IceHUD.IceCore:SetBarSpace(v)
|
||||
end,
|
||||
min = -10,
|
||||
max = 30,
|
||||
step = 1,
|
||||
order = 15
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@ -205,6 +381,19 @@ IceHUD.options =
|
||||
order = 92
|
||||
},
|
||||
|
||||
debug = {
|
||||
type = "toggle",
|
||||
name = "Debugging",
|
||||
desc = "Enable/disable debug messages",
|
||||
get = function()
|
||||
return IceHUD.IceCore:GetDebug()
|
||||
end,
|
||||
set = function(value)
|
||||
IceHUD.IceCore:SetDebug(value)
|
||||
end,
|
||||
order = 93
|
||||
},
|
||||
|
||||
about = {
|
||||
type = 'execute',
|
||||
name = 'About',
|
||||
@ -212,7 +401,7 @@ IceHUD.options =
|
||||
func = function()
|
||||
IceHUD:PrintAddonInfo()
|
||||
end,
|
||||
order = 93
|
||||
order = 94
|
||||
},
|
||||
|
||||
endSpace = {
|
||||
@ -258,5 +447,6 @@ function IceHUD:OnEnable()
|
||||
self:Debug("IceHUD:OnEnable()")
|
||||
|
||||
self.IceCore:Enable()
|
||||
self:SetDebugging(self.IceCore:GetDebug())
|
||||
end
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
## Name: IceHUD
|
||||
## Title: IceHUD |cff7fff7f -Ace2-|r
|
||||
## Notes: Another HUD mod
|
||||
## Version: 0.3.3 ($Revision$)
|
||||
## Version: 0.4 ($Revision$)
|
||||
## SavedVariables: IceCoreDB
|
||||
## OptionalDeps: FuBar_ToFu, DruidBar, SoleManax, MobHealth
|
||||
## X-Category: UnitFrame
|
||||
|
@ -35,15 +35,35 @@ function CastBar.prototype:GetDefaultSettings()
|
||||
local settings = CastBar.super.prototype.GetDefaultSettings(self)
|
||||
settings["side"] = IceCore.Side.Left
|
||||
settings["offset"] = 0
|
||||
settings["alwaysShowText"] = true
|
||||
return settings
|
||||
end
|
||||
|
||||
|
||||
-- OVERRIDE
|
||||
function CastBar.prototype:GetOptions()
|
||||
local opts = CastBar.super.prototype.GetOptions(self)
|
||||
opts["alwaysShowText"] =
|
||||
{
|
||||
type = 'toggle',
|
||||
name = 'Always Show Text',
|
||||
desc = 'Overrides possible text hiding option',
|
||||
get = function()
|
||||
return self.moduleSettings.alwaysShowText
|
||||
end,
|
||||
set = function(value)
|
||||
self.moduleSettings.alwaysShowText = value
|
||||
self:Redraw()
|
||||
end,
|
||||
order = 50
|
||||
}
|
||||
return opts
|
||||
end
|
||||
|
||||
|
||||
function CastBar.prototype:Enable()
|
||||
CastBar.super.prototype.Enable(self)
|
||||
|
||||
self.frame.bottomUpperText:SetWidth(180)
|
||||
|
||||
self:RegisterEvent("SPELLCAST_START", "CastStart")
|
||||
self:RegisterEvent("SPELLCAST_STOP", "CastStop")
|
||||
self:RegisterEvent("SPELLCAST_FAILED", "CastFailed")
|
||||
@ -80,13 +100,23 @@ end
|
||||
function CastBar.prototype:Redraw()
|
||||
CastBar.super.prototype.Redraw(self)
|
||||
|
||||
self.frame.bottomUpperText:SetWidth(180)
|
||||
if (self.moduleSettings.alwaysShowText) then
|
||||
self.frame.bottomUpperText:Show()
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
-- 'Protected' methods --------------------------------------------------------
|
||||
|
||||
-- OVERRIDE
|
||||
function CastBar.prototype:CreateFrame()
|
||||
CastBar.super.prototype.CreateFrame(self)
|
||||
|
||||
self.frame.bottomUpperText:SetWidth(self.settings.gap + 30)
|
||||
end
|
||||
|
||||
|
||||
function CastBar.prototype:OnUpdate()
|
||||
local taken = GetTime() - self.startTime
|
||||
|
@ -30,6 +30,7 @@ function PetHealth.prototype:GetOptions()
|
||||
min = 0.2,
|
||||
max = 1,
|
||||
step = 0.05,
|
||||
isPercent = true,
|
||||
get = function()
|
||||
return self.moduleSettings.scale
|
||||
end,
|
||||
|
@ -24,6 +24,7 @@ function PetMana.prototype:GetOptions()
|
||||
min = 0.2,
|
||||
max = 1,
|
||||
step = 0.05,
|
||||
isPercent = true,
|
||||
get = function()
|
||||
return self.moduleSettings.scale
|
||||
end,
|
||||
|
@ -85,6 +85,14 @@ function PlayerMana.prototype:Enable()
|
||||
end
|
||||
|
||||
|
||||
-- OVERRIDE
|
||||
function PlayerMana.prototype:Redraw()
|
||||
PlayerMana.super.prototype.Redraw(self)
|
||||
|
||||
self:CreateTickerFrame()
|
||||
end
|
||||
|
||||
|
||||
function PlayerMana.prototype:ManaType(unit)
|
||||
if (unit ~= self.unit) then
|
||||
return
|
||||
@ -168,12 +176,13 @@ function PlayerMana.prototype:EnergyTick()
|
||||
self.tickStart = now
|
||||
end
|
||||
|
||||
local thisTick = elapsed / 2
|
||||
local x = (thisTick * (self.width - (self.width * IceBarElement.BarProportion))) + 4
|
||||
local y = thisTick * (self.height - 5)
|
||||
local pos = elapsed / 2
|
||||
local y = pos * (self.settings.barHeight)
|
||||
|
||||
self.tickerFrame:ClearAllPoints()
|
||||
self.tickerFrame:SetPoint("BOTTOMLEFT", self.frame, "BOTTOMLEFT", x, y)
|
||||
|
||||
self.tickerFrame.spark:SetTexCoord(0, 1, 1-pos-0.01, 1-pos)
|
||||
|
||||
self.tickerFrame:SetPoint("BOTTOMLEFT", self.frame, "BOTTOMLEFT", 0, y)
|
||||
end
|
||||
|
||||
|
||||
@ -183,14 +192,15 @@ function PlayerMana.prototype:CreateTickerFrame()
|
||||
end
|
||||
|
||||
self.tickerFrame:SetFrameStrata("BACKGROUND")
|
||||
self.tickerFrame:SetWidth(19)
|
||||
self.tickerFrame:SetHeight(1)
|
||||
self.tickerFrame:SetWidth(self.settings.barWidth)
|
||||
self.tickerFrame:SetHeight(self.settings.barHeight)
|
||||
|
||||
if not (self.tickerFrame.spark) then
|
||||
self.tickerFrame.spark = self.tickerFrame:CreateTexture(nil, "BACKGROUND")
|
||||
self.tickerFrame:Hide()
|
||||
end
|
||||
|
||||
self.tickerFrame.spark:SetTexture(self:GetColor("playerEnergy", 1))
|
||||
self.tickerFrame.spark:SetTexture(IceBarElement.TexturePath .. self.settings.barTexture)
|
||||
self.tickerFrame.spark:SetBlendMode("ADD")
|
||||
self.tickerFrame.spark:ClearAllPoints()
|
||||
self.tickerFrame.spark:SetAllPoints(self.tickerFrame)
|
||||
@ -198,7 +208,8 @@ function PlayerMana.prototype:CreateTickerFrame()
|
||||
self.tickerFrame:SetStatusBarTexture(self.tickerFrame.spark)
|
||||
self.tickerFrame:SetStatusBarColor(self:GetColor("playerEnergy", self.moduleSettings.tickerAlpha))
|
||||
|
||||
self.tickerFrame:Hide()
|
||||
self.tickerFrame:ClearAllPoints()
|
||||
self.tickerFrame:SetPoint("BOTTOMLEFT", self.frame, "BOTTOMLEFT", 0, 0)
|
||||
end
|
||||
|
||||
|
||||
|
BIN
textures/Bar.blp
BIN
textures/Bar.blp
Binary file not shown.
BIN
textures/BarBG.blp
Normal file
BIN
textures/BarBG.blp
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
textures/RoundBar.blp
Normal file
BIN
textures/RoundBar.blp
Normal file
Binary file not shown.
BIN
textures/RoundBarBG.blp
Normal file
BIN
textures/RoundBarBG.blp
Normal file
Binary file not shown.
Reference in New Issue
Block a user