/Interface/AddOns/hankui/media
error("Opacity must be a number 0 - 1.0") |
end |
tempColor = tempColor or CreateColor(1, 1, 1) |
if not tempColor then tempColor = CreateColor(1, 1, 1) end |
tempColor[1] = self[1] |
tempColor[2] = self[2] |
tempColor[3] = self[3] |
error("Opacity must be a number 0 - 1.0") |
end |
tempColor = tempColor or CreateColor(1, 1, 1) |
if not tempColor then tempColor = CreateColor(1, 1, 1) end |
tempColor[4] = self[4] |
if mode == "MULTIPLY" then |
error("Brightness must be a number -1.0 - 1.0") |
end |
tempColor = tempColor or CreateColor(1, 1, 1) |
if not tempColor then tempColor = CreateColor(1, 1, 1) end |
tempColor[1] = self[1] + brightness > 1 and 1 or (self[1] + brightness < 0 and 0 or self[1] + brightness) |
tempColor[2] = self[2] + brightness > 1 and 1 or (self[2] + brightness < 0 and 0 or self[2] + brightness) |
tempColor[3] = self[3] + brightness > 1 and 1 or (self[3] + brightness < 0 and 0 or self[3] + brightness) |
or (string.find(fonts.masterfont or "", "\\") ~= nil and fonts.masterfont or media.font[fonts.masterfont]) |
fontObject:SetFont(font, size or oldSize, flags or oldFlags) |
if color then fontObject:SetTextColor(unpack(color)) end |
if color then |
color = CreateColor(color) |
fontObject:SetTextColor(unpack(color)) |
end |
if shadowx and shadowy then fontObject:SetShadowOffset(shadowx, shadowy) end |
end |
--GameFontHighlight = {nil, nil, nil, colors["Signature color"]}, |
--GameFontHighlightSmall = {nil, nil, nil, colors["Signature color"]}, |
ErrorFont = {nil, 14, "OUTLINE"}, -- "Canal Crab 9/10", "Spell is not ready yet" etc. |
ZoneTextFont = {"DIN Pro Black"}, -- "Stormwind" |
SubZoneTextFont = {"DIN Pro Black", 26, "THICKOUTLINE"}, -- "Trade District" |
}, { |
-- Whenever a font is added to the collection immediately apply it |
__newindex = function(tbl, key, val) |
local font, size, flags = unpack(val) |
local font, size, flags, color, shadowx, shadowy = unpack(val) |
rawset(tbl, key, val) |
if not _G[key] then |
CreateFont(key) |
SetFont(_G[key], font, size or 12, flags or "") |
SetFont(_G[key], font, size or 12, flags or "", color, shadowx, shadowy) |
else |
SetFont(_G[key], font, size, flags) |
SetFont(_G[key], font, size, flags, color, shadowx, shadowy) |
end |
end |
}) |