Quest.lua 17.5 KB
Newer Older
Azilroka's avatar
Azilroka committed
1
local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
2 3
local S = E:GetModule('Skins')

4
local _G = _G
Simpy's avatar
Simpy committed
5
local gsub, pairs, ipairs, select, unpack, strfind = gsub, pairs, ipairs, select, unpack, strfind
Simpy's avatar
nothing  
Simpy committed
6

7
local C_QuestLog_GetNextWaypointText = C_QuestLog.GetNextWaypointText
8
local C_QuestLog_GetSelectedQuest = C_QuestLog.GetSelectedQuest
Merathilis's avatar
Merathilis committed
9
local GetMoney = GetMoney
Simpy's avatar
stuff  
Simpy committed
10
local CreateFrame = CreateFrame
11
local GetQuestID = GetQuestID
12
local GetQuestLogRequiredMoney = GetQuestLogRequiredMoney
Simpy's avatar
Simpy committed
13 14
local GetQuestLogLeaderBoard = GetQuestLogLeaderBoard
local GetNumQuestLeaderBoards = GetNumQuestLeaderBoards
15 16
local GetNumQuestLogRewardSpells = GetNumQuestLogRewardSpells
local GetNumRewardSpells = GetNumRewardSpells
Simpy's avatar
cache  
Simpy committed
17
local hooksecurefunc = hooksecurefunc
18

19
local function HandleReward(frame)
Simpy's avatar
Simpy committed
20
	if not frame then return end
21

Azilroka's avatar
Azilroka committed
22
	if frame.Icon then
Azilroka's avatar
Azilroka committed
23
		frame.Icon:SetDrawLayer('ARTWORK')
Azilroka's avatar
Azilroka committed
24
		S:HandleIcon(frame.Icon, true)
Azilroka's avatar
Azilroka committed
25
	end
26

Azilroka's avatar
Azilroka committed
27
	if frame.IconBorder then
28
		frame.IconBorder:Kill()
Azilroka's avatar
Azilroka committed
29 30 31 32
	end

	if frame.Count then
		frame.Count:SetDrawLayer('OVERLAY')
Azilroka's avatar
Azilroka committed
33
		frame.Count:ClearAllPoints()
Simpy's avatar
Simpy committed
34
		frame.Count:Point('BOTTOMRIGHT', frame.Icon, 'BOTTOMRIGHT', 0, 0)
Azilroka's avatar
Azilroka committed
35 36 37 38
	end

	if frame.NameFrame then
		frame.NameFrame:SetAlpha(0)
Azilroka's avatar
Azilroka committed
39 40 41 42 43
		frame.NameFrame:Hide()
	end

	if frame.IconOverlay then
		frame.IconOverlay:SetAlpha(0)
Azilroka's avatar
Azilroka committed
44 45 46
	end

	if frame.Name then
Azilroka's avatar
Azilroka committed
47
		frame.Name:FontTemplate()
Azilroka's avatar
Azilroka committed
48 49
	end

Azilroka's avatar
Azilroka committed
50
	if frame.CircleBackground then
51 52 53
		frame.CircleBackground:SetAlpha(0)
		frame.CircleBackgroundGlow:SetAlpha(0)
	end
Azilroka's avatar
Azilroka committed
54 55 56 57 58 59 60

	for i = 1, frame:GetNumRegions() do
		local Region = select(i, frame:GetRegions())
		if Region and Region:IsObjectType('Texture') and Region:GetTexture() == [[Interface\Spellbook\Spellbook-Parts]] then
			Region:SetTexture('')
		end
	end
61 62
end

63
local function StyleScrollFrame(scrollFrame, widthOverride, heightOverride, inset)
64 65 66
	if not scrollFrame.backdrop then
		scrollFrame:CreateBackdrop()
	end
Simpy's avatar
Simpy committed
67

Azilroka's avatar
Azilroka committed
68
	if not scrollFrame.spellTex then
69
		scrollFrame.spellTex = scrollFrame:CreateTexture(nil, 'BACKGROUND', 1)
Azilroka's avatar
Azilroka committed
70 71
	end

72 73 74 75 76 77 78 79 80 81 82 83
	local parent = scrollFrame:GetParent()
	if parent.SealMaterialBG and parent.SealMaterialBG:IsShown() then
		scrollFrame.spellTex:Hide()
		scrollFrame.backdrop:Hide()
	else
		scrollFrame.backdrop:Show()
		scrollFrame.spellTex:Show()
		scrollFrame.spellTex:SetTexture([[Interface\QuestFrame\QuestBG]])
		scrollFrame.spellTex:Point('TOPLEFT', inset and 1 or 0, inset and -1 or 0)
		scrollFrame.spellTex:Size(widthOverride or 506, heightOverride or 615)
		scrollFrame.spellTex:SetTexCoord(0, 1, 0.02, 1)
	end
84 85
end

Merathilis's avatar
Merathilis committed
86
-- Quest objective text color
87 88
local function Quest_GetQuestID()
	if _G.QuestInfoFrame.questLog then
89
		return C_QuestLog_GetSelectedQuest()
90 91 92 93 94
	else
		return GetQuestID()
	end
end

Simpy's avatar
Simpy committed
95
function S:BlizzardQuestFrames()
Simpy's avatar
-.-  
Simpy committed
96
	if not (E.private.skins.blizzard.enable and E.private.skins.blizzard.quest) then return end
97

98 99 100 101 102 103
	S:HandleScrollBar(_G.QuestProgressScrollFrameScrollBar)
	S:HandleScrollBar(_G.QuestRewardScrollFrameScrollBar)
	S:HandleScrollBar(_G.QuestDetailScrollFrameScrollBar)
	_G.QuestProgressScrollFrame:StripTextures()
	_G.QuestGreetingScrollFrame:StripTextures()
	S:HandleScrollBar(_G.QuestGreetingScrollFrameScrollBar)
104

105
	local QuestInfoSkillPointFrame = _G.QuestInfoSkillPointFrame
106 107
	QuestInfoSkillPointFrame:StripTextures()
	QuestInfoSkillPointFrame:StyleButton()
Simpy's avatar
Simpy committed
108
	QuestInfoSkillPointFrame:Width(QuestInfoSkillPointFrame:GetWidth() - 4)
109
	QuestInfoSkillPointFrame:SetFrameLevel(QuestInfoSkillPointFrame:GetFrameLevel() + 2)
110 111

	local QuestInfoSkillPointFrameIconTexture = _G.QuestInfoSkillPointFrameIconTexture
112
	QuestInfoSkillPointFrameIconTexture:SetTexCoord(unpack(E.TexCoords))
Simpy's avatar
Simpy committed
113
	QuestInfoSkillPointFrameIconTexture:SetDrawLayer('OVERLAY')
Simpy's avatar
Simpy committed
114 115
	QuestInfoSkillPointFrameIconTexture:Point('TOPLEFT', 2, -2)
	QuestInfoSkillPointFrameIconTexture:Size(QuestInfoSkillPointFrameIconTexture:GetWidth() - 2, QuestInfoSkillPointFrameIconTexture:GetHeight() - 2)
116
	QuestInfoSkillPointFrame:CreateBackdrop()
Simpy's avatar
Simpy committed
117
	_G.QuestInfoSkillPointFrameCount:SetDrawLayer('OVERLAY')
118

119
	local QuestInfoItemHighlight = _G.QuestInfoItemHighlight
120
	QuestInfoItemHighlight:StripTextures()
Simpy's avatar
Simpy committed
121 122
	QuestInfoItemHighlight:CreateBackdrop()
	QuestInfoItemHighlight.backdrop:SetAllPoints()
Simpy's avatar
Simpy committed
123 124
	QuestInfoItemHighlight.backdrop:SetBackdropBorderColor(1, 1, 0)
	QuestInfoItemHighlight.backdrop:SetBackdropColor(0, 0, 0, 0)
Simpy's avatar
Simpy committed
125
	QuestInfoItemHighlight:Size(142, 40)
126

Simpy's avatar
Simpy committed
127
	hooksecurefunc('QuestInfoItem_OnClick', function(s)
128
		QuestInfoItemHighlight:ClearAllPoints()
129
		QuestInfoItemHighlight:SetOutside(s.Icon)
130

Simpy's avatar
Simpy committed
131
		for _, Button in ipairs(_G.QuestInfoRewardsFrame.RewardButtons) do
Azilroka's avatar
Azilroka committed
132
			Button.Name:SetTextColor(1, 1, 1)
133
		end
Azilroka's avatar
Azilroka committed
134

135
		s.Name:SetTextColor(1, .8, .1)
136 137
	end)

138
	_G.QuestRewardScrollFrame:CreateBackdrop()
Simpy's avatar
Simpy committed
139
	_G.QuestRewardScrollFrame:Height(_G.QuestRewardScrollFrame:GetHeight() - 2)
140

Simpy's avatar
Simpy committed
141
	hooksecurefunc('QuestInfo_Display', function()
142 143
		for i = 1, #_G.QuestInfoRewardsFrame.RewardButtons do
			local questItem = _G.QuestInfoRewardsFrame.RewardButtons[i]
144 145
			if not questItem:IsShown() then break end

Rubgrsch's avatar
Rubgrsch committed
146
			local point, relativeTo, relativePoint, _, y = questItem:GetPoint()
147 148
			if point and relativeTo and relativePoint then
				if i == 1 then
Simpy's avatar
Simpy committed
149
					questItem:Point(point, relativeTo, relativePoint, 0, y)
Simpy's avatar
Simpy committed
150
				elseif relativePoint == 'BOTTOMLEFT' then
Simpy's avatar
Simpy committed
151
					questItem:Point(point, relativeTo, relativePoint, 0, -4)
152
				else
Simpy's avatar
Simpy committed
153
					questItem:Point(point, relativeTo, relativePoint, 4, 0)
154 155 156 157 158
				end
			end

			questItem.Name:SetTextColor(1, 1, 1)
		end
159 160 161 162 163 164

		local rewardsFrame = _G.QuestInfoFrame.rewardsFrame
		local isQuestLog = _G.QuestInfoFrame.questLog ~= nil

		local numSpellRewards = isQuestLog and GetNumQuestLogRewardSpells() or GetNumRewardSpells()
		if numSpellRewards > 0 then
Azilroka's avatar
Azilroka committed
165
			if E.private.skins.parchmentRemoverEnable then
Simpy's avatar
Simpy committed
166
				for spellHeader in rewardsFrame.spellHeaderPool:EnumerateActive() do
167 168
					spellHeader:SetVertexColor(1, 1, 1)
				end
Simpy's avatar
Simpy committed
169
				for spellIcon in rewardsFrame.spellRewardPool:EnumerateActive() do
Azilroka's avatar
Azilroka committed
170 171
					HandleReward(spellIcon)
				end
172 173
			end

174 175 176 177
			for followerReward in rewardsFrame.followerRewardPool:EnumerateActive() do
				if not followerReward.isSkinned then
					followerReward:CreateBackdrop()
					followerReward.backdrop:SetAllPoints(followerReward.BG)
Simpy's avatar
Simpy committed
178 179
					followerReward.backdrop:Point('TOPLEFT', 40, -5)
					followerReward.backdrop:Point('BOTTOMRIGHT', 2, 5)
180 181 182
					followerReward.BG:Hide()

					followerReward.PortraitFrame:ClearAllPoints()
Simpy's avatar
Simpy committed
183
					followerReward.PortraitFrame:Point('RIGHT', followerReward.backdrop, 'LEFT', -2, 0)
184 185 186 187 188 189 190 191

					followerReward.PortraitFrame.PortraitRing:Hide()
					followerReward.PortraitFrame.PortraitRingQuality:SetTexture()
					followerReward.PortraitFrame.LevelBorder:SetAlpha(0)
					followerReward.PortraitFrame.Portrait:SetTexCoord(0.2, 0.85, 0.2, 0.85)

					local level = followerReward.PortraitFrame.Level
					level:ClearAllPoints()
Simpy's avatar
Simpy committed
192
					level:Point('BOTTOM', followerReward.PortraitFrame, 0, 3)
193

Simpy's avatar
Simpy committed
194
					local squareBG = CreateFrame('Frame', nil, followerReward.PortraitFrame, 'BackdropTemplate')
195
					squareBG:SetFrameLevel(followerReward.PortraitFrame:GetFrameLevel()-1)
Simpy's avatar
Simpy committed
196 197
					squareBG:Point('TOPLEFT', 2, -2)
					squareBG:Point('BOTTOMRIGHT', -2, 2)
198 199 200 201 202 203 204
					squareBG:SetTemplate()
					followerReward.PortraitFrame.squareBG = squareBG

					followerReward.isSkinned = true
				end

				local r, g, b = followerReward.PortraitFrame.PortraitRingQuality:GetVertexColor()
Simpy's avatar
Simpy committed
205
				followerReward.PortraitFrame.squareBG:SetBackdropBorderColor(r, g, b)
206 207 208
			end
		end

Azilroka's avatar
Azilroka committed
209
		if E.private.skins.parchmentRemoverEnable then
210 211 212 213 214 215 216 217 218 219 220
			_G.QuestInfoTitleHeader:SetTextColor(1, .8, .1)
			_G.QuestInfoDescriptionHeader:SetTextColor(1, .8, .1)
			_G.QuestInfoObjectivesHeader:SetTextColor(1, .8, .1)
			_G.QuestInfoRewardsFrame.Header:SetTextColor(1, .8, .1)
			_G.QuestInfoDescriptionText:SetTextColor(1, 1, 1)
			_G.QuestInfoObjectivesText:SetTextColor(1, 1, 1)
			_G.QuestInfoGroupSize:SetTextColor(1, 1, 1)
			_G.QuestInfoRewardText:SetTextColor(1, 1, 1)
			_G.QuestInfoQuestType:SetTextColor(1, 1, 1)
			_G.QuestInfoRewardsFrame.ItemChooseText:SetTextColor(1, 1, 1)
			_G.QuestInfoRewardsFrame.ItemReceiveText:SetTextColor(1, 1, 1)
Merathilis's avatar
Merathilis committed
221

Merathilis's avatar
Merathilis committed
222
			-- 9.0 Shadowlands Objective Text Colors
Simpy's avatar
Simpy committed
223
			local function handleObjectives()
Simpy's avatar
Simpy committed
224 225 226 227 228 229 230 231 232
				local numObjectives = GetNumQuestLeaderBoards()
				local questID = Quest_GetQuestID()
				local numVisibleObjectives = 0

				local waypointText = C_QuestLog_GetNextWaypointText(questID)
				if waypointText then
					numVisibleObjectives = numVisibleObjectives + 1
					local objective = _G['QuestInfoObjective'..numVisibleObjectives]
					objective:SetTextColor(1, .8, .1)
Merathilis's avatar
Merathilis committed
233
				end
Simpy's avatar
Simpy committed
234

Simpy's avatar
Simpy committed
235
				for i = 1, numObjectives do
Simpy's avatar
Simpy committed
236
					local _, objectiveType, isCompleted = GetQuestLogLeaderBoard(i)
Simpy's avatar
Simpy committed
237
					if objectiveType ~= 'spell' and numVisibleObjectives < _G.MAX_OBJECTIVES then
Simpy's avatar
Simpy committed
238
						numVisibleObjectives = numVisibleObjectives + 1
Simpy's avatar
Simpy committed
239

Simpy's avatar
Simpy committed
240 241
						local objective = _G['QuestInfoObjective'..numVisibleObjectives]
						if objective then
Simpy's avatar
Simpy committed
242
							if isCompleted then
Simpy's avatar
Simpy committed
243 244 245 246 247 248 249
								objective:SetTextColor(1, .8, .1)
							else
								objective:SetTextColor(1, 1, 1)
							end
						end
					end
				end
Simpy's avatar
Simpy committed
250 251 252 253
			end

			hooksecurefunc('QuestInfo_ShowObjectives', handleObjectives)
			handleObjectives()
Merathilis's avatar
Merathilis committed
254

255 256
			if _G.QuestInfoRewardsFrame.SpellLearnText then
				_G.QuestInfoRewardsFrame.SpellLearnText:SetTextColor(1, 1, 1)
Azilroka's avatar
Azilroka committed
257
			end
258 259 260

			_G.QuestInfoRewardsFrame.PlayerTitleText:SetTextColor(1, 1, 1)
			_G.QuestInfoRewardsFrame.XPFrame.ReceiveText:SetTextColor(1, 1, 1)
Simpy's avatar
Simpy committed
261 262 263 264 265 266 267 268 269 270 271 272
		else
			_G.QuestInfoTitleHeader:SetShadowColor(0, 0, 0, 0)
			_G.QuestInfoDescriptionHeader:SetShadowColor(0, 0, 0, 0)
			_G.QuestInfoObjectivesHeader:SetShadowColor(0, 0, 0, 0)
			_G.QuestInfoRewardsFrame.Header:SetShadowColor(0, 0, 0, 0)
			_G.QuestInfoDescriptionText:SetShadowColor(0, 0, 0, 0)
			_G.QuestInfoObjectivesText:SetShadowColor(0, 0, 0, 0)
			_G.QuestInfoGroupSize:SetShadowColor(0, 0, 0, 0)
			_G.QuestInfoRewardText:SetShadowColor(0, 0, 0, 0)
			_G.QuestInfoQuestType:SetShadowColor(0, 0, 0, 0)
			_G.QuestInfoRewardsFrame.ItemChooseText:SetShadowColor(0, 0, 0, 0)
			_G.QuestInfoRewardsFrame.ItemReceiveText:SetShadowColor(0, 0, 0, 0)
Azilroka's avatar
Azilroka committed
273
		end
274 275
	end)

Merathilis's avatar
Merathilis committed
276
	for _, frame in pairs({'HonorFrame', 'XPFrame', 'SpellFrame', 'SkillPointFrame', 'ArtifactXPFrame', 'TitleFrame', 'WarModeBonusFrame'}) do
Azilroka's avatar
Azilroka committed
277 278
		HandleReward(_G.MapQuestInfoRewardsFrame[frame])
		HandleReward(_G.QuestInfoRewardsFrame[frame])
279
	end
280
	HandleReward(_G.MapQuestInfoRewardsFrame.MoneyFrame)
281 282

	-- Hook for WorldQuestRewards / QuestLogRewards
Simpy's avatar
Simpy committed
283
	hooksecurefunc('QuestInfo_GetRewardButton', function(rewardsFrame, index)
Azilroka's avatar
Azilroka committed
284
		local RewardButton = rewardsFrame.RewardButtons[index]
285
		if not RewardButton.Icon.backdrop then
Azilroka's avatar
Azilroka committed
286 287
			HandleReward(RewardButton)
			RewardButton.NameFrame:Hide()
288
			S:HandleIconBorder(RewardButton.IconBorder, RewardButton.Icon.backdrop)
Merathilis's avatar
Merathilis committed
289
		end
290 291
	end)

292
	--Reward: Title
293
	local QuestInfoPlayerTitleFrame = _G.QuestInfoPlayerTitleFrame
Simpy's avatar
Simpy committed
294 295 296
	QuestInfoPlayerTitleFrame.FrameLeft:SetTexture()
	QuestInfoPlayerTitleFrame.FrameCenter:SetTexture()
	QuestInfoPlayerTitleFrame.FrameRight:SetTexture()
297
	QuestInfoPlayerTitleFrame.Icon:SetTexCoord(unpack(E.TexCoords))
298
	QuestInfoPlayerTitleFrame:CreateBackdrop()
299
	QuestInfoPlayerTitleFrame.backdrop:SetOutside(QuestInfoPlayerTitleFrame.Icon)
300 301

	--Quest Frame
302
	local QuestFrame = _G.QuestFrame
Simpy's avatar
Simpy committed
303
	S:HandlePortraitFrame(QuestFrame)
304

305 306
	_G.QuestFrameDetailPanel:StripTextures(true)
	_G.QuestDetailScrollFrame:StripTextures(true)
Simpy's avatar
Simpy committed
307 308 309
	_G.QuestDetailScrollFrame:CreateBackdrop()
	_G.QuestProgressScrollFrame:CreateBackdrop()
	_G.QuestGreetingScrollFrame:CreateBackdrop()
Azilroka's avatar
Azilroka committed
310

Azilroka's avatar
Azilroka committed
311 312
	local function UpdateGreetingFrame()
		for Button in _G.QuestFrameGreetingPanel.titleButtonPool:EnumerateActive() do
Simpy's avatar
Simpy committed
313
			Button.Icon:SetDrawLayer('ARTWORK')
Azilroka's avatar
Azilroka committed
314
			if E.private.skins.parchmentRemoverEnable then
Azilroka's avatar
Azilroka committed
315 316 317 318 319 320 321 322 323
				local Text = Button:GetFontString():GetText()
				if Text and strfind(Text, '|cff000000') then
					Button:GetFontString():SetText(gsub(Text, '|cff000000', '|cffffe519'))
				end
			end
		end
	end

	_G.QuestFrameGreetingPanel:HookScript('OnShow', UpdateGreetingFrame)
Simpy's avatar
Simpy committed
324
	hooksecurefunc('QuestFrameGreetingPanel_OnShow', UpdateGreetingFrame)
Azilroka's avatar
Azilroka committed
325

Azilroka's avatar
Azilroka committed
326
	if E.private.skins.parchmentRemoverEnable then
Azilroka's avatar
Azilroka committed
327
		hooksecurefunc('QuestFrameProgressItems_Update', function()
328
			_G.QuestProgressRequiredItemsText:SetTextColor(1, .8, .1)
Merathilis's avatar
Merathilis committed
329
			_G.QuestProgressRequiredMoneyText:SetTextColor(1, 1, 1)
Azilroka's avatar
Azilroka committed
330 331
		end)

Simpy's avatar
Simpy committed
332
		hooksecurefunc('QuestFrame_SetTitleTextColor', function(fontString)
Azilroka's avatar
Azilroka committed
333
			fontString:SetTextColor(1, .8, .1)
334 335
		end)

Simpy's avatar
Simpy committed
336
		hooksecurefunc('QuestFrame_SetTextColor', function(fontString)
Azilroka's avatar
Azilroka committed
337
			fontString:SetTextColor(1, 1, 1)
338 339
		end)

Azilroka's avatar
Azilroka committed
340 341 342 343
		hooksecurefunc('QuestInfo_ShowRequiredMoney', function()
			local requiredMoney = GetQuestLogRequiredMoney()
			if requiredMoney > 0 then
				if requiredMoney > GetMoney() then
Azilroka's avatar
Azilroka committed
344
					_G.QuestInfoRequiredMoneyText:SetTextColor(.63, .09, .09)
Azilroka's avatar
Azilroka committed
345
				else
346
					_G.QuestInfoRequiredMoneyText:SetTextColor(1, .8, .1)
Azilroka's avatar
Azilroka committed
347 348 349
				end
			end
		end)
Merathilis's avatar
Merathilis committed
350 351 352 353 354 355 356 357

		if _G.QuestFrameDetailPanel.SealMaterialBG then
			_G.QuestFrameDetailPanel.SealMaterialBG:SetAlpha(0)
		end

		if _G.QuestFrameRewardPanel.SealMaterialBG then
			_G.QuestFrameRewardPanel.SealMaterialBG:SetAlpha(0)
		end
Azilroka's avatar
Azilroka committed
358
	else
359 360
		StyleScrollFrame(_G.QuestProgressScrollFrame, 506, 615, true)
		StyleScrollFrame(_G.QuestGreetingScrollFrame, 506, 615, true)
361 362
		_G.QuestFrameDetailPanel:HookScript('OnShow', function(s) StyleScrollFrame(s.ScrollFrame, 506, 615, true) end)
		_G.QuestRewardScrollFrame:HookScript('OnShow', function(s) StyleScrollFrame(s, 506, 615, true) end)
Azilroka's avatar
Azilroka committed
363
	end
364

365
	_G.QuestFrameGreetingPanel:StripTextures(true)
366
	S:HandleButton(_G.QuestFrameGreetingGoodbyeButton)
367 368 369 370 371 372 373
	_G.QuestGreetingFrameHorizontalBreak:Kill()

	_G.QuestDetailScrollChildFrame:StripTextures(true)
	_G.QuestRewardScrollFrame:StripTextures(true)
	_G.QuestRewardScrollChildFrame:StripTextures(true)
	_G.QuestFrameProgressPanel:StripTextures(true)
	_G.QuestFrameRewardPanel:StripTextures(true)
374 375 376 377 378
	S:HandleButton(_G.QuestFrameAcceptButton)
	S:HandleButton(_G.QuestFrameDeclineButton)
	S:HandleButton(_G.QuestFrameCompleteButton)
	S:HandleButton(_G.QuestFrameGoodbyeButton)
	S:HandleButton(_G.QuestFrameCompleteQuestButton)
379

380
	for i = 1, 6 do
Simpy's avatar
Simpy committed
381 382
		local button = _G['QuestProgressItem'..i]
		local icon = _G['QuestProgressItem'..i..'IconTexture']
383
		icon:SetTexCoord(unpack(E.TexCoords))
Simpy's avatar
Simpy committed
384
		icon:Point('TOPLEFT', 2, -2)
Simpy's avatar
Simpy committed
385 386
		icon:Size(icon:GetWidth() -3, icon:GetHeight() -3)
		button:Width(button:GetWidth() -4)
387
		button:StripTextures()
388 389
		button:SetFrameLevel(button:GetFrameLevel() +1)

Simpy's avatar
Simpy committed
390
		local frame = CreateFrame('Frame', nil, button, 'BackdropTemplate')
391
		frame:SetFrameLevel(button:GetFrameLevel() -1)
Simpy's avatar
Simpy committed
392
		frame:SetTemplate('Transparent', nil, true)
393 394 395 396 397 398 399 400 401 402
		frame:SetBackdropBorderColor(unpack(E.media.bordercolor))
		frame:SetBackdropColor(0, 0, 0, 0)
		frame:SetOutside(icon)
		button.backdrop = frame

		local hover = button:CreateTexture()
		hover:SetColorTexture(1, 1, 1, 0.3)
		hover:SetAllPoints(icon)
		button:SetHighlightTexture(hover)
		button.hover = hover
403 404
	end

405
	_G.QuestModelScene:StripTextures()
Simpy's avatar
Simpy committed
406
	_G.QuestModelScene:CreateBackdrop('Transparent')
Simpy's avatar
Simpy committed
407
	_G.QuestModelScene:Point('TOPLEFT', _G.QuestLogDetailFrame, 'TOPRIGHT', 4, -34)
Merathilis's avatar
Merathilis committed
408
	_G.QuestNPCModelTextFrame:StripTextures()
Simpy's avatar
Simpy committed
409
	_G.QuestNPCModelTextFrame:CreateBackdrop('Transparent')
Simpy's avatar
Simpy committed
410
	S:HandleScrollBar(_G.QuestNPCModelTextScrollFrame.ScrollBar)
411

412
	local QuestLogPopupDetailFrame = _G.QuestLogPopupDetailFrame
413 414
	S:HandlePortraitFrame(QuestLogPopupDetailFrame)

415 416 417 418 419
	S:HandleButton(_G.QuestLogPopupDetailFrameAbandonButton)
	S:HandleButton(_G.QuestLogPopupDetailFrameShareButton)
	S:HandleButton(_G.QuestLogPopupDetailFrameTrackButton)
	_G.QuestLogPopupDetailFrameScrollFrame:StripTextures()
	S:HandleScrollBar(_G.QuestLogPopupDetailFrameScrollFrameScrollBar)
Simpy's avatar
Simpy committed
420
	QuestLogPopupDetailFrame:CreateBackdrop('Transparent')
421

422
	_G.QuestLogPopupDetailFrameScrollFrame:HookScript('OnShow', function(s)
423
		if not _G.QuestLogPopupDetailFrameScrollFrame.backdrop then
424
			_G.QuestLogPopupDetailFrameScrollFrame:CreateBackdrop()
Simpy's avatar
Simpy committed
425
			_G.QuestLogPopupDetailFrameScrollFrame:Height(s:GetHeight() - 2)
Azilroka's avatar
Azilroka committed
426
			if not E.private.skins.parchmentRemoverEnable then
427
				StyleScrollFrame(_G.QuestLogPopupDetailFrameScrollFrame, 509, 630, false)
Azilroka's avatar
Azilroka committed
428
			end
429
		end
Azilroka's avatar
Azilroka committed
430
		if not E.private.skins.parchmentRemoverEnable then
Simpy's avatar
Simpy committed
431
			_G.QuestLogPopupDetailFrameScrollFrame.spellTex:Height(s:GetHeight() + 217)
432 433 434 435 436 437
		end
	end)

	QuestLogPopupDetailFrame.ShowMapButton:StripTextures()
	S:HandleButton(QuestLogPopupDetailFrame.ShowMapButton)
	QuestLogPopupDetailFrame.ShowMapButton.Text:ClearAllPoints()
Simpy's avatar
Simpy committed
438
	QuestLogPopupDetailFrame.ShowMapButton.Text:Point('CENTER')
Simpy's avatar
Simpy committed
439
	QuestLogPopupDetailFrame.ShowMapButton:Size(QuestLogPopupDetailFrame.ShowMapButton:GetWidth() - 30, QuestLogPopupDetailFrame.ShowMapButton:GetHeight(), - 40)
440

Merathilis's avatar
Merathilis committed
441
	-- 9.0 Needs Update for ShadowLands
442
	-- Skin the +/- buttons in the QuestLog
Simpy's avatar
Simpy committed
443
	hooksecurefunc('QuestLogQuests_Update', function()
Simpy's avatar
Simpy committed
444
		for i = 1, _G.QuestMapFrame.QuestsFrame.Contents:GetNumChildren() do
445
			local child = select(i, _G.QuestMapFrame.QuestsFrame.Contents:GetChildren())
Simpy's avatar
Simpy committed
446
			if child and child.ButtonText and not child.questID then
447
				child:Size(16, 16)
448

449 450 451 452 453
				for x = 1, child:GetNumRegions() do
					local tex = select(x, child:GetRegions())
					if tex and tex.GetAtlas then
						local atlas = tex:GetAtlas()
						if atlas == 'Campaign_HeaderIcon_Closed' or atlas == 'Campaign_HeaderIcon_ClosedPressed' then
454
							tex:SetTexture(E.Media.Textures.PlusButton)
455
						elseif atlas == 'Campaign_HeaderIcon_Open' or atlas == 'Campaign_HeaderIcon_OpenPressed' then
456
							tex:SetTexture(E.Media.Textures.MinusButton)
457
						end
458
					end
459 460 461 462
				end
			end
		end
	end)
463 464

	-- +/- Buttons for the CampaignHeaders in the QuestLog
Simpy's avatar
Simpy committed
465
	hooksecurefunc(_G.CampaignCollapseButtonMixin, 'UpdateState', function(button, isCollapsed)
466 467
		if isCollapsed then
			button:SetNormalTexture(E.Media.Textures.PlusButton)
468
			button:SetPushedTexture(E.Media.Textures.PlusButton)
469 470
		else
			button:SetNormalTexture(E.Media.Textures.MinusButton)
471
			button:SetPushedTexture(E.Media.Textures.MinusButton)
472 473
		end

Simpy's avatar
Simpy committed
474
		button:Size(16, 16)
475
	end)
476 477
end

Simpy's avatar
Simpy committed
478
S:AddCallback('BlizzardQuestFrames')