mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 06:40:13 -05:00
Version 0.3
- More configuration options - Added another texture option for bars - /icehud now opens Dewdrop menu directly - Rogue/cat energy ticker
This commit is contained in:
@ -5,9 +5,10 @@ IceBarElement.virtual = true
|
|||||||
|
|
||||||
IceBarElement.BackgroundAlpha = 0.25
|
IceBarElement.BackgroundAlpha = 0.25
|
||||||
|
|
||||||
IceBarElement.BarTexture = IceHUD.Location .. "\\textures\\HiBar"
|
IceBarElement.TexturePath = IceHUD.Location .. "\\textures\\"
|
||||||
IceBarElement.BackgroundTexture = IceHUD.Location .. "\\textures\\HiBarBG"
|
IceBarElement.BackgroundTexture = IceHUD.Location .. "\\textures\\HiBarBG"
|
||||||
IceBarElement.BarProportion = 0.25 -- 0.18
|
IceBarElement.BarProportion = 0.35
|
||||||
|
IceBarElement.BarTextureWidth = 128
|
||||||
|
|
||||||
IceBarElement.prototype.barFrame = nil
|
IceBarElement.prototype.barFrame = nil
|
||||||
IceBarElement.prototype.width = nil
|
IceBarElement.prototype.width = nil
|
||||||
@ -69,6 +70,7 @@ function IceBarElement.prototype:GetOptions()
|
|||||||
validate = { "Left", "Right" },
|
validate = { "Left", "Right" },
|
||||||
order = 30
|
order = 30
|
||||||
}
|
}
|
||||||
|
|
||||||
opts["offset"] =
|
opts["offset"] =
|
||||||
{
|
{
|
||||||
type = 'range',
|
type = 'range',
|
||||||
@ -91,6 +93,13 @@ function IceBarElement.prototype:GetOptions()
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function IceBarElement.prototype:GetDefaultSettings()
|
||||||
|
local defaults = IceBarElement.super.prototype.GetDefaultSettings(self)
|
||||||
|
defaults["barFontSize"] = 13
|
||||||
|
return defaults
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
-- OVERRIDE
|
-- OVERRIDE
|
||||||
function IceBarElement.prototype:Redraw()
|
function IceBarElement.prototype:Redraw()
|
||||||
IceBarElement.super.prototype.Redraw(self)
|
IceBarElement.super.prototype.Redraw(self)
|
||||||
@ -157,7 +166,7 @@ function IceBarElement.prototype:CreateBackground()
|
|||||||
|
|
||||||
-- ofxx = (bar width) + (extra space in between the bars)
|
-- ofxx = (bar width) + (extra space in between the bars)
|
||||||
local offx = (IceBarElement.BarProportion * self.width * self.moduleSettings.offset)
|
local offx = (IceBarElement.BarProportion * self.width * self.moduleSettings.offset)
|
||||||
+ (self.moduleSettings.offset * 10)
|
+ (self.moduleSettings.offset * 5)
|
||||||
if (self.moduleSettings.side == IceCore.Side.Left) then
|
if (self.moduleSettings.side == IceCore.Side.Left) then
|
||||||
offx = offx * -1
|
offx = offx * -1
|
||||||
end
|
end
|
||||||
@ -182,7 +191,7 @@ function IceBarElement.prototype:CreateBar()
|
|||||||
self.barFrame.bar = self.frame:CreateTexture(nil, "BACKGROUND")
|
self.barFrame.bar = self.frame:CreateTexture(nil, "BACKGROUND")
|
||||||
end
|
end
|
||||||
|
|
||||||
self.barFrame.bar:SetTexture(IceBarElement.BarTexture)
|
self.barFrame.bar:SetTexture(IceBarElement.TexturePath .. self.settings.barTexture)
|
||||||
self.barFrame.bar:SetAllPoints(self.frame)
|
self.barFrame.bar:SetAllPoints(self.frame)
|
||||||
|
|
||||||
self.barFrame:SetStatusBarTexture(self.barFrame.bar)
|
self.barFrame:SetStatusBarTexture(self.barFrame.bar)
|
||||||
@ -200,12 +209,8 @@ end
|
|||||||
|
|
||||||
|
|
||||||
function IceBarElement.prototype:CreateTexts()
|
function IceBarElement.prototype:CreateTexts()
|
||||||
if not (self.frame.bottomUpperText) then
|
self.frame.bottomUpperText = self:FontFactory(nil, self.settings.barFontSize, nil, self.frame.bottomUpperText)
|
||||||
self.frame.bottomUpperText = self:FontFactory(nil, 13)
|
self.frame.bottomLowerText = self:FontFactory(nil, self.settings.barFontSize, nil, self.frame.bottomLowerText)
|
||||||
end
|
|
||||||
if not (self.frame.bottomLowerText) then
|
|
||||||
self.frame.bottomLowerText = self:FontFactory(nil, 13)
|
|
||||||
end
|
|
||||||
|
|
||||||
self.frame.bottomUpperText:SetWidth(80)
|
self.frame.bottomUpperText:SetWidth(80)
|
||||||
self.frame.bottomLowerText:SetWidth(120)
|
self.frame.bottomLowerText:SetWidth(120)
|
||||||
@ -236,7 +241,7 @@ function IceBarElement.prototype:CreateTexts()
|
|||||||
local offx = 2
|
local offx = 2
|
||||||
-- adjust offset for bars where text is aligned to the outer side
|
-- adjust offset for bars where text is aligned to the outer side
|
||||||
if (self.moduleSettings.offset <= 1) then
|
if (self.moduleSettings.offset <= 1) then
|
||||||
offx = IceBarElement.BarProportion * self.width + 6
|
offx = IceBarElement.BarProportion * self.width - offx
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@ -288,7 +293,22 @@ function IceBarElement.prototype:SetBottomText1(text, color)
|
|||||||
if not (color) then
|
if not (color) then
|
||||||
color = "text"
|
color = "text"
|
||||||
end
|
end
|
||||||
self.frame.bottomUpperText:SetTextColor(self:GetColor(color, 1))
|
|
||||||
|
local alpha = 1
|
||||||
|
if not (self.settings.lockTextAlpha) then
|
||||||
|
-- boost text alpha a bit to make it easier to see
|
||||||
|
if (self.alpha > 0) then
|
||||||
|
alpha = self.alpha + 0.1
|
||||||
|
|
||||||
|
if (alpha > 1) then
|
||||||
|
alpha = 1
|
||||||
|
end
|
||||||
|
else
|
||||||
|
alpha = 0
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
self.frame.bottomUpperText:SetTextColor(self:GetColor(color, alpha))
|
||||||
self.frame.bottomUpperText:SetText(text)
|
self.frame.bottomUpperText:SetText(text)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
57
IceCore.lua
57
IceCore.lua
@ -13,6 +13,7 @@ IceCore.RegisterModule = "IceCore_RegisterModule"
|
|||||||
IceCore.prototype.settings = nil
|
IceCore.prototype.settings = nil
|
||||||
IceCore.prototype.IceHUDFrame = nil
|
IceCore.prototype.IceHUDFrame = nil
|
||||||
IceCore.prototype.elements = {}
|
IceCore.prototype.elements = {}
|
||||||
|
IceCore.prototype.enabled = nil
|
||||||
|
|
||||||
|
|
||||||
-- Constructor --
|
-- Constructor --
|
||||||
@ -22,7 +23,7 @@ function IceCore.prototype:init()
|
|||||||
|
|
||||||
self:RegisterDB("IceCoreDB")
|
self:RegisterDB("IceCoreDB")
|
||||||
|
|
||||||
self.IceHUDFrame = CreateFrame("Frame","IceHUDFrame", WorldFrame)
|
self.IceHUDFrame = CreateFrame("Frame","IceHUDFrame", UIParent)
|
||||||
|
|
||||||
|
|
||||||
-- We are ready to load modules
|
-- We are ready to load modules
|
||||||
@ -36,10 +37,11 @@ function IceCore.prototype:init()
|
|||||||
verticalPos = -150,
|
verticalPos = -150,
|
||||||
scale = 1,
|
scale = 1,
|
||||||
alphaooc = 0.3,
|
alphaooc = 0.3,
|
||||||
alphaic = 0.6
|
alphaic = 0.6,
|
||||||
|
lockTextAlpha = true,
|
||||||
|
barTexture = "Bar",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
-- get default settings from the modules
|
-- get default settings from the modules
|
||||||
defaults.modules = {}
|
defaults.modules = {}
|
||||||
for i = 1, table.getn(self.elements) do
|
for i = 1, table.getn(self.elements) do
|
||||||
@ -47,7 +49,6 @@ function IceCore.prototype:init()
|
|||||||
defaults.modules[name] = self.elements[i]:GetDefaultSettings()
|
defaults.modules[name] = self.elements[i]:GetDefaultSettings()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
self:RegisterDefaults('account', defaults)
|
self:RegisterDefaults('account', defaults)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -65,9 +66,27 @@ function IceCore.prototype:Enable()
|
|||||||
self.elements[i]:Enable()
|
self.elements[i]:Enable()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
self.enabled = true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function IceCore.prototype:Disable()
|
||||||
|
for i = 1, table.getn(self.elements) do
|
||||||
|
if (self.elements[i]:IsEnabled()) then
|
||||||
|
self.elements[i]:Disable()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
self.IceHUDFrame:Hide()
|
||||||
|
self.enabled = false
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function IceCore.prototype:IsEnabled()
|
||||||
|
return self.enabled
|
||||||
|
end
|
||||||
|
|
||||||
function IceCore.prototype:DrawFrame()
|
function IceCore.prototype:DrawFrame()
|
||||||
self.IceHUDFrame:SetFrameStrata("BACKGROUND")
|
self.IceHUDFrame:SetFrameStrata("BACKGROUND")
|
||||||
self.IceHUDFrame:SetWidth(self.settings.gap)
|
self.IceHUDFrame:SetWidth(self.settings.gap)
|
||||||
@ -147,8 +166,7 @@ end
|
|||||||
function IceCore.prototype:SetScale(value)
|
function IceCore.prototype:SetScale(value)
|
||||||
self.settings.scale = value
|
self.settings.scale = value
|
||||||
|
|
||||||
local scale = UIParent:GetScale() * value
|
self.IceHUDFrame:SetScale(value)
|
||||||
self.IceHUDFrame:SetScale(scale)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@ -169,3 +187,30 @@ function IceCore.prototype:SetAlphaIC(value)
|
|||||||
self:Redraw()
|
self:Redraw()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function IceCore.prototype:GetLockTextAlpha()
|
||||||
|
return self.settings.lockTextAlpha
|
||||||
|
end
|
||||||
|
function IceCore.prototype:SetLockTextAlpha(value)
|
||||||
|
self.settings.lockTextAlpha = value
|
||||||
|
self:Redraw()
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function IceCore.prototype:GetBarFontSize()
|
||||||
|
return self.settings.barFontSize
|
||||||
|
end
|
||||||
|
function IceCore.prototype:SetBarFontSize(value)
|
||||||
|
self.settings.barFontSize = value
|
||||||
|
self:Redraw()
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function IceCore.prototype:GetBarTexture()
|
||||||
|
return self.settings.barTexture
|
||||||
|
end
|
||||||
|
function IceCore.prototype:SetBarTexture(value)
|
||||||
|
self.settings.barTexture = value
|
||||||
|
self:Redraw()
|
||||||
|
end
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@ function IceElement.prototype:GetOptions()
|
|||||||
local opts = {}
|
local opts = {}
|
||||||
opts["enabled"] = {
|
opts["enabled"] = {
|
||||||
type = "toggle",
|
type = "toggle",
|
||||||
name = "Enabled",
|
name = "|cff8888ffEnabled|r",
|
||||||
desc = "Enable/disable module",
|
desc = "Enable/disable module",
|
||||||
get = function()
|
get = function()
|
||||||
return self.moduleSettings.enabled
|
return self.moduleSettings.enabled
|
||||||
@ -173,7 +173,7 @@ function IceElement.prototype:GetClassColor(class)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function IceElement.prototype:FontFactory(weight, size, frame)
|
function IceElement.prototype:FontFactory(weight, size, frame, font)
|
||||||
weight = weight or ""
|
weight = weight or ""
|
||||||
local fontFile = IceHUD.Location .. "\\fonts\\Calibri" .. weight ..".ttf"
|
local fontFile = IceHUD.Location .. "\\fonts\\Calibri" .. weight ..".ttf"
|
||||||
|
|
||||||
@ -181,12 +181,17 @@ function IceElement.prototype:FontFactory(weight, size, frame)
|
|||||||
frame = self.frame
|
frame = self.frame
|
||||||
end
|
end
|
||||||
|
|
||||||
local font = frame:CreateFontString()
|
local fontString = nil
|
||||||
font:SetFont(fontFile, size)
|
if not (font) then
|
||||||
font:SetShadowColor(0, 0, 0, 1)
|
fontString = frame:CreateFontString()
|
||||||
font:SetShadowOffset(1, -1)
|
else
|
||||||
|
fontString = font
|
||||||
|
end
|
||||||
|
fontString:SetFont(fontFile, size)
|
||||||
|
fontString:SetShadowColor(0, 0, 0, 1)
|
||||||
|
fontString:SetShadowOffset(1, -1)
|
||||||
|
|
||||||
return font
|
return fontString
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
133
IceHUD.lua
133
IceHUD.lua
@ -3,7 +3,6 @@ IceHUD = AceLibrary("AceAddon-2.0"):new("AceConsole-2.0", "AceDebug-2.0")
|
|||||||
IceHUD.dewdrop = AceLibrary("Dewdrop-2.0")
|
IceHUD.dewdrop = AceLibrary("Dewdrop-2.0")
|
||||||
|
|
||||||
IceHUD.Location = "Interface\\AddOns\\IceHUD"
|
IceHUD.Location = "Interface\\AddOns\\IceHUD"
|
||||||
IceHUD.temp = nil
|
|
||||||
IceHUD.options =
|
IceHUD.options =
|
||||||
{
|
{
|
||||||
type = 'group',
|
type = 'group',
|
||||||
@ -14,6 +13,7 @@ IceHUD.options =
|
|||||||
name = "General Settings",
|
name = "General Settings",
|
||||||
order = 10
|
order = 10
|
||||||
},
|
},
|
||||||
|
|
||||||
vpos = {
|
vpos = {
|
||||||
type = 'range',
|
type = 'range',
|
||||||
name = 'Vertical position',
|
name = 'Vertical position',
|
||||||
@ -94,7 +94,68 @@ IceHUD.options =
|
|||||||
order = 15
|
order = 15
|
||||||
},
|
},
|
||||||
|
|
||||||
|
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 = 16,
|
||||||
|
},
|
||||||
|
|
||||||
|
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 = 17
|
||||||
|
},
|
||||||
|
|
||||||
|
fontsize = {
|
||||||
|
type = 'range',
|
||||||
|
name = 'Bar Font Size',
|
||||||
|
desc = 'Bar Font Size',
|
||||||
|
get = function()
|
||||||
|
return IceHUD.IceCore:GetBarFontSize()
|
||||||
|
end,
|
||||||
|
set = function(v)
|
||||||
|
IceHUD.IceCore:SetBarFontSize(v)
|
||||||
|
end,
|
||||||
|
min = 8,
|
||||||
|
max = 20,
|
||||||
|
step = 1,
|
||||||
|
order = 18
|
||||||
|
},
|
||||||
|
|
||||||
|
barTexture = {
|
||||||
|
type = 'text',
|
||||||
|
name = 'Bar Texture',
|
||||||
|
desc = 'IceHUD Bar Texture',
|
||||||
|
get = function()
|
||||||
|
return IceHUD.IceCore:GetBarTexture()
|
||||||
|
end,
|
||||||
|
set = function(value)
|
||||||
|
IceHUD.IceCore:SetBarTexture(value)
|
||||||
|
end,
|
||||||
|
validate = { "Bar", "HiBar" },
|
||||||
|
order = 19
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
headerModulesBlank = { type = 'header', name = ' ', order = 40 },
|
||||||
headerModules = {
|
headerModules = {
|
||||||
type = 'header',
|
type = 'header',
|
||||||
name = 'Module Settings',
|
name = 'Module Settings',
|
||||||
@ -110,13 +171,30 @@ IceHUD.options =
|
|||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
headerOtherBlank = { type = 'header', name = ' ', order = 90 },
|
||||||
headerOther = {
|
headerOther = {
|
||||||
type = 'header',
|
type = 'header',
|
||||||
name = 'Other Settings',
|
name = 'Other',
|
||||||
order = 90
|
order = 90
|
||||||
},
|
},
|
||||||
|
|
||||||
|
enabled = {
|
||||||
|
type = "toggle",
|
||||||
|
name = "|cff8888ffEnabled|r",
|
||||||
|
desc = "Enable/disable IceHUD",
|
||||||
|
get = function()
|
||||||
|
return IceHUD.IceCore:IsEnabled()
|
||||||
|
end,
|
||||||
|
set = function(value)
|
||||||
|
if (value) then
|
||||||
|
IceHUD.IceCore:Enable()
|
||||||
|
else
|
||||||
|
IceHUD.IceCore:Disable()
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
order = 91
|
||||||
|
},
|
||||||
|
|
||||||
reset = {
|
reset = {
|
||||||
type = 'execute',
|
type = 'execute',
|
||||||
name = '|cffff0000Reset|r',
|
name = '|cffff0000Reset|r',
|
||||||
@ -124,29 +202,45 @@ IceHUD.options =
|
|||||||
func = function()
|
func = function()
|
||||||
IceHUD.IceCore:ResetSettings()
|
IceHUD.IceCore:ResetSettings()
|
||||||
end,
|
end,
|
||||||
order = 91
|
order = 92
|
||||||
},
|
},
|
||||||
|
|
||||||
dewdrop = {
|
about = {
|
||||||
type = 'execute',
|
type = 'execute',
|
||||||
name = 'dewdrop',
|
name = 'About',
|
||||||
desc = 'Open Dewdrop menu for commands',
|
desc = "Prints info about IceHUD",
|
||||||
func = function()
|
func = function()
|
||||||
if not (IceHUD.dewdrop:IsRegistered(IceHUD.IceCore.IceHUDFrame)) then
|
IceHUD:PrintAddonInfo()
|
||||||
IceHUD.dewdrop:Register(IceHUD.IceCore.IceHUDFrame,
|
|
||||||
'children', IceHUD.options,
|
|
||||||
'point', "BOTTOMLEFT",
|
|
||||||
'relativePoint', "TOPLEFT",
|
|
||||||
'dontHook', true
|
|
||||||
)
|
|
||||||
end
|
|
||||||
IceHUD.dewdrop:Open(IceHUD.IceCore.IceHUDFrame)
|
|
||||||
end,
|
end,
|
||||||
order = 92
|
order = 93
|
||||||
}
|
},
|
||||||
|
|
||||||
|
endSpace = {
|
||||||
|
type = 'header',
|
||||||
|
name = ' ',
|
||||||
|
order = 1000
|
||||||
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IceHUD.slashMenu =
|
||||||
|
{
|
||||||
|
type = 'execute',
|
||||||
|
func = function()
|
||||||
|
if not (IceHUD.dewdrop:IsRegistered(IceHUD.IceCore.IceHUDFrame)) then
|
||||||
|
IceHUD.dewdrop:Register(IceHUD.IceCore.IceHUDFrame,
|
||||||
|
'children', IceHUD.options,
|
||||||
|
'point', "BOTTOMLEFT",
|
||||||
|
'relativePoint', "TOPLEFT",
|
||||||
|
'dontHook', true
|
||||||
|
)
|
||||||
|
end
|
||||||
|
IceHUD.dewdrop:Open(IceHUD.IceCore.IceHUDFrame)
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function IceHUD:OnInitialize()
|
function IceHUD:OnInitialize()
|
||||||
self:SetDebugging(false)
|
self:SetDebugging(false)
|
||||||
@ -156,7 +250,7 @@ function IceHUD:OnInitialize()
|
|||||||
|
|
||||||
self.options.args.modules.args = self.IceCore:GetModuleOptions()
|
self.options.args.modules.args = self.IceCore:GetModuleOptions()
|
||||||
|
|
||||||
self:RegisterChatCommand({ "/icehud" }, IceHUD.options)
|
self:RegisterChatCommand({ "/icehud" }, IceHUD.slashMenu)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@ -166,4 +260,3 @@ function IceHUD:OnEnable()
|
|||||||
self.IceCore:Enable()
|
self.IceCore:Enable()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@ -3,13 +3,14 @@
|
|||||||
## Name: IceHUD
|
## Name: IceHUD
|
||||||
## Title: IceHUD |cff7fff7f -Ace2-|r
|
## Title: IceHUD |cff7fff7f -Ace2-|r
|
||||||
## Notes: Another HUD mod
|
## Notes: Another HUD mod
|
||||||
## Version: 0.2.1 ($Revision$)
|
## Version: 0.3 ($Revision$)
|
||||||
## SavedVariables: IceCoreDB
|
## SavedVariables: IceCoreDB
|
||||||
|
## OptionalDeps: FuBar_ToFu, DruidBar, SoleManax
|
||||||
## X-Category: UnitFrame
|
## X-Category: UnitFrame
|
||||||
## X-Date: $Date$
|
## X-Date: $Date$
|
||||||
## X-Website: http://www.wowace.com/forums/index.php/topic,1705.0.html
|
## X-Website: http://www.wowace.com/forums/index.php/topic,1705.0.html
|
||||||
|
|
||||||
|
# Libraries
|
||||||
libs\AceLibrary\AceLibrary.lua
|
libs\AceLibrary\AceLibrary.lua
|
||||||
libs\AceOO-2.0\AceOO-2.0.lua
|
libs\AceOO-2.0\AceOO-2.0.lua
|
||||||
libs\AceDB-2.0\AceDB-2.0.lua
|
libs\AceDB-2.0\AceDB-2.0.lua
|
||||||
@ -21,13 +22,14 @@ libs\AceAddon-2.0\AceAddon-2.0.lua
|
|||||||
libs\Metrognome-2.0\Metrognome-2.0.lua
|
libs\Metrognome-2.0\Metrognome-2.0.lua
|
||||||
libs\Dewdrop-2.0\Dewdrop-2.0.lua
|
libs\Dewdrop-2.0\Dewdrop-2.0.lua
|
||||||
|
|
||||||
|
# IceHUD core functionality
|
||||||
IceCore.lua
|
IceCore.lua
|
||||||
IceHUD.lua
|
IceHUD.lua
|
||||||
|
|
||||||
IceElement.lua
|
IceElement.lua
|
||||||
IceBarElement.lua
|
IceBarElement.lua
|
||||||
IceUnitBar.lua
|
IceUnitBar.lua
|
||||||
|
|
||||||
|
# IceHUD modules
|
||||||
modules\PlayerHealth.lua
|
modules\PlayerHealth.lua
|
||||||
modules\PlayerMana.lua
|
modules\PlayerMana.lua
|
||||||
modules\TargetHealth.lua
|
modules\TargetHealth.lua
|
||||||
@ -39,3 +41,4 @@ modules\TargetInfo.lua
|
|||||||
modules\TargetOfTarget.lua
|
modules\TargetOfTarget.lua
|
||||||
modules\CastBar.lua
|
modules\CastBar.lua
|
||||||
modules\MirrorBar.lua
|
modules\MirrorBar.lua
|
||||||
|
modules\TimerBar.lua
|
||||||
|
@ -57,7 +57,6 @@ function CastBar.prototype:Enable()
|
|||||||
|
|
||||||
self.frame:Hide()
|
self.frame:Hide()
|
||||||
|
|
||||||
|
|
||||||
-- remove blizz cast bar
|
-- remove blizz cast bar
|
||||||
CastingBarFrame:UnregisterAllEvents()
|
CastingBarFrame:UnregisterAllEvents()
|
||||||
end
|
end
|
||||||
@ -76,6 +75,16 @@ function CastBar.prototype:Disable()
|
|||||||
CastingBarFrame:RegisterEvent("SPELLCAST_CHANNEL_STOP");
|
CastingBarFrame:RegisterEvent("SPELLCAST_CHANNEL_STOP");
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
-- OVERRIDE
|
||||||
|
function CastBar.prototype:Redraw()
|
||||||
|
CastBar.super.prototype.Redraw(self)
|
||||||
|
|
||||||
|
self.frame.bottomUpperText:SetWidth(180)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- 'Protected' methods --------------------------------------------------------
|
-- 'Protected' methods --------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
@ -118,7 +127,7 @@ function CastBar.prototype:OnUpdate()
|
|||||||
if (scale < 0.1) then -- "wait" for possible fail event before showing success animation
|
if (scale < 0.1) then -- "wait" for possible fail event before showing success animation
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
self.alpha = 0.5
|
self.alpha = 0.9
|
||||||
self:UpdateBar(1, "castSuccess", 1.1-scale)
|
self:UpdateBar(1, "castSuccess", 1.1-scale)
|
||||||
|
|
||||||
if (scale >= 1) then
|
if (scale >= 1) then
|
||||||
|
@ -4,6 +4,9 @@ local Metrognome = AceLibrary("Metrognome-2.0")
|
|||||||
local DruidMana = AceOO.Class(IceUnitBar)
|
local DruidMana = AceOO.Class(IceUnitBar)
|
||||||
|
|
||||||
DruidMana.prototype.inForms = nil
|
DruidMana.prototype.inForms = nil
|
||||||
|
DruidMana.prototype.mode = nil
|
||||||
|
DruidMana.prototype.mana = nil
|
||||||
|
DruidMana.prototype.maxMana = nil
|
||||||
|
|
||||||
|
|
||||||
-- Constructor --
|
-- Constructor --
|
||||||
@ -27,15 +30,29 @@ end
|
|||||||
function DruidMana.prototype:Enable()
|
function DruidMana.prototype:Enable()
|
||||||
DruidMana.super.prototype.Enable(self)
|
DruidMana.super.prototype.Enable(self)
|
||||||
|
|
||||||
if (DruidBar_OnLoad) then
|
if (IsAddOnLoaded("SoleManax")) then
|
||||||
Metrognome:Register("DruidMana", self.Update, 0.1, self)
|
self.mode = "SoleManax"
|
||||||
|
SoleManax:AddUser(self.UpdateSoleManax, TRUE, self)
|
||||||
|
self:UpdateSoleManax(SoleManax:GetPlayerMana())
|
||||||
|
|
||||||
|
elseif (DruidBar_OnLoad) then
|
||||||
|
self.mode = "DruidBar"
|
||||||
|
Metrognome:Register("DruidMana", self.UpdateDruidBarMana, 0.1, self)
|
||||||
Metrognome:Start("DruidMana")
|
Metrognome:Start("DruidMana")
|
||||||
end
|
end
|
||||||
|
|
||||||
self:RegisterEvent("UNIT_DISPLAYPOWER", "FormsChanged")
|
self:RegisterEvent("UNIT_DISPLAYPOWER", "FormsChanged")
|
||||||
|
|
||||||
self:FormsChanged(self.unit)
|
self:FormsChanged(self.unit)
|
||||||
self:Update()
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function DruidMana.prototype:Disable()
|
||||||
|
DruidMana.super.prototype.Disable(self)
|
||||||
|
|
||||||
|
if (IsAddOnLoaded("SoleManax")) then
|
||||||
|
SoleManax.DelUser(self.UpdateSoleManax)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@ -45,10 +62,25 @@ function DruidMana.prototype:FormsChanged(unit)
|
|||||||
end
|
end
|
||||||
|
|
||||||
self.inForms = (UnitPowerType(self.unit) ~= 0)
|
self.inForms = (UnitPowerType(self.unit) ~= 0)
|
||||||
|
self:Update()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function DruidMana.prototype:Update(unit)
|
function DruidMana.prototype:UpdateSoleManax(mana, maxMana)
|
||||||
|
self.mana = mana
|
||||||
|
self.maxMana = maxMana
|
||||||
|
self:Update()
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function DruidMana.prototype:UpdateDruidBarMana()
|
||||||
|
self.mana = DruidBarKey.keepthemana
|
||||||
|
self.maxMana = DruidBarKey.maxmana
|
||||||
|
self:Update()
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function DruidMana.prototype:Update()
|
||||||
if ((not self.alive) or (not self.inForms)) then
|
if ((not self.alive) or (not self.inForms)) then
|
||||||
self.frame:Hide()
|
self.frame:Hide()
|
||||||
return
|
return
|
||||||
@ -56,13 +88,12 @@ function DruidMana.prototype:Update(unit)
|
|||||||
self.frame:Show()
|
self.frame:Show()
|
||||||
end
|
end
|
||||||
|
|
||||||
--IceHUD:Debug(self.alive, self.inForms)
|
|
||||||
|
|
||||||
local color = "druidMana"
|
local color = "druidMana"
|
||||||
self:UpdateBar(DruidBarKey.keepthemana / DruidBarKey.maxmana, color)
|
|
||||||
local percentage = DruidBarKey.keepthemana / DruidBarKey.maxmana * 100
|
self:UpdateBar(self.mana / self.maxMana, color)
|
||||||
|
|
||||||
|
local percentage = (self.mana / self.maxMana) * 100
|
||||||
self:SetBottomText1(math.floor(percentage))
|
self:SetBottomText1(math.floor(percentage))
|
||||||
--self:SetBottomText2(self:GetFormattedText(DruidBarKey.keepthemana, DruidBarKey.maxmana), color)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@ -170,34 +170,32 @@ function MirrorBarHandler.prototype:GetOptions()
|
|||||||
|
|
||||||
opts["side"] =
|
opts["side"] =
|
||||||
{
|
{
|
||||||
type = 'group',
|
type = 'text',
|
||||||
name = 'side',
|
name = 'Side',
|
||||||
desc = 'Side of the HUD where the bar appears',
|
desc = 'Side of the HUD where the bar appears',
|
||||||
args = {
|
get = function()
|
||||||
left = {
|
if (self.moduleSettings.side == IceCore.Side.Right) then
|
||||||
type = 'execute',
|
return "Right"
|
||||||
name = 'left',
|
else
|
||||||
desc = "Left side",
|
return "Left"
|
||||||
func = function()
|
end
|
||||||
self.moduleSettings.side = IceCore.Side.Left
|
end,
|
||||||
self:Redraw()
|
set = function(value)
|
||||||
end
|
if (value == "Right") then
|
||||||
},
|
self.moduleSettings.side = IceCore.Side.Right
|
||||||
right = {
|
else
|
||||||
type = 'execute',
|
self.moduleSettings.side = IceCore.Side.Left
|
||||||
name = 'right',
|
end
|
||||||
desc = "Right side",
|
self:Redraw()
|
||||||
func = function()
|
end,
|
||||||
self.moduleSettings.side = IceCore.Side.Right
|
validate = { "Left", "Right" },
|
||||||
self:Redraw()
|
order = 30
|
||||||
end
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
opts["offset"] =
|
opts["offset"] =
|
||||||
{
|
{
|
||||||
type = 'range',
|
type = 'range',
|
||||||
name = 'offset',
|
name = 'Offset',
|
||||||
desc = 'Offset of the bar',
|
desc = 'Offset of the bar',
|
||||||
min = -1,
|
min = -1,
|
||||||
max = 10,
|
max = 10,
|
||||||
@ -208,9 +206,10 @@ function MirrorBarHandler.prototype:GetOptions()
|
|||||||
set = function(value)
|
set = function(value)
|
||||||
self.moduleSettings.offset = value
|
self.moduleSettings.offset = value
|
||||||
self:Redraw()
|
self:Redraw()
|
||||||
end
|
end,
|
||||||
|
order = 31
|
||||||
}
|
}
|
||||||
|
|
||||||
return opts
|
return opts
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ function PetHealth.prototype:GetOptions()
|
|||||||
opts["scale"] =
|
opts["scale"] =
|
||||||
{
|
{
|
||||||
type = 'range',
|
type = 'range',
|
||||||
name = 'scale',
|
name = 'Scale',
|
||||||
desc = 'Scale of the bar',
|
desc = 'Scale of the bar',
|
||||||
min = 0.2,
|
min = 0.2,
|
||||||
max = 1,
|
max = 1,
|
||||||
@ -36,7 +36,8 @@ function PetHealth.prototype:GetOptions()
|
|||||||
set = function(value)
|
set = function(value)
|
||||||
self.moduleSettings.scale = value
|
self.moduleSettings.scale = value
|
||||||
self:Redraw()
|
self:Redraw()
|
||||||
end
|
end,
|
||||||
|
order = 31
|
||||||
}
|
}
|
||||||
return opts
|
return opts
|
||||||
end
|
end
|
||||||
|
@ -19,7 +19,7 @@ function PetMana.prototype:GetOptions()
|
|||||||
opts["scale"] =
|
opts["scale"] =
|
||||||
{
|
{
|
||||||
type = 'range',
|
type = 'range',
|
||||||
name = 'scale',
|
name = 'Scale',
|
||||||
desc = 'Scale of the bar',
|
desc = 'Scale of the bar',
|
||||||
min = 0.2,
|
min = 0.2,
|
||||||
max = 1,
|
max = 1,
|
||||||
@ -30,7 +30,8 @@ function PetMana.prototype:GetOptions()
|
|||||||
set = function(value)
|
set = function(value)
|
||||||
self.moduleSettings.scale = value
|
self.moduleSettings.scale = value
|
||||||
self:Redraw()
|
self:Redraw()
|
||||||
end
|
end,
|
||||||
|
order = 31
|
||||||
}
|
}
|
||||||
return opts
|
return opts
|
||||||
end
|
end
|
||||||
|
@ -3,6 +3,7 @@ local AceOO = AceLibrary("AceOO-2.0")
|
|||||||
local PlayerMana = AceOO.Class(IceUnitBar)
|
local PlayerMana = AceOO.Class(IceUnitBar)
|
||||||
|
|
||||||
PlayerMana.prototype.manaType = nil
|
PlayerMana.prototype.manaType = nil
|
||||||
|
PlayerMana.prototype.tickStart = nil
|
||||||
|
|
||||||
-- Constructor --
|
-- Constructor --
|
||||||
function PlayerMana.prototype:init()
|
function PlayerMana.prototype:init()
|
||||||
@ -10,30 +11,75 @@ function PlayerMana.prototype:init()
|
|||||||
|
|
||||||
self:SetColor("playerMana", 62, 54, 152)
|
self:SetColor("playerMana", 62, 54, 152)
|
||||||
self:SetColor("playerRage", 171, 59, 59)
|
self:SetColor("playerRage", 171, 59, 59)
|
||||||
self:SetColor("playerEnergy", 218, 231, 31)
|
self:SetColor("playerEnergy", 218, 231, 31)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
-- OVERRIDE
|
||||||
function PlayerMana.prototype:GetDefaultSettings()
|
function PlayerMana.prototype:GetDefaultSettings()
|
||||||
local settings = PlayerMana.super.prototype.GetDefaultSettings(self)
|
local settings = PlayerMana.super.prototype.GetDefaultSettings(self)
|
||||||
settings["side"] = IceCore.Side.Right
|
settings["side"] = IceCore.Side.Right
|
||||||
settings["offset"] = 1
|
settings["offset"] = 1
|
||||||
|
settings["tickerEnabled"] = true
|
||||||
|
settings["tickerAlpha"] = 0.8
|
||||||
return settings
|
return settings
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
-- OVERRIDE
|
||||||
|
function PlayerMana.prototype:GetOptions()
|
||||||
|
local opts = PlayerMana.super.prototype.GetOptions(self)
|
||||||
|
|
||||||
|
opts["tickerEnabled"] = {
|
||||||
|
type = "toggle",
|
||||||
|
name = "Show rogue/cat energy ticker",
|
||||||
|
desc = "Show rogue/cat energy ticker",
|
||||||
|
get = function()
|
||||||
|
return self.moduleSettings.tickerEnabled
|
||||||
|
end,
|
||||||
|
set = function(value)
|
||||||
|
self.moduleSettings.tickerEnabled = value
|
||||||
|
self:ManaType(self.unit)
|
||||||
|
end,
|
||||||
|
order = 31
|
||||||
|
}
|
||||||
|
|
||||||
|
opts["tickerAlpha"] =
|
||||||
|
{
|
||||||
|
type = 'range',
|
||||||
|
name = 'Energy Ticker Alpha',
|
||||||
|
desc = 'Energy Ticker Alpha',
|
||||||
|
min = 0.1,
|
||||||
|
max = 1,
|
||||||
|
step = 0.05,
|
||||||
|
get = function()
|
||||||
|
return self.moduleSettings.tickerAlpha
|
||||||
|
end,
|
||||||
|
set = function(value)
|
||||||
|
self.moduleSettings.tickerAlpha = value
|
||||||
|
self.tickerFrame:SetStatusBarColor(self:GetColor("playerEnergy", self.moduleSettings.tickerAlpha))
|
||||||
|
end,
|
||||||
|
order = 32
|
||||||
|
}
|
||||||
|
|
||||||
|
return opts
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
function PlayerMana.prototype:Enable()
|
function PlayerMana.prototype:Enable()
|
||||||
PlayerMana.super.prototype.Enable(self)
|
PlayerMana.super.prototype.Enable(self)
|
||||||
|
|
||||||
|
self:CreateTickerFrame()
|
||||||
|
|
||||||
self:RegisterEvent("UNIT_MANA", "Update")
|
self:RegisterEvent("UNIT_MANA", "Update")
|
||||||
self:RegisterEvent("UNIT_MAXMANA", "Update")
|
self:RegisterEvent("UNIT_MAXMANA", "Update")
|
||||||
self:RegisterEvent("UNIT_RAGE", "Update")
|
self:RegisterEvent("UNIT_RAGE", "Update")
|
||||||
self:RegisterEvent("UNIT_MAXRAGE", "Update")
|
self:RegisterEvent("UNIT_MAXRAGE", "Update")
|
||||||
self:RegisterEvent("UNIT_ENERGY", "Update")
|
self:RegisterEvent("UNIT_ENERGY", "UpdateEnergy")
|
||||||
self:RegisterEvent("UNIT_MAXENERGY", "Update")
|
self:RegisterEvent("UNIT_MAXENERGY", "Update")
|
||||||
|
|
||||||
self:RegisterEvent("UNIT_DISPLAYPOWER", "ManaType")
|
self:RegisterEvent("UNIT_DISPLAYPOWER", "ManaType")
|
||||||
|
|
||||||
self:ManaType(self.unit)
|
self:ManaType(self.unit)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -44,6 +90,16 @@ function PlayerMana.prototype:ManaType(unit)
|
|||||||
end
|
end
|
||||||
|
|
||||||
self.manaType = UnitPowerType(self.unit)
|
self.manaType = UnitPowerType(self.unit)
|
||||||
|
|
||||||
|
-- register ticker for rogue energy
|
||||||
|
if (self.moduleSettings.tickerEnabled and (self.manaType == 3) and self.alive) then
|
||||||
|
self.tickerFrame:Show()
|
||||||
|
self.tickerFrame:SetScript("OnUpdate", function() self:EnergyTick() end)
|
||||||
|
else
|
||||||
|
self.tickerFrame:Hide()
|
||||||
|
self.tickerFrame:SetScript("OnUpdate", nil)
|
||||||
|
end
|
||||||
|
|
||||||
self:Update(self.unit)
|
self:Update(self.unit)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -54,6 +110,10 @@ function PlayerMana.prototype:Update(unit)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if (self.manaType ~= 3) then
|
||||||
|
self.tickerFrame:Hide()
|
||||||
|
end
|
||||||
|
|
||||||
local color = "playerMana"
|
local color = "playerMana"
|
||||||
if not (self.alive) then
|
if not (self.alive) then
|
||||||
color = "dead"
|
color = "dead"
|
||||||
@ -78,6 +138,63 @@ function PlayerMana.prototype:Update(unit)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function PlayerMana.prototype:UpdateEnergy(unit)
|
||||||
|
if (unit and (unit ~= "player")) then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
self.tickStart = GetTime()
|
||||||
|
self.tickerFrame:Show()
|
||||||
|
self:Update(unit)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function PlayerMana.prototype:EnergyTick()
|
||||||
|
if not (self.tickStart) then
|
||||||
|
self.tickerFrame:Hide()
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local now = GetTime()
|
||||||
|
local elapsed = now - self.tickStart
|
||||||
|
|
||||||
|
if (elapsed > 2) then
|
||||||
|
self.tickStart = now
|
||||||
|
end
|
||||||
|
|
||||||
|
local thisTick = elapsed / 2
|
||||||
|
local x = (thisTick * (self.width - (self.width * IceBarElement.BarProportion))) + 4
|
||||||
|
local y = thisTick * (self.height - 5)
|
||||||
|
|
||||||
|
self.tickerFrame:ClearAllPoints()
|
||||||
|
self.tickerFrame:SetPoint("BOTTOMLEFT", self.frame, "BOTTOMLEFT", x, y)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function PlayerMana.prototype:CreateTickerFrame()
|
||||||
|
if not (self.tickerFrame) then
|
||||||
|
self.tickerFrame = CreateFrame("StatusBar", nil, self.barFrame)
|
||||||
|
end
|
||||||
|
|
||||||
|
self.tickerFrame:SetFrameStrata("BACKGROUND")
|
||||||
|
self.tickerFrame:SetWidth(19)
|
||||||
|
self.tickerFrame:SetHeight(1)
|
||||||
|
|
||||||
|
if not (self.tickerFrame.spark) then
|
||||||
|
self.tickerFrame.spark = self.tickerFrame:CreateTexture(nil, "BACKGROUND")
|
||||||
|
end
|
||||||
|
|
||||||
|
self.tickerFrame.spark:SetTexture(self:GetColor("playerEnergy", 1))
|
||||||
|
self.tickerFrame.spark:SetBlendMode("ADD")
|
||||||
|
self.tickerFrame.spark:ClearAllPoints()
|
||||||
|
self.tickerFrame.spark:SetAllPoints(self.tickerFrame)
|
||||||
|
|
||||||
|
self.tickerFrame:SetStatusBarTexture(self.tickerFrame.spark)
|
||||||
|
self.tickerFrame:SetStatusBarColor(self:GetColor("playerEnergy", self.moduleSettings.tickerAlpha))
|
||||||
|
|
||||||
|
self.tickerFrame:Hide()
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
-- Load us up
|
-- Load us up
|
||||||
PlayerMana:new()
|
PlayerMana:new()
|
||||||
|
@ -18,6 +18,68 @@ end
|
|||||||
|
|
||||||
-- 'Public' methods -----------------------------------------------------------
|
-- 'Public' methods -----------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
-- OVERRIDE
|
||||||
|
function TargetInfo.prototype:GetOptions()
|
||||||
|
local opts = TargetInfo.super.prototype.GetOptions(self)
|
||||||
|
|
||||||
|
opts["fontSize"] = {
|
||||||
|
type = 'range',
|
||||||
|
name = 'Font Size',
|
||||||
|
desc = 'Font Size',
|
||||||
|
get = function()
|
||||||
|
return self.moduleSettings.fontSize
|
||||||
|
end,
|
||||||
|
set = function(v)
|
||||||
|
self.moduleSettings.fontSize = v
|
||||||
|
self:Redraw()
|
||||||
|
end,
|
||||||
|
min = 8,
|
||||||
|
max = 20,
|
||||||
|
step = 1,
|
||||||
|
order = 31
|
||||||
|
}
|
||||||
|
|
||||||
|
opts["comboFontSize"] = {
|
||||||
|
type = 'range',
|
||||||
|
name = 'Combo Points Font Size',
|
||||||
|
desc = 'Combo Points Font Size',
|
||||||
|
get = function()
|
||||||
|
return self.moduleSettings.comboFontSize
|
||||||
|
end,
|
||||||
|
set = function(v)
|
||||||
|
self.moduleSettings.comboFontSize = v
|
||||||
|
self:Redraw()
|
||||||
|
end,
|
||||||
|
min = 10,
|
||||||
|
max = 40,
|
||||||
|
step = 1,
|
||||||
|
order = 32
|
||||||
|
}
|
||||||
|
|
||||||
|
return opts
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
-- OVERRIDE
|
||||||
|
function TargetInfo.prototype:GetDefaultSettings()
|
||||||
|
local defaults = TargetInfo.super.prototype.GetDefaultSettings(self)
|
||||||
|
defaults["fontSize"] = 13
|
||||||
|
defaults["comboFontSize"] = 20
|
||||||
|
return defaults
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
-- OVERRIDE
|
||||||
|
function TargetInfo.prototype:Redraw()
|
||||||
|
TargetInfo.super.prototype.Redraw(self)
|
||||||
|
|
||||||
|
self:CreateTextFrame()
|
||||||
|
self:CreateInfoTextFrame()
|
||||||
|
self:CreateComboFrame()
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
function TargetInfo.prototype:Enable()
|
function TargetInfo.prototype:Enable()
|
||||||
TargetInfo.super.prototype.Enable(self)
|
TargetInfo.super.prototype.Enable(self)
|
||||||
|
|
||||||
@ -45,26 +107,11 @@ function TargetInfo.prototype:CreateFrame()
|
|||||||
self.frame:SetFrameStrata("BACKGROUND")
|
self.frame:SetFrameStrata("BACKGROUND")
|
||||||
self.frame:SetWidth(TargetInfo.Width)
|
self.frame:SetWidth(TargetInfo.Width)
|
||||||
self.frame:SetHeight(42)
|
self.frame:SetHeight(42)
|
||||||
|
self.frame:ClearAllPoints()
|
||||||
self.frame:SetPoint("TOP", self.parent, "BOTTOM", 0, -50)
|
self.frame:SetPoint("TOP", self.parent, "BOTTOM", 0, -50)
|
||||||
|
|
||||||
--[[
|
|
||||||
self.frame:SetBackdrop(
|
|
||||||
{
|
|
||||||
bgFile = "Interface/Tooltips/UI-Tooltip-Background",
|
|
||||||
edgeFile = "Interface/Tooltips/UI-ToolTip-Border",
|
|
||||||
tile = false,
|
|
||||||
tileSize = 32,
|
|
||||||
edgeSize = 5,
|
|
||||||
insets = { left = 1, right = 1, top = 1, bottom = 1 }
|
|
||||||
} )
|
|
||||||
|
|
||||||
self.frame:SetBackdropColor(0.5, 0.5, 0.5, 0.2)
|
|
||||||
self.frame:SetBackdropBorderColor(0.4, 0.4, 0.4, 0.4)
|
|
||||||
--]]
|
|
||||||
|
|
||||||
self.frame:Show()
|
self.frame:Show()
|
||||||
|
|
||||||
|
|
||||||
self:CreateTextFrame()
|
self:CreateTextFrame()
|
||||||
self:CreateInfoTextFrame()
|
self:CreateInfoTextFrame()
|
||||||
self:CreateBuffFrame()
|
self:CreateBuffFrame()
|
||||||
@ -75,9 +122,9 @@ end
|
|||||||
|
|
||||||
|
|
||||||
function TargetInfo.prototype:CreateTextFrame()
|
function TargetInfo.prototype:CreateTextFrame()
|
||||||
self.frame.targetName = self:FontFactory("Bold", 15)
|
self.frame.targetName = self:FontFactory("Bold", self.moduleSettings.fontSize+1, nil, self.frame.targetName)
|
||||||
|
|
||||||
self.frame.targetName:SetWidth(TargetInfo.Width)
|
self.frame.targetName:SetWidth(TargetInfo.Width - 120)
|
||||||
self.frame.targetName:SetHeight(14)
|
self.frame.targetName:SetHeight(14)
|
||||||
self.frame.targetName:SetJustifyH("LEFT")
|
self.frame.targetName:SetJustifyH("LEFT")
|
||||||
self.frame.targetName:SetJustifyV("BOTTOM")
|
self.frame.targetName:SetJustifyV("BOTTOM")
|
||||||
@ -88,7 +135,7 @@ end
|
|||||||
|
|
||||||
|
|
||||||
function TargetInfo.prototype:CreateInfoTextFrame()
|
function TargetInfo.prototype:CreateInfoTextFrame()
|
||||||
self.frame.targetInfo = self:FontFactory(nil, 13)
|
self.frame.targetInfo = self:FontFactory(nil, self.moduleSettings.fontSize, nil, self.frame.targetInfo)
|
||||||
|
|
||||||
self.frame.targetInfo:SetWidth(TargetInfo.Width)
|
self.frame.targetInfo:SetWidth(TargetInfo.Width)
|
||||||
self.frame.targetInfo:SetHeight(14)
|
self.frame.targetInfo:SetHeight(14)
|
||||||
@ -101,7 +148,7 @@ end
|
|||||||
|
|
||||||
|
|
||||||
function TargetInfo.prototype:CreateComboFrame()
|
function TargetInfo.prototype:CreateComboFrame()
|
||||||
self.frame.comboPoints = self:FontFactory("Bold", 20)
|
self.frame.comboPoints = self:FontFactory("Bold", self.moduleSettings.comboFontSize, nil, self.frame.comboPoints)
|
||||||
|
|
||||||
self.frame.comboPoints:SetWidth(TargetInfo.Width)
|
self.frame.comboPoints:SetWidth(TargetInfo.Width)
|
||||||
self.frame.comboPoints:SetJustifyH("CENTER")
|
self.frame.comboPoints:SetJustifyH("CENTER")
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
local AceOO = AceLibrary("AceOO-2.0")
|
local AceOO = AceLibrary("AceOO-2.0")
|
||||||
local Metrognome = AceLibrary("Metrognome-2.0")
|
|
||||||
|
|
||||||
local TargetOfTarget = AceOO.Class(IceElement)
|
local TargetOfTarget = AceOO.Class(IceElement, "Metrognome-2.0")
|
||||||
|
|
||||||
|
TargetOfTarget.prototype.stackedDebuffs = nil
|
||||||
|
TargetOfTarget.prototype.buffSize = nil
|
||||||
|
|
||||||
|
|
||||||
-- Constructor --
|
-- Constructor --
|
||||||
@ -11,25 +13,84 @@ function TargetOfTarget.prototype:init()
|
|||||||
self:SetColor("totHostile", 0.8, 0.1, 0.1)
|
self:SetColor("totHostile", 0.8, 0.1, 0.1)
|
||||||
self:SetColor("totFriendly", 0.2, 1, 0.2)
|
self:SetColor("totFriendly", 0.2, 1, 0.2)
|
||||||
self:SetColor("totNeutral", 0.9, 0.9, 0)
|
self:SetColor("totNeutral", 0.9, 0.9, 0)
|
||||||
|
|
||||||
|
self.buffSize = 15
|
||||||
|
self.stackedDebuffs = {}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
-- OVERRIDE
|
||||||
|
function TargetOfTarget.prototype:GetOptions()
|
||||||
|
local opts = TargetOfTarget.super.prototype.GetOptions(self)
|
||||||
|
|
||||||
|
opts["showDebuffs"] = {
|
||||||
|
type = "toggle",
|
||||||
|
name = "Show stacking debuffs",
|
||||||
|
desc = "Show stacking debuffs in ToT info",
|
||||||
|
get = function()
|
||||||
|
return self.moduleSettings.showDebuffs
|
||||||
|
end,
|
||||||
|
set = function(value)
|
||||||
|
self.moduleSettings.showDebuffs = value
|
||||||
|
self:UpdateBuffs()
|
||||||
|
end,
|
||||||
|
order = 31
|
||||||
|
}
|
||||||
|
|
||||||
|
opts["fontSize"] = {
|
||||||
|
type = 'range',
|
||||||
|
name = 'Font Size',
|
||||||
|
desc = 'Font Size',
|
||||||
|
get = function()
|
||||||
|
return self.moduleSettings.fontSize
|
||||||
|
end,
|
||||||
|
set = function(v)
|
||||||
|
self.moduleSettings.fontSize = v
|
||||||
|
self:Redraw()
|
||||||
|
end,
|
||||||
|
min = 8,
|
||||||
|
max = 20,
|
||||||
|
step = 1,
|
||||||
|
order = 32
|
||||||
|
}
|
||||||
|
|
||||||
|
return opts
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
-- OVERRIDE
|
||||||
|
function TargetOfTarget.prototype:GetDefaultSettings()
|
||||||
|
local defaults = TargetOfTarget.super.prototype.GetDefaultSettings(self)
|
||||||
|
defaults["showDebuffs"] = true
|
||||||
|
defaults["fontSize"] = 13
|
||||||
|
return defaults
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
-- OVERRIDE
|
||||||
|
function TargetOfTarget.prototype:Redraw()
|
||||||
|
TargetOfTarget.super.prototype.Redraw(self)
|
||||||
|
|
||||||
|
self:CreateToTFrame()
|
||||||
|
self:CreateToTHPFrame()
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
function TargetOfTarget.prototype:Enable()
|
function TargetOfTarget.prototype:Enable()
|
||||||
TargetOfTarget.super.prototype.Enable(self)
|
TargetOfTarget.super.prototype.Enable(self)
|
||||||
|
|
||||||
Metrognome:Register("TargetOfTarget", self.Update, 0.2, self)
|
|
||||||
Metrognome:Start("TargetOfTarget")
|
|
||||||
|
|
||||||
self:RegisterEvent("PLAYER_TARGET_CHANGED", "Update")
|
self:RegisterEvent("PLAYER_TARGET_CHANGED", "Update")
|
||||||
|
|
||||||
|
self:RegisterMetro(self.name, self.Update, 0.33, self)
|
||||||
|
self:StartMetro(self.name)
|
||||||
|
|
||||||
self:Update()
|
self:Update()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function TargetOfTarget.prototype:Disable()
|
function TargetOfTarget.prototype:Disable()
|
||||||
TargetOfTarget.super.prototype.Disable(self)
|
TargetOfTarget.super.prototype.Disable(self)
|
||||||
Metrognome:Unregister("TargetOfTarget")
|
self:UnregisterMetro(self.name)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@ -47,36 +108,107 @@ function TargetOfTarget.prototype:CreateFrame()
|
|||||||
|
|
||||||
self:CreateToTFrame()
|
self:CreateToTFrame()
|
||||||
self:CreateToTHPFrame()
|
self:CreateToTHPFrame()
|
||||||
|
self:CreateDebuffFrame()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function TargetOfTarget.prototype:CreateToTFrame()
|
function TargetOfTarget.prototype:CreateToTFrame()
|
||||||
self.frame.totName = self:FontFactory("Bold", 14)
|
self.frame.totName = self:FontFactory("Bold", self.moduleSettings.fontSize+1, nil, self.frame.totName)
|
||||||
|
|
||||||
self.frame.totName:SetWidth(120)
|
self.frame.totName:SetWidth(120)
|
||||||
self.frame.totName:SetHeight(14)
|
self.frame.totName:SetHeight(14)
|
||||||
self.frame.totName:SetJustifyH("RIGHT")
|
self.frame.totName:SetJustifyH("RIGHT")
|
||||||
self.frame.totName:SetJustifyV("BOTTOM")
|
self.frame.totName:SetJustifyV("BOTTOM")
|
||||||
|
|
||||||
self.frame.totName:SetPoint("TOPRIGHT", self.frame, "TOPRIGHT", -2, -2)
|
self.frame.totName:SetPoint("TOPRIGHT", self.frame, "TOPRIGHT", 0, -2)
|
||||||
self.frame.totName:Show()
|
self.frame.totName:Show()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function TargetOfTarget.prototype:CreateToTHPFrame()
|
function TargetOfTarget.prototype:CreateToTHPFrame()
|
||||||
self.frame.totHealth = self:FontFactory(nil, 12)
|
self.frame.totHealth = self:FontFactory(nil, self.moduleSettings.fontSize, nil, self.frame.totHealth)
|
||||||
|
|
||||||
self.frame.totHealth:SetWidth(120)
|
self.frame.totHealth:SetWidth(120)
|
||||||
self.frame.totHealth:SetHeight(14)
|
self.frame.totHealth:SetHeight(14)
|
||||||
self.frame.totHealth:SetJustifyH("RIGHT")
|
self.frame.totHealth:SetJustifyH("RIGHT")
|
||||||
self.frame.totHealth:SetJustifyV("TOP")
|
self.frame.totHealth:SetJustifyV("TOP")
|
||||||
|
|
||||||
self.frame.totHealth:SetPoint("TOPRIGHT", self.frame, "TOPRIGHT", -2, -16)
|
self.frame.totHealth:SetPoint("TOPRIGHT", self.frame, "TOPRIGHT", 0, -16)
|
||||||
self.frame.totHealth:Show()
|
self.frame.totHealth:Show()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function TargetOfTarget.prototype:CreateDebuffFrame()
|
||||||
|
self.frame.debuffFrame = CreateFrame("Frame", nil, self.frame)
|
||||||
|
|
||||||
|
self.frame.debuffFrame:SetFrameStrata("BACKGROUND")
|
||||||
|
self.frame.debuffFrame:SetWidth(200)
|
||||||
|
self.frame.debuffFrame:SetHeight(20)
|
||||||
|
|
||||||
|
self.frame.debuffFrame:SetPoint("TOPLEFT", self.frame, "TOPRIGHT", 4, 0)
|
||||||
|
self.frame.debuffFrame:Show()
|
||||||
|
|
||||||
|
self.frame.debuffFrame.buffs = self:CreateIconFrames(self.frame.debuffFrame)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function TargetOfTarget.prototype:CreateIconFrames(parent)
|
||||||
|
local buffs = {}
|
||||||
|
|
||||||
|
for i = 1, 16 do
|
||||||
|
buffs[i] = CreateFrame("Frame", nil, parent)
|
||||||
|
buffs[i]:SetFrameStrata("BACKGROUND")
|
||||||
|
buffs[i]:SetWidth(self.buffSize)
|
||||||
|
buffs[i]:SetHeight(self.buffSize)
|
||||||
|
buffs[i]:SetPoint("LEFT", (i-1) * self.buffSize + (i-1), 0)
|
||||||
|
buffs[i]:Show()
|
||||||
|
|
||||||
|
buffs[i].texture = buffs[i]:CreateTexture()
|
||||||
|
buffs[i].texture:SetTexture(nil)
|
||||||
|
buffs[i].texture:SetAllPoints(buffs[i])
|
||||||
|
|
||||||
|
buffs[i].stack = self:FontFactory("Bold", 15, buffs[i])
|
||||||
|
buffs[i].stack:SetPoint("BOTTOMRIGHT" , buffs[i], "BOTTOMRIGHT", 0, -1)
|
||||||
|
end
|
||||||
|
return buffs
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function TargetOfTarget.prototype:UpdateBuffs()
|
||||||
|
local debuffs = 0
|
||||||
|
|
||||||
|
if (self.moduleSettings.showDebuffs) then
|
||||||
|
for i = 1, 16 do
|
||||||
|
local buffTexture, buffApplications = UnitDebuff("targettarget", i)
|
||||||
|
|
||||||
|
if (buffApplications and (buffApplications > 1)) then
|
||||||
|
debuffs = debuffs + 1
|
||||||
|
|
||||||
|
if not (self.stackedDebuffs[debuffs]) then
|
||||||
|
self.stackedDebuffs[debuffs] = {}
|
||||||
|
end
|
||||||
|
|
||||||
|
self.stackedDebuffs[debuffs].texture = buffTexture
|
||||||
|
self.stackedDebuffs[debuffs].count = buffApplications
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
for i = 1, 16 do
|
||||||
|
if (self.moduleSettings.showDebuffs and (i <= debuffs)) then
|
||||||
|
self.frame.debuffFrame.buffs[i].texture:SetTexture(self.stackedDebuffs[i].texture)
|
||||||
|
self.frame.debuffFrame.buffs[i].stack:SetText(self.stackedDebuffs[i].count)
|
||||||
|
else
|
||||||
|
self.frame.debuffFrame.buffs[i].texture:SetTexture(nil)
|
||||||
|
self.frame.debuffFrame.buffs[i].stack:SetText(nil)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
function TargetOfTarget.prototype:Update()
|
function TargetOfTarget.prototype:Update()
|
||||||
|
self:UpdateBuffs()
|
||||||
|
|
||||||
if not (UnitExists("targettarget")) then
|
if not (UnitExists("targettarget")) then
|
||||||
self.frame.totName:SetText()
|
self.frame.totName:SetText()
|
||||||
self.frame.totHealth:SetText()
|
self.frame.totHealth:SetText()
|
||||||
|
70
modules/TimerBar.lua
Normal file
70
modules/TimerBar.lua
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
local AceOO = AceLibrary("AceOO-2.0")
|
||||||
|
|
||||||
|
local TimerBar = AceOO.Class(IceBarElement, "AceHook-2.0", "Metrognome-2.0")
|
||||||
|
|
||||||
|
|
||||||
|
-- Constructor --
|
||||||
|
function TimerBar.prototype:init()
|
||||||
|
TimerBar.super.prototype.init(self, "TimerBar")
|
||||||
|
|
||||||
|
self:SetColor("timerFlight", 0.2, 0.7, 0.7)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
-- 'Public' methods -----------------------------------------------------------
|
||||||
|
|
||||||
|
function TimerBar.prototype:GetDefaultSettings()
|
||||||
|
local settings = TimerBar.super.prototype.GetDefaultSettings(self)
|
||||||
|
settings["side"] = IceCore.Side.Left
|
||||||
|
settings["offset"] = 0
|
||||||
|
return settings
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function TimerBar.prototype:Enable()
|
||||||
|
TimerBar.super.prototype.Enable(self)
|
||||||
|
|
||||||
|
self.frame.bottomUpperText:SetWidth(180)
|
||||||
|
self.frame:Hide()
|
||||||
|
|
||||||
|
self:Hook(ToFu, "OnUpdate")
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function TimerBar.prototype:Disable()
|
||||||
|
TimerBar.super.prototype.Disable(self)
|
||||||
|
|
||||||
|
self:Unhook(ToFu, "OnUpdate")
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
-- 'Protected' methods --------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
function TimerBar.prototype:OnUpdate(object, timeSinceLast)
|
||||||
|
self.hooks[object].OnUpdate.orig(object, timeSinceLast)
|
||||||
|
|
||||||
|
if (ToFu.inFlight) then
|
||||||
|
local flightTime = ToFu.fullData.paths[ace.char.faction][ToFu.start][ToFu.destination].time
|
||||||
|
|
||||||
|
if (flightTime ~= 0) then
|
||||||
|
local timeRemaining = flightTime - ToFu.timeFlown
|
||||||
|
|
||||||
|
self.frame:Show()
|
||||||
|
self:UpdateBar(timeRemaining / flightTime, "timerFlight")
|
||||||
|
--local text = string.format("%.1fs", timeRemaining)
|
||||||
|
local text = FuBarUtils.FormatDurationCondensed(timeRemaining)
|
||||||
|
self:SetBottomText1(text)
|
||||||
|
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
|
self.frame:Hide()
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
-- Load us up
|
||||||
|
TimerBar:new()
|
BIN
textures/Bar.blp
Normal file
BIN
textures/Bar.blp
Normal file
Binary file not shown.
Reference in New Issue
Block a user