PageRenderTime 58ms CodeModel.GetById 49ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/Tukui/modules/blizzard/font.lua

http://github.com/Asphyxia/Tukui
Lua | 80 lines | 68 code | 9 blank | 3 comment | 5 complexity | e4b0ebff047af6f5072438feccbc3ab6 MD5 | raw file
 1local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
 2local TukuiFonts = CreateFrame("Frame", nil, UIParent)
 3
 4local SetFont = function(obj, font, size, style, r, g, b, sr, sg, sb, sox, soy)
 5	obj:SetFont(font, size, style)
 6	if sr and sg and sb then obj:SetShadowColor(sr, sg, sb) end
 7	if sox and soy then obj:SetShadowOffset(sox, soy) end
 8	if r and g and b then obj:SetTextColor(r, g, b)
 9	elseif r then obj:SetAlpha(r) end
10end
11
12TukuiFonts:RegisterEvent("ADDON_LOADED")
13TukuiFonts:SetScript("OnEvent", function(self, event, addon)
14	if addon ~= "Tukui" then return end
15	
16	local NORMAL     = C.media.font
17	local COMBAT     = C.media.dmgfont
18	local NUMBER     = C.media.font
19	local PIXEL 	 = C.media.pixelfont
20
21	if T.eyefinity then
22		-- damage are huge on eyefinity, so we disable it
23		InterfaceOptionsCombatTextPanelTargetDamage:Hide()
24		InterfaceOptionsCombatTextPanelPeriodicDamage:Hide()
25		InterfaceOptionsCombatTextPanelPetDamage:Hide()
26		InterfaceOptionsCombatTextPanelHealing:Hide()
27		SetCVar("CombatLogPeriodicSpells",0)
28		SetCVar("PetMeleeDamage",0)
29		SetCVar("CombatDamage",0)
30		SetCVar("CombatHealing",0)
31		
32		-- set an invisible font for xp, honor kill, etc
33		local INVISIBLE = [=[Interface\Addons\Tukui\medias\fonts\invisible_font.ttf]=]
34		COMBAT = INVISIBLE
35	end
36
37	UIDROPDOWNMENU_DEFAULT_TEXT_HEIGHT = 12
38	CHAT_FONT_HEIGHTS = {12, 13, 14, 15, 16, 17, 18, 19, 20}
39
40	UNIT_NAME_FONT     = NORMAL
41	NAMEPLATE_FONT     = NORMAL
42	DAMAGE_TEXT_FONT   = COMBAT
43	STANDARD_TEXT_FONT = NORMAL
44
45	-- Base fonts
46	SetFont(GameTooltipHeader,                  NORMAL, 12, "OUTLINE")
47	SetFont(NumberFont_OutlineThick_Mono_Small, NUMBER, 12, "OUTLINE")
48	SetFont(NumberFont_Outline_Huge,            NUMBER, 28, "THICKOUTLINE", 28)
49	SetFont(NumberFont_Outline_Large,           NUMBER, 15, "OUTLINE")
50	SetFont(NumberFont_Outline_Med,             NUMBER, 13, "OUTLINE")
51	SetFont(NumberFont_Shadow_Med,              NORMAL, 12)
52	SetFont(NumberFont_Shadow_Small,            NORMAL, 12)
53	SetFont(QuestFont,                          NORMAL, 14)
54	SetFont(QuestFont_Large,                    NORMAL, 14)
55	SetFont(SystemFont_Large,                   NORMAL, 15)
56	SetFont(SystemFont_Med1,                    NORMAL, 12)
57	SetFont(SystemFont_Med3,                    NORMAL, 13)
58	SetFont(SystemFont_OutlineThick_Huge2,      NORMAL, 20, "THICKOUTLINE")
59	SetFont(SystemFont_Outline_Small,           NUMBER, 12, "OUTLINE")
60	SetFont(SystemFont_Shadow_Large,            NORMAL, 15)
61	SetFont(SystemFont_Shadow_Med1,             NORMAL, 12)
62	SetFont(SystemFont_Shadow_Med3,             NORMAL, 13)
63	SetFont(SystemFont_Shadow_Outline_Huge2,    NORMAL, 20, "OUTLINE")
64	SetFont(SystemFont_Shadow_Small,            NORMAL, 11)
65	SetFont(SystemFont_Small,                   NORMAL, 12)
66	SetFont(SystemFont_Tiny,                    NORMAL, 12)
67	SetFont(Tooltip_Med,                        NORMAL, 12, "THINOUTLINE")
68	SetFont(Tooltip_Small,                      NORMAL, 12, "THINOUTLINE")
69	SetFont(CombatTextFont,                     COMBAT, 100, "OUTLINE") -- number here just increase the font quality.
70	SetFont(SystemFont_Shadow_Huge1,            NORMAL, 20, "THINOUTLINE")
71	SetFont(ZoneTextString,                     NORMAL, 32, "OUTLINE")
72	SetFont(SubZoneTextString,                  NORMAL, 25, "OUTLINE")
73	SetFont(PVPInfoTextString,                  NORMAL, 22, "THINOUTLINE")
74	SetFont(PVPArenaTextString,                 NORMAL, 22, "THINOUTLINE")
75
76	SetFont = nil
77	self:SetScript("OnEvent", nil)
78	self:UnregisterAllEvents()
79	self = nil
80end)