Skip to content

Commit

Permalink
Better way to detect map reward.
Browse files Browse the repository at this point in the history
  • Loading branch information
Wetxius committed Oct 2, 2016
1 parent b9b11de commit b12fd29
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions ShestakUI/Modules/Skins/Blizzard/QuestLog.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ local function LoadSkin()
end
hooksecurefunc("QuestMapFrame_ShowQuestDetails", QuestObjectiveText)

local function SkinReward(button)
local function SkinReward(button, mapReward)
if button.NameFrame then button.NameFrame:Hide() end
if button.CircleBackground then button.CircleBackground:Hide() end
if button.CircleBackgroundGlow then button.CircleBackgroundGlow:Hide() end
Expand All @@ -56,6 +56,9 @@ local function LoadSkin()
button.backdrop:ClearAllPoints()
button.backdrop:SetPoint("TOPLEFT", button.Icon, -2, 2)
button.backdrop:SetPoint("BOTTOMRIGHT", button.Icon, 2, -2)
if mapReward then
button.Icon:SetSize(26, 26)
end
end

local function SkinRewardSpell(button)
Expand All @@ -76,7 +79,7 @@ local function LoadSkin()
SkinRewardSpell(QuestInfoSpellObjectiveFrame)

for _, name in next, {"HonorFrame", "MoneyFrame", "SkillPointFrame", "XPFrame", "ArtifactXPFrame", "TitleFrame"} do
SkinReward(MapQuestInfoRewardsFrame[name])
SkinReward(MapQuestInfoRewardsFrame[name], true)
end

for _, name in next, {"HonorFrame", "SkillPointFrame", "ArtifactXPFrame"} do
Expand All @@ -88,14 +91,9 @@ local function LoadSkin()
hooksecurefunc("QuestInfo_GetRewardButton", function(rewardsFrame, index)
local button = rewardsFrame.RewardButtons[index]
if not button.restyled then
SkinReward(button)
SkinReward(button, rewardsFrame == MapQuestInfoRewardsFrame)
button.restyled = true
end

local mapReward = MapQuestInfoRewardsFrame.RewardButtons[index]
if mapReward then
mapReward.Icon:SetSize(26, 26)
end
end)

hooksecurefunc("QuestInfo_Display", function(template, parentFrame, acceptButton, material)
Expand Down

0 comments on commit b12fd29

Please sign in to comment.