to preface; I'm aware that the garrison UI is buggy and seemingly unfinished currently (w/ duplicate follower abilities and traits etc).
...
Ugh, trying to make sense of blizzard's convoluted frame-naming strategies in the garrison UI.
I'm attempting to access icons buried in the mission frames and have got most of them - except for the rewards shown on the available/in progress lists. You can see 'em here:
Actually, as you can probably see, I am managing to reach and access some of the icons - but without any kind of consistency. They'll only apply if I have 'available' missions, and only on the first icon of a row.
this is the code i'm using, co-opting blizzard's use of strange and convoluted multi-part locals
Lua Code:
--
local SkinGarriButtons = CreateFrame("Frame", nil, UIParent)
-- lol, haven't tested which events are called when
-- to-do: make sure we're only using the right ones
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
-- mission list reward icons
-- NOT WORKING CORRECTLY
local ml = GarrisonMissionFrame.MissionTab.MissionList
local scrollFrame = ml.listScroll
local buttons = scrollFrame.buttons
local numButtons = #buttons
local missions = ml.showInProgress and ml.inProgressMissions or ml.availableMissions
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 tt = 1
for k, maxrewards in pairs(mission.rewards) do
local Reward = button.Rewards[tt]
--
-- style
--
end
tt = tt + 1
end
end
end
end
and the relevant functions buried in Garrison MissionUI:
https://github.com/tekkub/wow-ui-sou...onUI.lua#L1231
https://github.com/tekkub/wow-ui-sou...onUI.lua#L1310
accessing other buttons has been a relative breeze, using simple calls like
Lua Code:
--
local completereward = GarrisonMissionFrame.MissionComplete
for i = 1, #completereward.BonusRewards.Rewards do
completereward.BonusRewards.Rewards[i]:DoStuff(stuff)
end
but I haven't found a simple + working method for these damn available/in-progress buttons.