PageRenderTime 82ms CodeModel.GetById 40ms app.highlight 4ms RepoModel.GetById 36ms app.codeStats 0ms

/Tukui/modules/skins/guildcontrol.lua

http://github.com/Asphyxia/Tukui
Lua | 76 lines | 62 code | 14 blank | 0 comment | 9 complexity | a1a685f2be0e5b5c237dd52434a03990 MD5 | raw file
 1local T, C, L = unpack(select(2, ...))
 2
 3local function LoadSkin()
 4	GuildControlUI:StripTextures()
 5	GuildControlUIHbar:StripTextures()
 6	GuildControlUI:SetTemplate("Transparent")
 7	GuildControlUI:CreateShadow("Transparent")
 8	
 9	local function SkinGuildRanks()
10		for i=1, GuildControlGetNumRanks() do
11			local rankFrame = _G["GuildControlUIRankOrderFrameRank"..i]
12			if rankFrame then
13				T.SkinButton(rankFrame.downButton)
14				T.SkinButton(rankFrame.upButton)
15				T.SkinButton(rankFrame.deleteButton)
16				
17				if not rankFrame.nameBox.backdrop then
18					T.SkinEditBox(rankFrame.nameBox)
19				end
20				
21				rankFrame.nameBox.backdrop:Point("TOPLEFT", -2, -4)
22				rankFrame.nameBox.backdrop:Point("BOTTOMRIGHT", -4, 4)
23			end
24		end				
25	end
26	hooksecurefunc("GuildControlUI_RankOrder_Update", SkinGuildRanks)
27	GuildControlUIRankOrderFrameNewButton:HookScript("OnClick", function()
28		T.Delay(1, SkinGuildRanks)
29	end)
30	
31	T.SkinDropDownBox(GuildControlUINavigationDropDown)
32	T.SkinDropDownBox(GuildControlUIRankSettingsFrameRankDropDown, 180)
33	GuildControlUINavigationDropDownButton:Width(20)
34	GuildControlUIRankSettingsFrameRankDropDownButton:Width(20)
35	
36	for i=1, NUM_RANK_FLAGS do
37		if _G["GuildControlUIRankSettingsFrameCheckbox"..i] then
38			T.SkinCheckBox(_G["GuildControlUIRankSettingsFrameCheckbox"..i])
39		end
40	end
41	
42	T.SkinButton(GuildControlUIRankOrderFrameNewButton)
43	
44	T.SkinEditBox(GuildControlUIRankSettingsFrameGoldBox)
45	GuildControlUIRankSettingsFrameGoldBox.backdrop:Point("TOPLEFT", -2, -4)
46	GuildControlUIRankSettingsFrameGoldBox.backdrop:Point("BOTTOMRIGHT", 2, 4)
47	GuildControlUIRankSettingsFrameGoldBox:StripTextures()
48	
49	GuildControlUIRankBankFrame:StripTextures()
50	
51	local once = false
52	hooksecurefunc("GuildControlUI_BankTabPermissions_Update", function()
53		local numTabs = GetNumGuildBankTabs()
54		if numTabs < MAX_BUY_GUILDBANK_TABS then
55			numTabs = numTabs + 1
56		end
57		for i=1, numTabs do
58			local tab = _G["GuildControlBankTab"..i.."Owned"]
59			local icon = tab.tabIcon
60			local editbox = tab.editBox
61			
62			icon:SetTexCoord(.08, .92, .08, .92)
63			
64			if once == false then
65				T.SkinButton(_G["GuildControlBankTab"..i.."BuyPurchaseButton"])
66				_G["GuildControlBankTab"..i.."OwnedStackBox"]:StripTextures()
67			end
68		end
69		once = true
70	end)
71	
72	T.SkinDropDownBox(GuildControlUIRankBankFrameRankDropDown, 180)
73	GuildControlUIRankBankFrameRankDropDownButton:Width(20)
74end
75
76T.SkinFuncs["Blizzard_GuildControlUI"] = LoadSkin