Originally Posted by Lombra
I don't understand. You can't update the texture until the server has made the change and sent the event to the client; the API returns won't be up to date until then. The default UI calls SetTexture in response to this event.
|
If you hook both function/event then you can see that the SetTexture runs before the equip change:
Lua Code:
hooksecurefunc(CharacterBackSlotIconTexture, "SetTexture", function(self, texture)
print(self:GetTexture())
end)
CharacterBackSlot:HookScript("OnEvent", function(self, event, slot, hasItem)
if event == "PLAYER_EQUIPMENT_CHANGED" then
print(event)
end
end)
And it should because when the equip change event triggers, you should be able to access the newly equipped item's texture properly. Between this 2 events the game still sets the original background texture, and in some cases it could be visible.