SharedMedia <3

This commit is contained in:
iceroth
2007-06-02 21:26:15 +00:00
parent 5f3723d080
commit 77782fb169
11 changed files with 52 additions and 72 deletions

View File

@ -39,7 +39,6 @@ function IceBarElement.prototype:GetDefaultSettings()
settings["side"] = IceCore.Side.Left
settings["offset"] = 1
settings["barFontSize"] = 12
settings["barFontBold"] = true
settings["lockTextAlpha"] = true
settings["textVisible"] = {upper = true, lower = true}
settings["brackets"] = true
@ -127,20 +126,6 @@ function IceBarElement.prototype:GetOptions()
order = 11
},
fontBold = {
type = 'toggle',
name = 'Bar Font Bold',
desc = 'If you have game default font selected, this option has no effect',
get = function()
return self.moduleSettings.barFontBold
end,
set = function(v)
self.moduleSettings.barFontBold = v
self:Redraw()
end,
order = 12
},
lockFontAlpha = {
type = "toggle",
name = "Lock Bar Text Alpha",
@ -311,8 +296,8 @@ end
function IceBarElement.prototype:CreateTexts()
self.frame.bottomUpperText = self:FontFactory(self.moduleSettings.barFontBold, self.moduleSettings.barFontSize, nil, self.frame.bottomUpperText)
self.frame.bottomLowerText = self:FontFactory(self.moduleSettings.barFontBold, self.moduleSettings.barFontSize, nil, self.frame.bottomLowerText)
self.frame.bottomUpperText = self:FontFactory(self.moduleSettings.barFontSize, nil, self.frame.bottomUpperText)
self.frame.bottomLowerText = self:FontFactory(self.moduleSettings.barFontSize, nil, self.frame.bottomLowerText)
self.frame.bottomUpperText:SetWidth(80)
self.frame.bottomLowerText:SetWidth(120)

View File

@ -52,7 +52,7 @@ function IceCore.prototype:init()
backgroundColor = {r = 0.5, g = 0.5, b = 0.5},
barTexture = "Bar",
barPreset = defaultPreset,
fontFamily = "IceHUD",
fontFamily = "Arial Narrow",
debug = false
}
@ -90,10 +90,6 @@ function IceCore.prototype:Enable()
end
end
-- try to catch what's causing the cockblock message
self:RegisterEvent("ADDON_ACTION_FORBIDDEN", "ActionForbidden")
self:RegisterEvent("ADDON_ACTION_BLOCKED", "ActionBlocked")
self.enabled = true
end
@ -184,12 +180,6 @@ function IceCore.prototype:Register(element)
end
function IceCore.prototype:ActionForbidden(addon, msg)
IceHUD:Debug("Action Forbidden. ", addon, " : ", msg)
end
function IceCore.prototype:ActionBlocked(addon, msg)
IceHUD:Debug("Action Blocked. ", addon, " : ", msg)
end
-------------------------------------------------------------------------------
-- Configuration methods --

View File

@ -1,4 +1,5 @@
local AceOO = AceLibrary("AceOO-2.0")
local SML = AceLibrary("SharedMedia-1.0")
IceElement = AceOO.Class("AceEvent-2.0")
IceElement.virtual = true
@ -239,17 +240,7 @@ function IceElement.prototype:ConvertToHex(color)
end
function IceElement.prototype:FontFactory(weight, size, frame, font, flags)
local weightString = ""
if (weight) then
weightString = "Bold"
end
local fontFile = IceHUD.Location .. "\\fonts\\Calibri" .. weightString ..".ttf"
if (self.settings.fontFamily == "Default") then
fontFile = STANDARD_TEXT_FONT
end
function IceElement.prototype:FontFactory(size, frame, font, flags)
if not (frame) then
frame = self.frame
end
@ -260,7 +251,8 @@ function IceElement.prototype:FontFactory(weight, size, frame, font, flags)
else
fontString = font
end
fontString:SetFont(fontFile, size, flags)
fontString:SetFont(SML:Fetch(SML.MediaType.FONT, self.settings.fontFamily), size, flags)
if not (flags) then
fontString:SetShadowColor(0, 0, 0, 1)
fontString:SetShadowOffset(1, -1)

View File

@ -1,6 +1,7 @@
IceHUD = AceLibrary("AceAddon-2.0"):new("AceConsole-2.0", "AceDebug-2.0")
local waterfall = AceLibrary("Waterfall-1.0")
local SML = AceLibrary("SharedMedia-1.0")
IceHUD.Location = "Interface\\AddOns\\IceHUD"
IceHUD.options =
@ -243,7 +244,7 @@ IceHUD.options =
set = function(value)
IceHUD.IceCore:SetFontFamily(value)
end,
validate = { "IceHUD", "Default" },
validate = SML:List(SML.MediaType.FONT),
},
barSettings = {

View File

@ -3,10 +3,10 @@
## Name: IceHUD
## Title: IceHUD |cff7fff7f -Ace2-|r
## Notes: Another HUD addon
## Version: 0.9.2 ($Revision$)
## Version: 0.9.3 ($Revision$)
## SavedVariables: IceCoreDB
## OptionalDeps: Ace2, GratuityLib, WaterfallLib, MobHealth
## X-Embeds: Ace2, GratuityLib, WaterfallLib
## OptionalDeps: Ace2, GratuityLib, SharedMediaLib, WaterfallLib, MobHealth
## X-Embeds: Ace2, GratuityLib, SharedMediaLib, WaterfallLib
## X-Category: UnitFrame
## X-Date: $Date$
## X-eMail: iceroth@iceroth.net
@ -21,6 +21,7 @@ libs\AceDebug-2.0\AceDebug-2.0.lua
libs\AceConsole-2.0\AceConsole-2.0.lua
libs\AceAddon-2.0\AceAddon-2.0.lua
libs\Gratuity-2.0\Gratuity-2.0.lua
libs\SharedMedia-1.0\SharedMedia-1.0.lua
libs\Waterfall-1.0\Waterfall-1.0.lua
# IceHUD core functionality

Binary file not shown.

Binary file not shown.

View File

@ -152,7 +152,7 @@ end
function ComboPoints.prototype:CreateComboFrame()
-- create numeric combo points
self.frame.numeric = self:FontFactory("Bold", self.moduleSettings.comboFontSize, nil, self.frame.numeric)
self.frame.numeric = self:FontFactory(self.moduleSettings.comboFontSize, nil, self.frame.numeric)
self.frame.numeric:SetWidth(50)
self.frame.numeric:SetJustifyH("CENTER")

View File

@ -357,7 +357,7 @@ end
function TargetInfo.prototype:CreateTextFrame()
self.frame.targetName = self:FontFactory("Bold", self.moduleSettings.fontSize+1, nil, self.frame.targetName)
self.frame.targetName = self:FontFactory(self.moduleSettings.fontSize+1, nil, self.frame.targetName)
self.frame.targetName:SetJustifyH("CENTER")
self.frame.targetName:SetJustifyV("TOP")
self.frame.targetName:SetAllPoints(self.frame)
@ -365,7 +365,7 @@ end
function TargetInfo.prototype:CreateInfoTextFrame()
self.frame.targetInfo = self:FontFactory(nil, self.moduleSettings.fontSize, nil, self.frame.targetInfo)
self.frame.targetInfo = self:FontFactory(self.moduleSettings.fontSize, nil, self.frame.targetInfo)
self.frame.targetInfo:SetWidth(self.width)
self.frame.targetInfo:SetHeight(14)
@ -378,7 +378,7 @@ end
function TargetInfo.prototype:CreateGuildTextFrame()
self.frame.targetGuild = self:FontFactory(nil, self.moduleSettings.fontSize, nil, self.frame.targetGuild)
self.frame.targetGuild = self:FontFactory(self.moduleSettings.fontSize, nil, self.frame.targetGuild)
self.frame.targetInfo:SetWidth(self.width)
self.frame.targetGuild:SetHeight(14)
@ -507,8 +507,8 @@ function TargetInfo.prototype:CreateIconFrames(parent, direction, buffs, type)
buffs[i].icon.texture:SetAllPoints(buffs[i].icon)
end
buffs[i].icon.stack = self:FontFactory("Bold",
self.moduleSettings.stackFontSize, buffs[i].icon, buffs[i].icon.stack, "OUTLINE")
buffs[i].icon.stack = self:FontFactory(self.moduleSettings.stackFontSize, buffs[i].icon, buffs[i].icon.stack,
"OUTLINE")
buffs[i].icon.stack:ClearAllPoints()
buffs[i].icon.stack:SetPoint("BOTTOMRIGHT" , buffs[i].icon, "BOTTOMRIGHT", 3, -1)

View File

@ -1,4 +1,5 @@
local AceOO = AceLibrary("AceOO-2.0")
local SML = AceLibrary("SharedMedia-1.0")
local TargetOfTarget = AceOO.Class(IceElement)
@ -101,6 +102,24 @@ function TargetOfTarget.prototype:GetOptions()
order = 34
}
opts["texture"] = {
type = 'text',
name = 'Texture',
desc = 'ToT frame texture',
get = function()
return self.moduleSettings.texture
end,
set = function(v)
self.moduleSettings.texture = v
self:Redraw()
end,
disabled = function()
return not self.moduleSettings.enabled
end,
validate = SML:List(SML.MediaType.STATUSBAR),
order = 35
}
return opts
end
@ -112,6 +131,7 @@ function TargetOfTarget.prototype:GetDefaultSettings()
defaults["showDebuffs"] = true
defaults["fontSize"] = 15
defaults["mouse"] = true
defaults["texture"] = "Blizzard"
return defaults
end
@ -130,9 +150,7 @@ function TargetOfTarget.prototype:Enable(core)
TargetOfTarget.super.prototype.Enable(self, core)
self:RegisterEvent("PLAYER_TARGET_CHANGED", "Update")
self:ScheduleRepeatingEvent(self.elementName, self.Update, 0.3, self)
self:ScheduleRepeatingEvent(self.elementName, self.Update, 0.2, self)
RegisterUnitWatch(self.frame)
self:Update()
@ -162,13 +180,7 @@ function TargetOfTarget.prototype:CreateFrame()
self.frame:SetHeight(self.height)
self.frame:SetPoint("TOP", self.parent, "TOP", 0, self.moduleSettings.vpos)
self.frame:SetScale(self.moduleSettings.scale)
if (not self.frame.texture) then
self.frame.texture = self.frame:CreateTexture()
self.frame.texture:SetTexture(IceElement.TexturePath .. "smooth")
self.frame.texture:SetVertexColor(0.2, 0.2, 0.2, 0.3)
self.frame.texture:SetAllPoints(self.frame)
end
self.frame.unit = self.unit -- for blizz default tooltip handling
@ -198,7 +210,6 @@ function TargetOfTarget.prototype:CreateFrame()
-- click casting support
ClickCastFrames = ClickCastFrames or {}
ClickCastFrames[self.frame] = true
end
@ -215,20 +226,20 @@ function TargetOfTarget.prototype:CreateBarFrame()
if (not self.frame.bar.texture) then
self.frame.bar.texture = self.frame.bar:CreateTexture()
self.frame.bar.texture:SetTexture(IceElement.TexturePath .. "smooth")
self.frame.bar.texture:SetAllPoints(self.frame.bar)
self.frame.bar:SetStatusBarTexture(self.frame.bar.texture)
end
self.frame.bar.texture:SetTexture(SML:Fetch(SML.MediaType.STATUSBAR, self.moduleSettings.texture))
self.frame.bar.texture:SetAllPoints(self.frame.bar)
self.frame.bar:SetStatusBarTexture(self.frame.bar.texture)
if (not self.frame.bar.highLight) then
self.frame.bar.highLight = self.frame.bar:CreateTexture(nil, "OVERLAY")
self.frame.bar.highLight:SetTexture("Interface\\QuestFrame\\UI-QuestTitleHighlight")
self.frame.bar.highLight:SetBlendMode("ADD")
self.frame.bar.highLight:SetAllPoints(self.frame.bar)
self.frame.bar.highLight:SetVertexColor(1, 1, 1, 0.3)
self.frame.bar.highLight:Hide()
end
self.frame.bar.highLight:SetTexture("Interface\\QuestFrame\\UI-QuestTitleHighlight")
self.frame.bar.highLight:SetBlendMode("ADD")
self.frame.bar.highLight:SetAllPoints(self.frame.bar)
self.frame.bar.highLight:SetVertexColor(1, 1, 1, 0.3)
self.frame.bar.highLight:Hide()
self.frame.bar:Show()
@ -236,7 +247,7 @@ end
function TargetOfTarget.prototype:CreateToTFrame()
self.frame.totName = self:FontFactory("Bold", self.moduleSettings.fontSize, self.frame.bar, self.frame.totName)
self.frame.totName = self:FontFactory(self.moduleSettings.fontSize, self.frame.bar, self.frame.totName)
self.frame.totName:SetWidth(self.settings.gap-40)
self.frame.totName:SetHeight(self.height)
@ -249,7 +260,7 @@ end
function TargetOfTarget.prototype:CreateToTHPFrame()
self.frame.totHealth = self:FontFactory("Bold", self.moduleSettings.fontSize, self.frame.bar, self.frame.totHealth)
self.frame.totHealth = self:FontFactory(self.moduleSettings.fontSize, self.frame.bar, self.frame.totHealth)
self.frame.totHealth:SetWidth(40)
self.frame.totHealth:SetHeight(self.height)
@ -293,7 +304,7 @@ function TargetOfTarget.prototype:CreateIconFrames(parent)
buffs[i].texture:SetTexture(nil)
buffs[i].texture:SetAllPoints(buffs[i])
buffs[i].stack = self:FontFactory("Bold", 11, buffs[i], buffs[i].stack, "OUTLINE")
buffs[i].stack = self:FontFactory(11, buffs[i], buffs[i].stack, "OUTLINE")
buffs[i].stack:SetPoint("BOTTOMRIGHT" , buffs[i], "BOTTOMRIGHT", 2, -1)
if (self.moduleSettings.mouse) then

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB