View Single Post
11-03-16, 05:18 PM   #1
Mayron
A Frostmaul Preserver
 
Mayron's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 275
Problem with reskinning the OrderHall "Troops" icons

I want to change the appearance of the troop icons on the OrderHallCommandBar:



Lua Code:
  1. -- ignore the "CreateEventHandler" function as it basically just handles my events in an easier way
  2. em:CreateEventHandler("GARRISON_UPDATE", function()
  3.         if (type(OrderHallCommandBar.TroopSummary) == "table") then
  4.             for id, troop in ipairs(OrderHallCommandBar.TroopSummary) do
  5.                 -- do stuff            
  6.             end
  7.         end
  8. end);

The only problem is that I have no clue when this "OrderHallCommandBar.TroopSummary" table fills up with data, nor when the troop icons appear on the bar. I've tried "GARRISON_UPDATE" but this doesn't work. It works when you reload the UI when you are already in the Class Hall but not when you log out, login, and then enter the Class Hall. I've tried hooking all functions inside "Blizzard_OrderHallCommandBar.lua" but in that file there is no code that mentions "TroopSummary" and it is inherited from "Blizzard_OrderHallCommandBar.xml":

XML Code:
  1. <Frame name="OrderHallClassSpecCategoryTemplate" parentArray="TroopSummary" virtual="true" mixin="OrderHallClassSpecCategory">

I've also tried running my troops reskinning code after "PLAYER_ENTERING_WORLD" and when the "Blizzard_OrderHallUI" AddOn is loaded but the TroopSummary table is always empty and then it shows. I just don't know what event/function to hook.

Does anyone know anything about this?

Thanks

Last edited by Mayron : 11-03-16 at 05:21 PM.
  Reply With Quote