Quest.lua 18 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
5
local gsub, pairs, ipairs, select, unpack, strmatch, strfind = gsub, pairs, ipairs, select, unpack, strmatch, 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
Simpy's avatar
Simpy committed
12
local GetQuestBackgroundMaterial = GetQuestBackgroundMaterial
13
local GetQuestLogRequiredMoney = GetQuestLogRequiredMoney
Simpy's avatar
Simpy committed
14 15
local GetQuestLogLeaderBoard = GetQuestLogLeaderBoard
local GetNumQuestLeaderBoards = GetNumQuestLeaderBoards
16 17
local GetNumQuestLogRewardSpells = GetNumQuestLogRewardSpells
local GetNumRewardSpells = GetNumRewardSpells
Simpy's avatar
cache  
Simpy committed
18
local hooksecurefunc = hooksecurefunc
19

20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
local sealFrameTextColor = {
	['480404'] = 'c20606',
	['042c54'] = '1c86ee',
}

function S:QuestInfoSealFrameText(text)
	if text and text ~= '' then
		local colorStr, rawText = strmatch(text, '|c[fF][fF](%x%x%x%x%x%x)(.-)|r')
		if colorStr and rawText then
			colorStr = sealFrameTextColor[colorStr] or '99ccff'
			self:SetFormattedText('|cff%s%s|r', colorStr, rawText)
		end
	end
end

35
local function HandleReward(frame)
Simpy's avatar
Simpy committed
36
	if not frame then return end
37

Azilroka's avatar
Azilroka committed
38
	if frame.Icon then
Azilroka's avatar
Azilroka committed
39
		frame.Icon:SetDrawLayer('ARTWORK')
Azilroka's avatar
Azilroka committed
40
		S:HandleIcon(frame.Icon, true)
Azilroka's avatar
Azilroka committed
41
	end
42

Azilroka's avatar
Azilroka committed
43
	if frame.IconBorder then
44
		frame.IconBorder:Kill()
Azilroka's avatar
Azilroka committed
45 46 47 48
	end

	if frame.Count then
		frame.Count:SetDrawLayer('OVERLAY')
Azilroka's avatar
Azilroka committed
49
		frame.Count:ClearAllPoints()
Simpy's avatar
Simpy committed
50
		frame.Count:Point('BOTTOMRIGHT', frame.Icon, 'BOTTOMRIGHT', 0, 0)
Azilroka's avatar
Azilroka committed
51 52 53 54
	end

	if frame.NameFrame then
		frame.NameFrame:SetAlpha(0)
Azilroka's avatar
Azilroka committed
55 56 57 58 59
		frame.NameFrame:Hide()
	end

	if frame.IconOverlay then
		frame.IconOverlay:SetAlpha(0)
Azilroka's avatar
Azilroka committed
60 61 62
	end

	if frame.Name then
Azilroka's avatar
Azilroka committed
63
		frame.Name:FontTemplate()
Azilroka's avatar
Azilroka committed
64 65
	end

Azilroka's avatar
Azilroka committed
66
	if frame.CircleBackground then
67 68 69
		frame.CircleBackground:SetAlpha(0)
		frame.CircleBackgroundGlow:SetAlpha(0)
	end
Azilroka's avatar
Azilroka committed
70 71 72 73 74 75 76

	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
77 78
end

79 80 81 82 83
local function NewSealStyle()
	local theme = _G.QuestInfoSealFrame.theme
	return theme and theme.background
end

Simpy's avatar
Simpy committed
84
function S:QuestInfo_StyleScrollFrame(scrollFrame, widthOverride, heightOverride, inset)
85 86 87
	if not scrollFrame.backdrop then
		scrollFrame:CreateBackdrop()
	end
Simpy's avatar
Simpy committed
88

Azilroka's avatar
Azilroka committed
89
	if not scrollFrame.spellTex then
90
		scrollFrame.spellTex = scrollFrame:CreateTexture(nil, 'BACKGROUND', 1)
Azilroka's avatar
Azilroka committed
91 92
	end

Simpy's avatar
Simpy committed
93
	if NewSealStyle() or GetQuestBackgroundMaterial() then
94 95 96 97 98 99 100 101 102 103
		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
104 105
end

106
S.QuestInfo_StyleScrollFrames = {
Simpy's avatar
Simpy committed
107 108
	[_G.QuestDetailScrollChildFrame] = { frame = _G.QuestDetailScrollFrame, width = 506, height = 615, inset = true },
	[_G.QuestRewardScrollChildFrame] = { frame = _G.QuestRewardScrollFrame, width = 506, height = 615, inset = true },
109 110 111 112 113 114 115 116 117 118 119 120 121
	[_G.QuestLogPopupDetailFrame.ScrollFrame.ScrollChild] = {
		frame = _G.QuestLogPopupDetailFrameScrollFrame,
		width = 509, height = 630, inset = false,
		custom = function(self)
			self:Height(self:GetHeight() - 2)

			if not E.private.skins.parchmentRemoverEnable then
				self.spellTex:Height(self:GetHeight() + 217)
			end
		end
	}
}

122 123 124 125 126 127 128 129 130
-- Quest objective text color
local function Quest_GetQuestID()
	if _G.QuestInfoFrame.questLog then
		return C_QuestLog_GetSelectedQuest()
	else
		return GetQuestID()
	end
end

Simpy's avatar
Simpy committed
131 132 133
function S:QuestInfo_ShowObjectives()
	local objectives = _G.QuestInfoObjectivesFrame.Objectives
	local index = 0
134

Simpy's avatar
Simpy committed
135
	local questID = Quest_GetQuestID()
136 137
	local waypointText = C_QuestLog_GetNextWaypointText(questID)
	if waypointText then
Simpy's avatar
Simpy committed
138 139
		index = index + 1
		objectives[index]:SetTextColor(.4, 1, 1)
140 141
	end

Simpy's avatar
Simpy committed
142
	for i = 1, GetNumQuestLeaderBoards() do
143
		local _, objectiveType, isCompleted = GetQuestLogLeaderBoard(i)
Simpy's avatar
Simpy committed
144 145
		if objectiveType ~= 'spell' and objectiveType ~= 'log' and index < _G.MAX_OBJECTIVES then
			index = index + 1
146

Simpy's avatar
Simpy committed
147
			local objective = objectives[index]
148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191
			if objective then
				if isCompleted then
					objective:SetTextColor(.2, 1, .2)
				else
					objective:SetTextColor(1, 1, 1)
				end
			end
		end
	end
end

function S:QuestInfoItem_OnClick() -- self is not S
	_G.QuestInfoItemHighlight:ClearAllPoints()
	_G.QuestInfoItemHighlight:SetOutside(self.Icon)

	for _, Button in ipairs(_G.QuestInfoRewardsFrame.RewardButtons) do
		Button.Name:SetTextColor(1, 1, 1)
	end

	self.Name:SetTextColor(1, .8, .1)
end

function S:QuestLogQuests_Update() -- self is not S
	for i = 1, _G.QuestMapFrame.QuestsFrame.Contents:GetNumChildren() do
		local child = select(i, _G.QuestMapFrame.QuestsFrame.Contents:GetChildren())
		if child and child.ButtonText and not child.questID then
			child:Size(16, 16)

			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
						tex:SetTexture(E.Media.Textures.PlusButton)
					elseif atlas == 'Campaign_HeaderIcon_Open' or atlas == 'Campaign_HeaderIcon_OpenPressed' then
						tex:SetTexture(E.Media.Textures.MinusButton)
					end
				end
			end
		end
	end
end

function S:QuestInfo_Display(parentFrame) -- self is template, not S
Simpy's avatar
Simpy committed
192 193 194 195
	local rewardsFrame = _G.QuestInfoFrame.rewardsFrame
	local isQuestLog = _G.QuestInfoFrame.questLog ~= nil

	for i, questItem in ipairs(rewardsFrame.RewardButtons) do
196 197 198 199 200 201 202 203 204 205 206
		local point, relativeTo, relativePoint, _, y = questItem:GetPoint()
		if point and relativeTo and relativePoint then
			if i == 1 then
				questItem:Point(point, relativeTo, relativePoint, 0, y)
			elseif relativePoint == 'BOTTOMLEFT' then
				questItem:Point(point, relativeTo, relativePoint, 0, -4)
			else
				questItem:Point(point, relativeTo, relativePoint, 4, 0)
			end
		end

207 208
		HandleReward(questItem)

209
		S:HandleIconBorder(questItem.IconBorder, questItem.Icon.backdrop)
210

211
		questItem.NameFrame:Hide()
212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279
		questItem.Name:SetTextColor(1, 1, 1)
	end

	local numSpellRewards = isQuestLog and GetNumQuestLogRewardSpells() or GetNumRewardSpells()
	if numSpellRewards > 0 then
		if E.private.skins.parchmentRemoverEnable then
			for spellHeader in rewardsFrame.spellHeaderPool:EnumerateActive() do
				spellHeader:SetVertexColor(1, 1, 1)
			end
			for spellIcon in rewardsFrame.spellRewardPool:EnumerateActive() do
				HandleReward(spellIcon)
			end
		end

		for followerReward in rewardsFrame.followerRewardPool:EnumerateActive() do
			if not followerReward.isSkinned then
				followerReward:CreateBackdrop()
				followerReward.backdrop:SetAllPoints(followerReward.BG)
				followerReward.backdrop:Point('TOPLEFT', 40, -5)
				followerReward.backdrop:Point('BOTTOMRIGHT', 2, 5)
				followerReward.BG:Hide()

				followerReward.PortraitFrame:ClearAllPoints()
				followerReward.PortraitFrame:Point('RIGHT', followerReward.backdrop, 'LEFT', -2, 0)

				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()
				level:Point('BOTTOM', followerReward.PortraitFrame, 0, 3)

				local squareBG = CreateFrame('Frame', nil, followerReward.PortraitFrame, 'BackdropTemplate')
				squareBG:SetFrameLevel(followerReward.PortraitFrame:GetFrameLevel()-1)
				squareBG:Point('TOPLEFT', 2, -2)
				squareBG:Point('BOTTOMRIGHT', -2, 2)
				squareBG:SetTemplate()
				followerReward.PortraitFrame.squareBG = squareBG

				followerReward.isSkinned = true
			end

			local r, g, b = followerReward.PortraitFrame.PortraitRingQuality:GetVertexColor()
			followerReward.PortraitFrame.squareBG:SetBackdropBorderColor(r, g, b)
		end
	end

	if E.private.skins.parchmentRemoverEnable then
		_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)

		if _G.QuestInfoRewardsFrame.SpellLearnText then
			_G.QuestInfoRewardsFrame.SpellLearnText:SetTextColor(1, 1, 1)
		end

		_G.QuestInfoRewardsFrame.PlayerTitleText:SetTextColor(1, 1, 1)
		_G.QuestInfoRewardsFrame.XPFrame.ReceiveText:SetTextColor(1, 1, 1)
Simpy's avatar
Simpy committed
280 281

		S:QuestInfo_ShowObjectives()
282 283 284 285 286 287 288 289 290 291 292 293 294
	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)

295
		local style = S.QuestInfo_StyleScrollFrames[parentFrame]
296
		if style then
Simpy's avatar
Simpy committed
297
			S:QuestInfo_StyleScrollFrame(style.frame, style.width, style.height, style.inset)
298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341

			if style.custom then
				style.custom(style.frame)
			end
		end
	end
end

function S:CampaignCollapseButton_UpdateState(isCollapsed) -- self is button, not S
	if isCollapsed then
		self:SetNormalTexture(E.Media.Textures.PlusButton)
		self:SetPushedTexture(E.Media.Textures.PlusButton)
	else
		self:SetNormalTexture(E.Media.Textures.MinusButton)
		self:SetPushedTexture(E.Media.Textures.MinusButton)
	end

	self:Size(16, 16)
end

function S:QuestFrameProgressItems_Update() -- self is not S
	_G.QuestProgressRequiredItemsText:SetTextColor(1, .8, .1)
	_G.QuestProgressRequiredMoneyText:SetTextColor(1, 1, 1)
end

function S:QuestFrame_SetTitleTextColor() -- self is fontString
	self:SetTextColor(1, .8, .1)
end

function S:QuestFrame_SetTextColor() -- self is fontString
	self:SetTextColor(1, 1, 1)
end

function S:QuestInfo_ShowRequiredMoney() -- self is not S
	local requiredMoney = GetQuestLogRequiredMoney()
	if requiredMoney > 0 then
		if requiredMoney > GetMoney() then
			_G.QuestInfoRequiredMoneyText:SetTextColor(.63, .09, .09)
		else
			_G.QuestInfoRequiredMoneyText:SetTextColor(1, .8, .1)
		end
	end
end

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

345 346 347 348
	S:HandleScrollBar(_G.QuestProgressScrollFrameScrollBar)
	S:HandleScrollBar(_G.QuestRewardScrollFrameScrollBar)
	S:HandleScrollBar(_G.QuestDetailScrollFrameScrollBar)
	S:HandleScrollBar(_G.QuestGreetingScrollFrameScrollBar)
349

350
	local QuestInfoSkillPointFrame = _G.QuestInfoSkillPointFrame
351 352
	QuestInfoSkillPointFrame:StripTextures()
	QuestInfoSkillPointFrame:StyleButton()
Simpy's avatar
Simpy committed
353
	QuestInfoSkillPointFrame:Width(QuestInfoSkillPointFrame:GetWidth() - 4)
354
	QuestInfoSkillPointFrame:SetFrameLevel(QuestInfoSkillPointFrame:GetFrameLevel() + 2)
355 356

	local QuestInfoSkillPointFrameIconTexture = _G.QuestInfoSkillPointFrameIconTexture
357
	QuestInfoSkillPointFrameIconTexture:SetTexCoord(unpack(E.TexCoords))
Simpy's avatar
Simpy committed
358
	QuestInfoSkillPointFrameIconTexture:SetDrawLayer('OVERLAY')
Simpy's avatar
Simpy committed
359 360
	QuestInfoSkillPointFrameIconTexture:Point('TOPLEFT', 2, -2)
	QuestInfoSkillPointFrameIconTexture:Size(QuestInfoSkillPointFrameIconTexture:GetWidth() - 2, QuestInfoSkillPointFrameIconTexture:GetHeight() - 2)
361
	QuestInfoSkillPointFrame:CreateBackdrop()
Simpy's avatar
Simpy committed
362
	_G.QuestInfoSkillPointFrameCount:SetDrawLayer('OVERLAY')
363

364
	local QuestInfoItemHighlight = _G.QuestInfoItemHighlight
365
	QuestInfoItemHighlight:StripTextures()
Simpy's avatar
Simpy committed
366 367
	QuestInfoItemHighlight:CreateBackdrop()
	QuestInfoItemHighlight.backdrop:SetAllPoints()
Simpy's avatar
Simpy committed
368 369
	QuestInfoItemHighlight.backdrop:SetBackdropBorderColor(1, 1, 0)
	QuestInfoItemHighlight.backdrop:SetBackdropColor(0, 0, 0, 0)
Simpy's avatar
Simpy committed
370
	QuestInfoItemHighlight:Size(142, 40)
371 372


373
	_G.QuestRewardScrollFrame:CreateBackdrop()
Simpy's avatar
Simpy committed
374
	_G.QuestRewardScrollFrame:Height(_G.QuestRewardScrollFrame:GetHeight() - 2)
375

376 377 378 379
	hooksecurefunc('QuestInfo_Display', S.QuestInfo_Display)
	hooksecurefunc('QuestInfoItem_OnClick', S.QuestInfoItem_OnClick)
	hooksecurefunc('QuestLogQuests_Update', S.QuestLogQuests_Update) -- Skin the Plus Minus buttons in the QuestLog
	hooksecurefunc(_G.CampaignCollapseButtonMixin, 'UpdateState', S.CampaignCollapseButton_UpdateState) -- Plus Minus buttons for the CampaignHeaders in the QuestLog
380

Merathilis's avatar
Merathilis committed
381
	for _, frame in pairs({'HonorFrame', 'XPFrame', 'SpellFrame', 'SkillPointFrame', 'ArtifactXPFrame', 'TitleFrame', 'WarModeBonusFrame'}) do
Azilroka's avatar
Azilroka committed
382 383
		HandleReward(_G.MapQuestInfoRewardsFrame[frame])
		HandleReward(_G.QuestInfoRewardsFrame[frame])
384
	end
385
	HandleReward(_G.MapQuestInfoRewardsFrame.MoneyFrame)
386

387
	--Reward: Title
388
	local QuestInfoPlayerTitleFrame = _G.QuestInfoPlayerTitleFrame
Simpy's avatar
Simpy committed
389 390 391
	QuestInfoPlayerTitleFrame.FrameLeft:SetTexture()
	QuestInfoPlayerTitleFrame.FrameCenter:SetTexture()
	QuestInfoPlayerTitleFrame.FrameRight:SetTexture()
392
	QuestInfoPlayerTitleFrame.Icon:SetTexCoord(unpack(E.TexCoords))
393
	QuestInfoPlayerTitleFrame:CreateBackdrop()
394
	QuestInfoPlayerTitleFrame.backdrop:SetOutside(QuestInfoPlayerTitleFrame.Icon)
395 396

	--Quest Frame
397
	local QuestFrame = _G.QuestFrame
Simpy's avatar
Simpy committed
398
	S:HandlePortraitFrame(QuestFrame)
399 400 401 402
	_G.QuestFrameDetailPanel:StripTextures(nil, E.private.skins.parchmentRemoverEnable)
	_G.QuestDetailScrollFrame:StripTextures(nil, E.private.skins.parchmentRemoverEnable)
	_G.QuestProgressScrollFrame:StripTextures(nil, E.private.skins.parchmentRemoverEnable)
	_G.QuestGreetingScrollFrame:StripTextures(nil, E.private.skins.parchmentRemoverEnable)
Simpy's avatar
Simpy committed
403 404 405
	_G.QuestDetailScrollFrame:CreateBackdrop()
	_G.QuestProgressScrollFrame:CreateBackdrop()
	_G.QuestGreetingScrollFrame:CreateBackdrop()
Azilroka's avatar
Azilroka committed
406

407 408
	_G.QuestFrameGreetingPanel:HookScript('OnShow', function(frame)
		for button in frame.titleButtonPool:EnumerateActive() do
409
			button.Icon:SetDrawLayer('ARTWORK')
410

Azilroka's avatar
Azilroka committed
411
			if E.private.skins.parchmentRemoverEnable then
412 413 414
				local text = button:GetFontString():GetText()
				if text and strfind(text, '|cff000000') then
					button:GetFontString():SetText(gsub(text, '|cff000000', '|cffffe519'))
Azilroka's avatar
Azilroka committed
415 416 417
				end
			end
		end
418
	end)
Azilroka's avatar
Azilroka committed
419

Azilroka's avatar
Azilroka committed
420
	if E.private.skins.parchmentRemoverEnable then
421 422 423 424
		hooksecurefunc('QuestFrameProgressItems_Update', S.QuestFrameProgressItems_Update)
		hooksecurefunc('QuestFrame_SetTitleTextColor', S.QuestFrame_SetTitleTextColor)
		hooksecurefunc('QuestFrame_SetTextColor', S.QuestFrame_SetTextColor)
		hooksecurefunc('QuestInfo_ShowRequiredMoney', S.QuestInfo_ShowRequiredMoney)
425
		hooksecurefunc(_G.QuestInfoSealFrame.Text, 'SetText', S.QuestInfoSealFrameText)
426 427 428 429 430

		_G.QuestFrameDetailPanel.SealMaterialBG:SetAlpha(0)
		_G.QuestFrameRewardPanel.SealMaterialBG:SetAlpha(0)
		_G.QuestFrameProgressPanel.SealMaterialBG:SetAlpha(0)
		_G.QuestFrameGreetingPanel.SealMaterialBG:SetAlpha(0)
Azilroka's avatar
Azilroka committed
431
	else
Simpy's avatar
Simpy committed
432 433
		S:QuestInfo_StyleScrollFrame(_G.QuestProgressScrollFrame, 506, 615, true)
		S:QuestInfo_StyleScrollFrame(_G.QuestGreetingScrollFrame, 506, 615, true)
Azilroka's avatar
Azilroka committed
434
	end
435

436
	_G.QuestFrameGreetingPanel:StripTextures(true)
437
	S:HandleButton(_G.QuestFrameGreetingGoodbyeButton)
438 439 440 441 442 443 444
	_G.QuestGreetingFrameHorizontalBreak:Kill()

	_G.QuestDetailScrollChildFrame:StripTextures(true)
	_G.QuestRewardScrollFrame:StripTextures(true)
	_G.QuestRewardScrollChildFrame:StripTextures(true)
	_G.QuestFrameProgressPanel:StripTextures(true)
	_G.QuestFrameRewardPanel:StripTextures(true)
445 446 447 448 449
	S:HandleButton(_G.QuestFrameAcceptButton)
	S:HandleButton(_G.QuestFrameDeclineButton)
	S:HandleButton(_G.QuestFrameCompleteButton)
	S:HandleButton(_G.QuestFrameGoodbyeButton)
	S:HandleButton(_G.QuestFrameCompleteQuestButton)
450

451
	for i = 1, 6 do
Simpy's avatar
Simpy committed
452 453
		local button = _G['QuestProgressItem'..i]
		local icon = _G['QuestProgressItem'..i..'IconTexture']
454
		icon:SetTexCoord(unpack(E.TexCoords))
Simpy's avatar
Simpy committed
455
		icon:Point('TOPLEFT', 2, -2)
Simpy's avatar
Simpy committed
456 457
		icon:Size(icon:GetWidth() -3, icon:GetHeight() -3)
		button:Width(button:GetWidth() -4)
458
		button:StripTextures()
459 460
		button:SetFrameLevel(button:GetFrameLevel() +1)

Simpy's avatar
Simpy committed
461
		local frame = CreateFrame('Frame', nil, button, 'BackdropTemplate')
462
		frame:SetFrameLevel(button:GetFrameLevel() -1)
Simpy's avatar
Simpy committed
463
		frame:SetTemplate('Transparent', nil, true)
464 465 466 467 468 469 470 471 472 473
		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
474 475
	end

476
	_G.QuestModelScene:StripTextures()
Simpy's avatar
Simpy committed
477
	_G.QuestModelScene:CreateBackdrop('Transparent')
Simpy's avatar
Simpy committed
478
	_G.QuestModelScene:Point('TOPLEFT', _G.QuestLogDetailFrame, 'TOPRIGHT', 4, -34)
Merathilis's avatar
Merathilis committed
479
	_G.QuestNPCModelTextFrame:StripTextures()
Simpy's avatar
Simpy committed
480
	_G.QuestNPCModelTextFrame:CreateBackdrop('Transparent')
Simpy's avatar
Simpy committed
481
	S:HandleScrollBar(_G.QuestNPCModelTextScrollFrame.ScrollBar)
482

483
	local QuestLogPopupDetailFrame = _G.QuestLogPopupDetailFrame
484 485
	S:HandlePortraitFrame(QuestLogPopupDetailFrame)

486 487 488 489 490
	S:HandleButton(_G.QuestLogPopupDetailFrameAbandonButton)
	S:HandleButton(_G.QuestLogPopupDetailFrameShareButton)
	S:HandleButton(_G.QuestLogPopupDetailFrameTrackButton)
	_G.QuestLogPopupDetailFrameScrollFrame:StripTextures()
	S:HandleScrollBar(_G.QuestLogPopupDetailFrameScrollFrameScrollBar)
Simpy's avatar
Simpy committed
491
	QuestLogPopupDetailFrame:CreateBackdrop('Transparent')
492 493 494 495

	QuestLogPopupDetailFrame.ShowMapButton:StripTextures()
	S:HandleButton(QuestLogPopupDetailFrame.ShowMapButton)
	QuestLogPopupDetailFrame.ShowMapButton.Text:ClearAllPoints()
Simpy's avatar
Simpy committed
496
	QuestLogPopupDetailFrame.ShowMapButton.Text:Point('CENTER')
Simpy's avatar
Simpy committed
497
	QuestLogPopupDetailFrame.ShowMapButton:Size(QuestLogPopupDetailFrame.ShowMapButton:GetWidth() - 30, QuestLogPopupDetailFrame.ShowMapButton:GetHeight(), - 40)
498 499
end

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