PageRenderTime 143ms CodeModel.GetById 81ms app.highlight 4ms RepoModel.GetById 56ms app.codeStats 0ms

/Tukui/modules/skins/quest.lua

http://github.com/Asphyxia/Tukui
Lua | 64 lines | 58 code | 6 blank | 0 comment | 1 complexity | fef02a4ff3f763d9dc7533f9663c5662 MD5 | raw file
 1local T, C, L = unpack(select(2, ...))
 2
 3local function LoadSkin()
 4	QuestFrame:StripTextures(true)
 5	QuestFrameDetailPanel:StripTextures(true)
 6	QuestDetailScrollFrame:StripTextures(true)
 7	QuestDetailScrollChildFrame:StripTextures(true)
 8	QuestRewardScrollFrame:StripTextures(true)
 9	QuestRewardScrollChildFrame:StripTextures(true)
10	QuestFrameProgressPanel:StripTextures(true)
11	QuestFrameRewardPanel:StripTextures(true)
12	QuestFrame:CreateBackdrop("Transparent")
13	QuestFrame.backdrop:Point("TOPLEFT", 6, -8)
14	QuestFrame.backdrop:Point("BOTTOMRIGHT", -20, 65)
15	QuestFrame.backdrop:CreateShadow("Transparent")
16	T.SkinScrollBar(QuestLogDetailScrollFrameScrollBar)
17	T.SkinScrollBar(QuestLogScrollFrameScrollBar, 5)
18	T.SkinButton(QuestFrameAcceptButton, true)
19	T.SkinButton(QuestFrameDeclineButton, true)
20	T.SkinButton(QuestFrameCompleteButton, true)
21	T.SkinButton(QuestFrameGoodbyeButton, true)
22	T.SkinButton(QuestFrameCompleteQuestButton, true)
23	T.SkinCloseButton(QuestFrameCloseButton, QuestFrame.backdrop)
24
25	for i=1, 6 do
26		local button = _G["QuestProgressItem"..i]
27		local texture = _G["QuestProgressItem"..i.."IconTexture"]
28		button:StripTextures()
29		button:StyleButton()
30		button:Width(_G["QuestProgressItem"..i]:GetWidth() - 4)
31		button:SetFrameLevel(button:GetFrameLevel() + 2)
32		texture:SetTexCoord(.08, .92, .08, .92)
33		texture:SetDrawLayer("OVERLAY")
34		texture:Point("TOPLEFT", 2, -2)
35		texture:Size(texture:GetWidth() - 2, texture:GetHeight() - 2)
36		_G["QuestProgressItem"..i.."Count"]:SetDrawLayer("OVERLAY")
37		button:SetTemplate("Transparent")				
38	end
39
40	hooksecurefunc("QuestFrameProgressItems_Update", function()
41		QuestProgressTitleText:SetTextColor(1, 1, 0)
42		QuestProgressText:SetTextColor(1, 1, 1)
43		QuestProgressRequiredItemsText:SetTextColor(1, 1, 0)
44		QuestProgressRequiredMoneyText:SetTextColor(1, 1, 0)
45	end)
46
47	QuestNPCModel:StripTextures()
48	QuestNPCModel:CreateBackdrop("Transparent")
49	QuestNPCModel:Point("TOPLEFT", QuestLogDetailFrame, "TOPRIGHT", 4, -34)
50	QuestNPCModelTextFrame:StripTextures()
51	QuestNPCModelTextFrame:CreateBackdrop("Transparent")
52	QuestNPCModelTextFrame.backdrop:Point("TOPLEFT", QuestNPCModel.backdrop, "BOTTOMLEFT", 0, -2)
53	QuestLogDetailFrame:StripTextures()
54	QuestLogDetailFrame:SetTemplate("Transparent")
55	QuestLogDetailScrollFrame:StripTextures()
56	T.SkinCloseButton(QuestLogDetailFrameCloseButton)
57
58	hooksecurefunc("QuestFrame_ShowQuestPortrait", function(parentFrame, portrait, text, name, x, y)
59		QuestNPCModel:ClearAllPoints();
60		QuestNPCModel:SetPoint("TOPLEFT", parentFrame, "TOPRIGHT", x + 18, y);			
61	end)
62end
63
64tinsert(T.SkinFuncs["Tukui"], LoadSkin)