PageRenderTime 218ms CodeModel.GetById 121ms app.highlight 12ms RepoModel.GetById 79ms app.codeStats 0ms

/Tukui/modules/skins/guild.lua

http://github.com/Asphyxia/Tukui
Lua | 267 lines | 216 code | 41 blank | 10 comment | 23 complexity | 41da2854d75c990181609bd3ccc9852e MD5 | raw file
  1local T, C, L = unpack(select(2, ...))
  2
  3local function LoadSkin()
  4	GuildFrame:StripTextures(true)
  5	GuildFrame:SetTemplate("Transparent")
  6	GuildFrame:CreateShadow("Transparent")
  7	GuildLevelFrame:Kill()
  8	
  9	T.SkinCloseButton(GuildMemberDetailCloseButton)
 10	T.SkinCloseButton(GuildFrameCloseButton)
 11	
 12	local striptextures = {
 13		"GuildNewPerksFrame",
 14		"GuildFrameInset",
 15		"GuildFrameBottomInset",
 16		"GuildAllPerksFrame",
 17		"GuildMemberDetailFrame",
 18		"GuildMemberNoteBackground",
 19		"GuildInfoFrameInfo",
 20		"GuildLogContainer",
 21		"GuildLogFrame",
 22		"GuildRewardsFrame",
 23		"GuildMemberOfficerNoteBackground",
 24		"GuildTextEditContainer",
 25		"GuildTextEditFrame",
 26		"GuildRecruitmentRolesFrame",
 27		"GuildRecruitmentAvailabilityFrame",
 28		"GuildRecruitmentInterestFrame",
 29		"GuildRecruitmentLevelFrame",
 30		"GuildRecruitmentCommentFrame",
 31		"GuildRecruitmentCommentInputFrame",
 32		"GuildInfoFrameApplicantsContainer",
 33		"GuildInfoFrameApplicants",
 34		"GuildNewsBossModel",
 35		"GuildNewsBossModelTextFrame",
 36	}
 37	GuildRewardsFrameVisitText:ClearAllPoints()
 38	GuildRewardsFrameVisitText:SetPoint("TOP", GuildRewardsFrame, "TOP", 0, 30)
 39	for _, frame in pairs(striptextures) do
 40		_G[frame]:StripTextures()
 41	end
 42	
 43	GuildNewsBossModel:CreateBackdrop("Transparent")
 44	GuildNewsBossModelTextFrame:CreateBackdrop("Transparent")
 45	GuildNewsBossModelTextFrame.backdrop:Point("TOPLEFT", GuildNewsBossModel.backdrop, "BOTTOMLEFT", 0, -1)
 46	GuildNewsBossModel:Point("TOPLEFT", GuildFrame, "TOPRIGHT", 4, -43)
 47	
 48	local buttons = {
 49		"GuildPerksToggleButton",
 50		"GuildMemberRemoveButton",
 51		"GuildMemberGroupInviteButton",
 52		"GuildAddMemberButton",
 53		"GuildViewLogButton",
 54		"GuildControlButton",
 55		"GuildRecruitmentListGuildButton",
 56		"GuildTextEditFrameAcceptButton",
 57		"GuildRecruitmentInviteButton",
 58		"GuildRecruitmentMessageButton",
 59		"GuildRecruitmentDeclineButton",
 60	}
 61	
 62	for i, button in pairs(buttons) do
 63		if i == 1 then
 64			T.SkinButton(_G[button])
 65		else
 66			T.SkinButton(_G[button], true)
 67		end
 68	end
 69	
 70	local checkbuttons = {
 71		"Quest", 
 72		"Dungeon",
 73		"Raid",
 74		"PvP",
 75		"RP",
 76		"Weekdays",
 77		"Weekends",
 78		"LevelAny",
 79		"LevelMax",
 80	}
 81	
 82	for _, frame in pairs(checkbuttons) do
 83		T.SkinCheckBox(_G["GuildRecruitment"..frame.."Button"])
 84	end
 85	
 86	T.SkinCheckBox(GuildRecruitmentTankButton:GetChildren())
 87	T.SkinCheckBox(GuildRecruitmentHealerButton:GetChildren())
 88	T.SkinCheckBox(GuildRecruitmentDamagerButton:GetChildren())
 89	
 90	for i=1,5 do
 91		T.SkinTab(_G["GuildFrameTab"..i])
 92	end
 93	GuildXPFrame:ClearAllPoints()
 94	GuildXPFrame:Point("TOP", GuildFrame, "TOP", 0, -40)
 95	
 96	T.SkinScrollBar(GuildPerksContainerScrollBar, 4)
 97	
 98	GuildFactionBar:StripTextures()
 99	GuildFactionBar.progress:SetTexture(C["media"].normTex)
100	GuildFactionBar:CreateBackdrop("Transparent")
101	GuildFactionBar.backdrop:Point("TOPLEFT", GuildFactionBar.progress, "TOPLEFT", -2, 2)
102	GuildFactionBar.backdrop:Point("BOTTOMRIGHT", GuildFactionBar, "BOTTOMRIGHT", -2, 0)
103	
104	GuildXPBarLeft:Kill()
105	GuildXPBarRight:Kill()
106	GuildXPBarMiddle:Kill()
107	GuildXPBarBG:Kill()
108	GuildXPBarShadow:Kill()
109	GuildXPBarCap:Kill()
110	GuildXPBar.progress:SetTexture(C["media"].normTex)
111	GuildXPBar:CreateBackdrop("Transparent")
112	GuildXPBar.backdrop:Point("TOPLEFT", GuildXPBar.progress, "TOPLEFT", -2, 2)
113	GuildXPBar.backdrop:Point("BOTTOMRIGHT", GuildXPBar, "BOTTOMRIGHT", -2, 4)
114	
115	GuildLatestPerkButton:StripTextures()
116	GuildLatestPerkButtonIconTexture:SetTexCoord(.08, .92, .08, .92)
117	GuildLatestPerkButtonIconTexture:ClearAllPoints()
118	GuildLatestPerkButtonIconTexture:Point("TOPLEFT", 2, -2)
119	GuildLatestPerkButton:CreateBackdrop("Transparent")
120	GuildLatestPerkButton.backdrop:Point("TOPLEFT", GuildLatestPerkButtonIconTexture, "TOPLEFT", -2, 2)
121	GuildLatestPerkButton.backdrop:Point("BOTTOMRIGHT", GuildLatestPerkButtonIconTexture, "BOTTOMRIGHT", 2, -2)
122	
123	GuildNextPerkButton:StripTextures()
124	GuildNextPerkButtonIconTexture:SetTexCoord(.08, .92, .08, .92)
125	GuildNextPerkButtonIconTexture:ClearAllPoints()
126	GuildNextPerkButtonIconTexture:Point("TOPLEFT", 2, -2)
127	GuildNextPerkButton:CreateBackdrop("Transparent")
128	GuildNextPerkButton.backdrop:Point("TOPLEFT", GuildNextPerkButtonIconTexture, "TOPLEFT", -2, 2)
129	GuildNextPerkButton.backdrop:Point("BOTTOMRIGHT", GuildNextPerkButtonIconTexture, "BOTTOMRIGHT", 2, -2)
130	
131	--Guild Perk buttons list
132	for i=1, 8 do
133		local button = _G["GuildPerksContainerButton"..i]
134		button:StripTextures()
135		
136		if button.icon then
137			button.icon:SetTexCoord(.08, .92, .08, .92)
138			button.icon:ClearAllPoints()
139			button.icon:Point("TOPLEFT", 2, -2)
140			button:CreateBackdrop("Transparent")
141			button.backdrop:Point("TOPLEFT", button.icon, "TOPLEFT", -2, 2)
142			button.backdrop:Point("BOTTOMRIGHT", button.icon, "BOTTOMRIGHT", 2, -2)
143			button.icon:SetParent(button.backdrop)
144		end
145	end
146	
147	--Roster
148	T.SkinScrollBar(GuildRosterContainerScrollBar, 5)
149	T.SkinCheckBox(GuildRosterShowOfflineButton)
150	
151	
152	for i=1, 4 do
153		_G["GuildRosterColumnButton"..i]:StripTextures(true)
154	end
155	
156	T.SkinDropDownBox(GuildRosterViewDropdown, 200)
157	
158	for i=1, 14 do
159		T.SkinButton(_G["GuildRosterContainerButton"..i.."HeaderButton"], true)
160	end
161	
162	--Detail Frame
163	GuildMemberDetailFrame:SetTemplate("Transparent")
164	GuildMemberNoteBackground:SetTemplate("Transparent")
165	GuildMemberOfficerNoteBackground:SetTemplate("Transparent")
166	GuildMemberRankDropdown:SetFrameLevel(GuildMemberRankDropdown:GetFrameLevel() + 5)
167	T.SkinDropDownBox(GuildMemberRankDropdown, 175)
168
169	--News
170	GuildNewsFrame:StripTextures()
171	for i=1, 17 do
172		_G["GuildNewsContainerButton"..i].header:Kill()
173	end
174	
175	GuildNewsFiltersFrame:StripTextures()
176	GuildNewsFiltersFrame:SetTemplate("Transparent")
177	T.SkinCloseButton(GuildNewsFiltersFrameCloseButton)
178	
179	for i=1, 7 do
180		T.SkinCheckBox(_G["GuildNewsFilterButton"..i])
181	end
182	
183	GuildNewsFiltersFrame:Point("TOPLEFT", GuildFrame, "TOPRIGHT", 4, -20)
184	T.SkinScrollBar(GuildNewsContainerScrollBar, 4)
185	
186	--Info Frame
187	T.SkinScrollBar(GuildInfoDetailsFrameScrollBar, 4)
188	
189	for i=1, 3 do
190		_G["GuildInfoFrameTab"..i]:StripTextures()
191	end
192	
193	local backdrop1 = CreateFrame("Frame", nil, GuildInfoFrameInfo)
194	backdrop1:SetTemplate("Transparent")
195	backdrop1:SetFrameLevel(GuildInfoFrameInfo:GetFrameLevel() - 1)
196	backdrop1:Point("TOPLEFT", GuildInfoFrameInfo, "TOPLEFT", 2, -22)
197	backdrop1:Point("BOTTOMRIGHT", GuildInfoFrameInfo, "BOTTOMRIGHT", 0, 200)
198	
199	local backdrop2 = CreateFrame("Frame", nil, GuildInfoFrameInfo)
200	backdrop2:SetTemplate("Transparent")
201	backdrop2:SetFrameLevel(GuildInfoFrameInfo:GetFrameLevel() - 1)
202	backdrop2:Point("TOPLEFT", GuildInfoFrameInfo, "TOPLEFT", 2, -158)
203	backdrop2:Point("BOTTOMRIGHT", GuildInfoFrameInfo, "BOTTOMRIGHT", 0, 118)	
204
205	local backdrop3 = CreateFrame("Frame", nil, GuildInfoFrameInfo)
206	backdrop3:SetTemplate("Transparent")
207	backdrop3:SetFrameLevel(GuildInfoFrameInfo:GetFrameLevel() - 1)
208	backdrop3:Point("TOPLEFT", GuildInfoFrameInfo, "TOPLEFT", 2, -233)
209	backdrop3:Point("BOTTOMRIGHT", GuildInfoFrameInfo, "BOTTOMRIGHT", 0, 3)	
210	
211	GuildRecruitmentCommentInputFrame:SetTemplate("Transparent")
212	
213	for _, button in next, GuildInfoFrameApplicantsContainer.buttons do
214		button.selectedTex:Kill()
215		button:GetHighlightTexture():Kill()
216		button:SetBackdrop(nil)
217	end
218	
219	--Text Edit Frame
220	GuildTextEditFrame:SetTemplate("Transparent")
221	T.SkinScrollBar(GuildTextEditScrollFrameScrollBar, 5)
222	GuildTextEditContainer:SetTemplate("Transparent")
223	for i = 1, GuildTextEditFrame:GetNumChildren() do
224		local child = select(i, GuildTextEditFrame:GetChildren())
225		if child:GetName() == "GuildTextEditFrameCloseButton" and child:GetWidth() < 33 then
226			T.SkinCloseButton(child)
227		elseif child:GetName() == "GuildTextEditFrameCloseButton" then
228			T.SkinButton(child, true)
229		end
230	end
231	
232	--Guild Log
233	T.SkinScrollBar(GuildLogScrollFrameScrollBar, 4)
234	GuildLogFrame:SetTemplate("Transparent")
235
236	--Blizzard has two buttons with the same name, this is a fucked up way of determining that it isn't the other button
237	for i = 1, GuildLogFrame:GetNumChildren() do
238		local child = select(i, GuildLogFrame:GetChildren())
239		local point = select(1, child:GetPoint())
240		if point == "TOPRIGHT" then
241		--if child:GetName() == "GuildLogFrameCloseButton" and child:GetWidth() < 33 then
242			T.SkinCloseButton(child)
243		else
244			T.SkinButton(child, true)
245		end
246	end
247	
248	--Rewards
249	T.SkinScrollBar(GuildRewardsContainerScrollBar, 5)
250	
251	for i=1, 8 do
252		local button = _G["GuildRewardsContainerButton"..i]
253		button:StripTextures()
254		
255		if button.icon then
256			button.icon:SetTexCoord(.08, .92, .08, .92)
257			button.icon:ClearAllPoints()
258			button.icon:Point("TOPLEFT", 2, -2)
259			button:CreateBackdrop("Transparent")
260			button.backdrop:Point("TOPLEFT", button.icon, "TOPLEFT", -2, 2)
261			button.backdrop:Point("BOTTOMRIGHT", button.icon, "BOTTOMRIGHT", 2, -2)
262			button.icon:SetParent(button.backdrop)
263		end
264	end
265end
266
267T.SkinFuncs["Blizzard_GuildUI"] = LoadSkin