Misc fixed and a preview for new texture (check 'Bar' type)

This commit is contained in:
iceroth
2006-10-16 13:16:56 +00:00
parent b7decf6a3e
commit e949b5b350
9 changed files with 67 additions and 36 deletions

View File

@ -15,6 +15,7 @@ IceCore.prototype.IceHUDFrame = nil
IceCore.prototype.elements = {}
IceCore.prototype.enabled = nil
IceCore.prototype.presets = {}
IceCore.prototype.settingsHash = nil
-- Constructor --
function IceCore.prototype:init()
@ -25,7 +26,6 @@ function IceCore.prototype:init()
self.IceHUDFrame = CreateFrame("Frame","IceHUDFrame", UIParent)
-- We are ready to load modules
self:RegisterEvent(IceCore.RegisterModule, "Register")
self:TriggerEvent(IceCore.Loaded)
@ -404,5 +404,13 @@ function IceCore.prototype:LoadPresets()
barProportion = 0.14,
barSpace = 1,
}
self.presets["UBar"] = {
barTexture = "UBar",
barWidth = 155,
barHeight = 220,
barProportion = 0.14,
barSpace = 1,
}
end

View File

@ -242,7 +242,6 @@ IceHUD.options =
end,
set = function(value)
IceHUD.IceCore:SetFontFamily(value)
IceHUD.IceCore:Redraw()
end,
validate = { "IceHUD", "Default" },
},

View File

@ -3,7 +3,7 @@
## Name: IceHUD
## Title: IceHUD |cff7fff7f -Ace2-|r
## Notes: Another HUD mod
## Version: 0.7.5 ($Revision$)
## Version: 0.7.6 ($Revision$)
## SavedVariables: IceCoreDB
## OptionalDeps: Ace2, DewdropLib, FuBar_ToFu, DruidBar, SoleManax, MobHealth, SpellStatusLib
## X-Category: UnitFrame

View File

@ -17,7 +17,7 @@ IceUnitBar.prototype.manaPercentage = nil
IceUnitBar.prototype.unitClass = nil
IceUnitBar.prototype.hasPet = nil
IceUnitBar.prototype.noFlash = nil
-- Constructor --
function IceUnitBar.prototype:init(name, unit)
@ -26,6 +26,7 @@ function IceUnitBar.prototype:init(name, unit)
self.unit = unit
_, self.unitClass = UnitClass(self.unit)
self.noFlash = false
self:SetDefaultColor("Dead", 0.5, 0.5, 0.5)
self:SetDefaultColor("Tapped", 0.8, 0.8, 0.8)
@ -50,7 +51,7 @@ function IceUnitBar.prototype:GetOptions()
{
type = 'range',
name = '|cff22bb22Low Threshold|r',
desc = 'Threshold of pulsing the bar (0 means never)',
desc = 'Threshold of pulsing the bar (0 means never) (for player applies only to mana, not rage/energy)',
get = function()
return self.moduleSettings.lowThreshold
end,
@ -180,7 +181,9 @@ function IceUnitBar.prototype:UpdateBar(scale, color, alpha)
self.flashFrame:SetStatusBarColor(self:GetColor(color))
if (self.moduleSettings.lowThreshold > 0 and self.moduleSettings.lowThreshold >= scale and self.alive) then
if (self.moduleSettings.lowThreshold > 0 and
self.moduleSettings.lowThreshold >= scale and self.alive and
not self.noFlash) then
self.flashFrame:SetScript("OnUpdate", function() self:OnFlashUpdate() end)
else
self.flashFrame:SetScript("OnUpdate", nil)

View File

@ -174,6 +174,15 @@ function PlayerMana.prototype:Update(unit)
end
-- OVERRIDE
function PlayerMana.prototype:UpdateBar(scale, color, alpha)
self.noFlash = (self.manaType ~= 0)
PlayerMana.super.prototype.UpdateBar(self, scale, color, alpha)
end
function PlayerMana.prototype:UpdateEnergy(unit)
if (unit and (unit ~= "player")) then
return

View File

@ -19,7 +19,7 @@ function TargetHealth.prototype:GetDefaultSettings()
local settings = TargetHealth.super.prototype.GetDefaultSettings(self)
settings["side"] = IceCore.Side.Left
settings["offset"] = 2
settings["mobhealth"] = false
settings["mobhealth"] = (MobHealth3 ~= nil)
settings["classColor"] = false
settings["hideBlizz"] = true
return settings

View File

@ -108,7 +108,7 @@ function TargetInfo.prototype:GetOptions()
end,
set = function(v)
self.moduleSettings.stackFontSize = v
self:Redraw()
self:RedrawBuffs()
end,
min = 8,
max = 20,
@ -128,7 +128,7 @@ function TargetInfo.prototype:GetOptions()
end,
set = function(v)
self.moduleSettings.zoom = v
self:Redraw()
self:RedrawBuffs()
end,
min = 0,
max = 0.2,
@ -149,7 +149,7 @@ function TargetInfo.prototype:GetOptions()
end,
set = function(v)
self.moduleSettings.buffSize = v
self:Redraw()
self:RedrawBuffs()
end,
min = 8,
max = 20,
@ -170,6 +170,7 @@ function TargetInfo.prototype:GetOptions()
set = function(v)
self.moduleSettings.mouse = v
self:Redraw()
self:RedrawBuffs()
end,
disabled = function()
return not self.moduleSettings.enabled
@ -202,7 +203,16 @@ function TargetInfo.prototype:Redraw()
self:CreateFrame(true)
self:TargetChanged()
end
end
function TargetInfo.prototype:RedrawBuffs()
if (self.moduleSettings.enabled) then
self:CreateBuffFrame(false)
self:CreateDebuffFrame(false)
self:TargetChanged()
end
end
@ -210,7 +220,7 @@ end
-- 'Protected' methods --------------------------------------------------------
-- OVERRIDE
function TargetInfo.prototype:CreateFrame()
function TargetInfo.prototype:CreateFrame(redraw)
TargetInfo.super.prototype.CreateFrame(self)
self.width = self.settings.gap + 50
@ -226,8 +236,8 @@ function TargetInfo.prototype:CreateFrame()
self:CreateInfoTextFrame()
self:CreateGuildTextFrame()
self:CreateBuffFrame()
self:CreateDebuffFrame()
self:CreateBuffFrame(redraw)
self:CreateDebuffFrame(redraw)
self:CreateRaidIconFrame()
@ -329,10 +339,9 @@ function TargetInfo.prototype:CreateRaidIconFrame()
end
function TargetInfo.prototype:CreateBuffFrame()
function TargetInfo.prototype:CreateBuffFrame(redraw)
if (not self.frame.buffFrame) then
self.frame.buffFrame = CreateFrame("Frame", nil, self.frame)
end
self.frame.buffFrame:SetFrameStrata("BACKGROUND")
self.frame.buffFrame:SetWidth(1)
@ -342,17 +351,18 @@ function TargetInfo.prototype:CreateBuffFrame()
self.frame.buffFrame:SetPoint("TOPRIGHT", self.frame, "TOPLEFT", -5, 0)
self.frame.buffFrame:Show()
if (not self.frame.buffFrame.buffs) then
self.frame.buffFrame.buffs = {}
end
if (not redraw) then
self.frame.buffFrame.buffs = self:CreateIconFrames(self.frame.buffFrame, -1, self.frame.buffFrame.buffs, "buff")
end
end
function TargetInfo.prototype:CreateDebuffFrame()
function TargetInfo.prototype:CreateDebuffFrame(redraw)
if (not self.frame.debuffFrame) then
self.frame.debuffFrame = CreateFrame("Frame", nil, self.frame)
end
self.frame.debuffFrame:SetFrameStrata("BACKGROUND")
self.frame.debuffFrame:SetWidth(1)
@ -362,11 +372,13 @@ function TargetInfo.prototype:CreateDebuffFrame()
self.frame.debuffFrame:SetPoint("TOPLEFT", self.frame, "TOPRIGHT", 5, 0)
self.frame.debuffFrame:Show()
if (not self.frame.debuffFrame.buffs) then
self.frame.debuffFrame.buffs = {}
end
if (not redraw) then
self.frame.debuffFrame.buffs = self:CreateIconFrames(self.frame.debuffFrame, 1, self.frame.debuffFrame.buffs, "debuff")
end
end
function TargetInfo.prototype:CreateIconFrames(parent, direction, buffs, type)

Binary file not shown.

Binary file not shown.