PageRenderTime 142ms CodeModel.GetById 121ms app.highlight 4ms RepoModel.GetById 16ms app.codeStats 0ms

/Tukui/modules/skins/trainer.lua

http://github.com/Asphyxia/Tukui
Lua | 70 lines | 57 code | 12 blank | 1 comment | 4 complexity | 3f17e3cf5c4d4f6fbf131d52da9af04c MD5 | raw file
 1local T, C, L = unpack(select(2, ...))
 2
 3local function LoadSkin()
 4	--Class Trainer Frame
 5	local StripAllTextures = {
 6		"ClassTrainerFrame",
 7		"ClassTrainerScrollFrameScrollChild",
 8		"ClassTrainerFrameSkillStepButton",
 9		"ClassTrainerFrameBottomInset",
10	}
11
12	local buttons = {
13		"ClassTrainerTrainButton",
14	}
15
16	local KillTextures = {
17		"ClassTrainerFrameInset",
18		"ClassTrainerFramePortrait",
19		"ClassTrainerScrollFrameScrollBarBG",
20		"ClassTrainerScrollFrameScrollBarTop",
21		"ClassTrainerScrollFrameScrollBarBottom",
22		"ClassTrainerScrollFrameScrollBarMiddle",
23	}
24
25	for i=1,8 do
26		_G["ClassTrainerScrollFrameButton"..i]:StripTextures()
27		_G["ClassTrainerScrollFrameButton"..i]:StyleButton()
28		_G["ClassTrainerScrollFrameButton"..i.."Icon"]:SetTexCoord(.08, .92, .08, .92)
29		_G["ClassTrainerScrollFrameButton"..i]:CreateBackdrop()
30		_G["ClassTrainerScrollFrameButton"..i].backdrop:Point("TOPLEFT", _G["ClassTrainerScrollFrameButton"..i.."Icon"], "TOPLEFT", -2, 2)
31		_G["ClassTrainerScrollFrameButton"..i].backdrop:Point("BOTTOMRIGHT", _G["ClassTrainerScrollFrameButton"..i.."Icon"], "BOTTOMRIGHT", 2, -2)
32		_G["ClassTrainerScrollFrameButton"..i.."Icon"]:SetParent(_G["ClassTrainerScrollFrameButton"..i].backdrop)
33		
34		_G["ClassTrainerScrollFrameButton"..i].selectedTex:SetTexture(1, 1, 1, 0.3)
35		_G["ClassTrainerScrollFrameButton"..i].selectedTex:ClearAllPoints()
36		_G["ClassTrainerScrollFrameButton"..i].selectedTex:Point("TOPLEFT", 2, -2)
37		_G["ClassTrainerScrollFrameButton"..i].selectedTex:Point("BOTTOMRIGHT", -2, 2)
38	end
39
40	for _, object in pairs(StripAllTextures) do
41		_G[object]:StripTextures()
42	end
43
44	for _, texture in pairs(KillTextures) do
45		_G[texture]:Kill()
46	end
47
48	for i = 1, #buttons do
49		_G[buttons[i]]:StripTextures()
50		T.SkinButton(_G[buttons[i]])
51	end
52	
53	T.SkinDropDownBox(ClassTrainerFrameFilterDropDown, 155)
54
55	ClassTrainerFrame:CreateBackdrop("Transparent")
56	ClassTrainerFrame.backdrop:Point("TOPLEFT", ClassTrainerFrame, "TOPLEFT")
57	ClassTrainerFrame.backdrop:Point("BOTTOMRIGHT", ClassTrainerFrame, "BOTTOMRIGHT")
58	T.SkinCloseButton(ClassTrainerFrameCloseButton,ClassTrainerFrame)
59	ClassTrainerFrameSkillStepButton.icon:SetTexCoord(.08, .92, .08, .92)
60	ClassTrainerFrameSkillStepButton:CreateBackdrop("Transparent")
61	ClassTrainerFrameSkillStepButton.backdrop:Point("TOPLEFT", ClassTrainerFrameSkillStepButton.icon, "TOPLEFT", -2, 2)
62	ClassTrainerFrameSkillStepButton.backdrop:Point("BOTTOMRIGHT", ClassTrainerFrameSkillStepButton.icon, "BOTTOMRIGHT", 2, -2)
63	ClassTrainerFrameSkillStepButton.icon:SetParent(ClassTrainerFrameSkillStepButton.backdrop)
64	
65	ClassTrainerStatusBar:StripTextures()
66	ClassTrainerStatusBar:SetStatusBarTexture(C["media"].normTex)
67	ClassTrainerStatusBar:CreateBackdrop("Transparent")
68end
69
70T.SkinFuncs["Blizzard_TrainerUI"] = LoadSkin