Quantcast
WoWInterface - View Single Post - 3 KGPanels related questions, couldn't make them fit in the title
View Single Post
04-25-19, 08:46 AM   #3
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,276
You say "enemy faction players" but don't say if they are changing targets or just fixed or ...

I don't know KG, but something like:

For the frames OnLoad (self or whatever KG uses):
Code:
self:RegisterEvent("PLAYER_TARGET_CHANGED")
For it's OnEvent handler:

Lua Code:
  1. if event == "PLAYER_TARGET_CHANGED" then
  2.     local FactionTextures = {
  3.         Alliance = "Interface\\AddOns\\[TextureLocation]\\AllianceTexture",
  4.         Horde = "Interface\\AddOns\\[TextureLocation]\\HordeTexture",
  5.         Neutral = "Interface\\AddOns\\[TextureLocation]\\NeutralTexture",
  6.     }
  7.     local NoTarget = "Interface\\AddOns\\[TextureLocation]\\NoFactionTexture"
  8.     self:SetTexture(FactionTextures[UnitFactionGroup("target")] or NoTarget)
  9. end

If the textures are for something like arena frames you might use the ARENA_OPPONENT_UPDATE event.

Normally I wouldn't create the table in the event handler each time, it's there as an example. If it can be better placed using KG great, otherwise you can just directly assign the textures based on the faction rather than using the table lookup.

Question 1, You could but you probably wouldn't because it would require all the code of a standalone addon anyway if Pitbul doesn't have the option to change power bar textures based on spec. (I don't know Pitbul either).

Question 3, You should be able to anchor a "panel" in KG to any other frame that is "available" and have them move together. You would need to know the name (/fstack) of the frame (or it's parent/key if it has one and no name). If it has neither, it gets more complicated depending on the frame.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 04-25-19 at 09:52 AM.
  Reply With Quote