PageRenderTime 124ms CodeModel.GetById 60ms app.highlight 8ms RepoModel.GetById 52ms app.codeStats 0ms

/Tukui/modules/skins/calendar.lua

http://github.com/Asphyxia/Tukui
Lua | 176 lines | 128 code | 40 blank | 8 comment | 4 complexity | 6d37c3a5b4e6bd2c0d062f38a6a58ba4 MD5 | raw file
  1local T, C, L = unpack(select(2, ...))
  2
  3local function LoadSkin()
  4	local frames = {
  5		"CalendarFrame",
  6	}
  7	
  8	for _, frame in pairs(frames) do
  9		_G[frame]:StripTextures()
 10	end
 11	
 12	CalendarFrame:SetTemplate("Transparent")
 13	T.SkinCloseButton(CalendarCloseButton)
 14	CalendarCloseButton:Point("TOPRIGHT", CalendarFrame, "TOPRIGHT", -4, -4)
 15	
 16	T.SkinNextPrevButton(CalendarPrevMonthButton)
 17	T.SkinNextPrevButton(CalendarNextMonthButton)
 18	
 19	do --Handle drop down button, this one is differant than the others
 20		local frame = CalendarFilterFrame
 21		local button = CalendarFilterButton
 22
 23		frame:StripTextures()
 24		frame:Width(155)
 25		
 26		_G[frame:GetName().."Text"]:ClearAllPoints()
 27		_G[frame:GetName().."Text"]:Point("RIGHT", button, "LEFT", -2, 0)
 28
 29		
 30		button:ClearAllPoints()
 31		button:Point("RIGHT", frame, "RIGHT", -10, 3)
 32		button.SetPoint = T.dummy
 33		
 34		T.SkinNextPrevButton(button, true)
 35		
 36		frame:CreateBackdrop("Default")
 37		frame.backdrop:Point("TOPLEFT", 20, 2)
 38		frame.backdrop:Point("BOTTOMRIGHT", button, "BOTTOMRIGHT", 2, -2)
 39	end
 40	
 41	
 42	--backdrop
 43	local bg = CreateFrame("Frame", "CalendarFrameBackdrop", CalendarFrame)
 44	bg:SetTemplate("Default")
 45	bg:Point("TOPLEFT", 10, -72)
 46	bg:Point("BOTTOMRIGHT", -8, 3)
 47	
 48	CalendarContextMenu:SetTemplate("Default")
 49	CalendarContextMenu.SetBackdropColor = T.dummy
 50	CalendarContextMenu.SetBackdropBorderColor = T.dummy
 51	
 52	--Boost frame levels
 53	for i=1, 42 do
 54		_G["CalendarDayButton"..i]:SetFrameLevel(_G["CalendarDayButton"..i]:GetFrameLevel() + 1)
 55	end
 56	
 57	--CreateEventFrame
 58	CalendarCreateEventFrame:StripTextures()
 59	CalendarCreateEventFrame:SetTemplate("Transparent")
 60	CalendarCreateEventFrame:Point("TOPLEFT", CalendarFrame, "TOPRIGHT", 3, -24)
 61	CalendarCreateEventTitleFrame:StripTextures()
 62	
 63	T.SkinButton(CalendarCreateEventCreateButton, true)
 64	T.SkinButton(CalendarCreateEventMassInviteButton, true)
 65	T.SkinButton(CalendarCreateEventInviteButton, true)
 66	CalendarCreateEventInviteButton:Point("TOPLEFT", CalendarCreateEventInviteEdit, "TOPRIGHT", 4, 1)
 67	CalendarCreateEventInviteEdit:Width(CalendarCreateEventInviteEdit:GetWidth() - 2)
 68	
 69	CalendarCreateEventInviteList:StripTextures()
 70	CalendarCreateEventInviteList:SetTemplate("Default")
 71	
 72	T.SkinEditBox(CalendarCreateEventInviteEdit)
 73	T.SkinEditBox(CalendarCreateEventTitleEdit)
 74	T.SkinDropDownBox(CalendarCreateEventTypeDropDown, 120)
 75	
 76	CalendarCreateEventDescriptionContainer:StripTextures()
 77	CalendarCreateEventDescriptionContainer:SetTemplate("Default")
 78	
 79	T.SkinCloseButton(CalendarCreateEventCloseButton)
 80	
 81	T.SkinCheckBox(CalendarCreateEventLockEventCheck)
 82	
 83	T.SkinDropDownBox(CalendarCreateEventHourDropDown, 68)
 84	T.SkinDropDownBox(CalendarCreateEventMinuteDropDown, 68)
 85	T.SkinDropDownBox(CalendarCreateEventAMPMDropDown, 68)
 86	T.SkinDropDownBox(CalendarCreateEventRepeatOptionDropDown, 120)
 87	CalendarCreateEventIcon:SetTexCoord(.08, .92, .08, .92)
 88	CalendarCreateEventIcon.SetTexCoord = T.dummy
 89	
 90	CalendarCreateEventInviteListSection:StripTextures()
 91	
 92	CalendarClassButtonContainer:HookScript("OnShow", function()
 93		for i, class in ipairs(CLASS_SORT_ORDER) do
 94			local button = _G["CalendarClassButton"..i]
 95			button:StripTextures()
 96			button:CreateBackdrop("Default")
 97			
 98			local tcoords = CLASS_ICON_TCOORDS[class]
 99			local buttonIcon = button:GetNormalTexture()
100			buttonIcon:SetTexture("Interface\\Glues\\CharacterCreate\\UI-CharacterCreate-Classes")
101			buttonIcon:SetTexCoord(tcoords[1] + 0.015, tcoords[2] - 0.02, tcoords[3] + 0.018, tcoords[4] - 0.02) --F U C K I N G H A X
102		end
103		
104		CalendarClassButton1:Point("TOPLEFT", CalendarClassButtonContainer, "TOPLEFT", 5, 0)
105		
106		CalendarClassTotalsButton:StripTextures()
107		CalendarClassTotalsButton:CreateBackdrop("Default")
108	end)
109	
110	--Texture Picker Frame
111	CalendarTexturePickerFrame:StripTextures()
112	CalendarTexturePickerTitleFrame:StripTextures()
113	
114	CalendarTexturePickerFrame:SetTemplate("Transparent")
115	
116	T.SkinScrollBar(CalendarTexturePickerScrollBar)
117	T.SkinButton(CalendarTexturePickerAcceptButton, true)
118	T.SkinButton(CalendarTexturePickerCancelButton, true)
119	T.SkinButton(CalendarCreateEventInviteButton, true)
120	T.SkinButton(CalendarCreateEventRaidInviteButton, true)
121	
122	--Mass Invite Frame
123	CalendarMassInviteFrame:StripTextures()
124	CalendarMassInviteFrame:SetTemplate("Transparent")
125	CalendarMassInviteTitleFrame:StripTextures()
126	
127	T.SkinCloseButton(CalendarMassInviteCloseButton)
128	T.SkinButton(CalendarMassInviteGuildAcceptButton)
129	T.SkinButton(CalendarMassInviteArenaButton2)
130	T.SkinButton(CalendarMassInviteArenaButton3)
131	T.SkinButton(CalendarMassInviteArenaButton5)
132	T.SkinDropDownBox(CalendarMassInviteGuildRankMenu, 130)
133	
134	T.SkinEditBox(CalendarMassInviteGuildMinLevelEdit)
135	T.SkinEditBox(CalendarMassInviteGuildMaxLevelEdit)
136	
137	--Raid View
138	CalendarViewRaidFrame:StripTextures()
139	CalendarViewRaidFrame:SetTemplate("Transparent")
140	CalendarViewRaidFrame:Point("TOPLEFT", CalendarFrame, "TOPRIGHT", 3, -24)
141	CalendarViewRaidTitleFrame:StripTextures()
142	T.SkinCloseButton(CalendarViewRaidCloseButton)
143	
144	--Holiday View
145	CalendarViewHolidayFrame:StripTextures(true)
146	CalendarViewHolidayFrame:SetTemplate("Transparent")
147	CalendarViewHolidayFrame:Point("TOPLEFT", CalendarFrame, "TOPRIGHT", 3, -24)
148	CalendarViewHolidayTitleFrame:StripTextures()
149	T.SkinCloseButton(CalendarViewHolidayCloseButton)
150	
151	-- Event View
152	CalendarViewEventFrame:StripTextures()
153	CalendarViewEventFrame:SetTemplate("Transparent")
154	CalendarViewEventFrame:Point("TOPLEFT", CalendarFrame, "TOPRIGHT", 3, -24)
155	CalendarViewEventTitleFrame:StripTextures()
156	CalendarViewEventDescriptionContainer:StripTextures()
157	CalendarViewEventDescriptionContainer:SetTemplate("Transparent")
158	CalendarViewEventInviteList:StripTextures()
159	CalendarViewEventInviteList:SetTemplate("Transparent")
160	CalendarViewEventInviteListSection:StripTextures()
161	T.SkinCloseButton(CalendarViewEventCloseButton)
162	T.SkinScrollBar(CalendarViewEventInviteListScrollFrameScrollBar)
163	
164	local buttons = {
165		"CalendarViewEventAcceptButton",
166		"CalendarViewEventTentativeButton",
167		"CalendarViewEventRemoveButton",
168		"CalendarViewEventDeclineButton",
169	}
170
171	for _, button in pairs(buttons) do
172		T.SkinButton(_G[button])
173	end	
174end
175
176T.SkinFuncs["Blizzard_Calendar"] = LoadSkin