Skip to content

Instantly share code, notes, and snippets.

@obble
Created August 2, 2014 17:40
Show Gist options
  • Save obble/d2d564bf2365d76670de to your computer and use it in GitHub Desktop.
Save obble/d2d564bf2365d76670de to your computer and use it in GitHub Desktop.
-- Garrison
-- colour -------------------------------------------------------------------------------
local r, g, b = 103/255, 103/255, 103/255
-- implement ----------------------------------------------------------------------------
local SkinGarriButtons = CreateFrame("Frame", nil, UIParent)
SkinGarriButtons:RegisterEvent("ADDON_LOADED")
SkinGarriButtons:RegisterEvent("PLAYER_ENTERING_WORLD")
SkinGarriButtons:RegisterEvent("GARRISON_MISSION_LIST_UPDATE")
SkinGarriButtons:RegisterEvent("GARRISON_FOLLOWER_LIST_UPDATE")
SkinGarriButtons:RegisterEvent("GARRISON_FOLLOWER_REMOVED")
SkinGarriButtons:RegisterEvent("CURRENCY_DISPLAY_UPDATE")
SkinGarriButtons:RegisterEvent("GARRISON_FOLLOWER_XP_CHANGED")
SkinGarriButtons:RegisterEvent("GARRISON_MISSION_STARTED")
SkinGarriButtons:RegisterEvent("GARRISON_MISSION_FINISHED")
SkinGarriButtons:SetScript("OnEvent", function(self, event, AddOn)
if (AddOn=="Blizzard_GarrisonUI") then
local missionlist = GarrisonMissionFrame.MissionTab.MissionList
local scrollFrame = missionlist.listScroll
local buttons = scrollFrame.buttons
local numButtons = #buttons
local missions
if (missionlist.showInProgress) then
missions = missionlist.inProgressMissions
else
missions = missionlist.availableMissions
end
local numMissions = #missions
local offset = HybridScrollFrame_GetOffset(scrollFrame)
for i = 1, numButtons do
local button = buttons[i]
local index = offset + i -- adjust index
if (index<=numMissions) then
local mission = missions[index]
local index2 = 1
for id, maxreward in pairs(mission.rewards) do
local Reward = button.Rewards[index2]
if Reward:IsShown() and not button.skinned then
local buttontex = CreateFrame("FRAME", nil, button)
buttontex:SetAllPoints(Reward.Icon)
buttontex:SetFrameStrata("HIGH")
buttontex:CreateBeautyBorder(22)
buttontex:SetBeautyBorderColor(r, g, b)
buttontex:SetBeautyBorderPadding(3, 3, 3, 3, 3, 3, 3, 3)
buttontex:SetBeautyBorderDraw("OVERLAY")
button.skinned = true
end
index2 = index2 + 1
end
end
end
end
end)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment