Almost done with my UI... I keep having problems but manage to fix them one by one. I'd like to know the answers for these questions though:
1- Can I use KGPanels to completely hide another Unit frame (Pitbull) depending on enemy and player specialization? The idea here is to make different textures for mana and power bar. I can make it show 2 different textures for mana and power bar but when it's a spec with both of them (Ele shaman for example) it shows both of them at the same time and I don't want that. Oh and, pure mana based specs also show the bars twice. 2- I'm trying to make the unit frame show 2 different textures for enemy faction players, depending on their faction. Let's say I have texture H and B, made for the Horde and the Alliance, respectively. I'm on my Alliance character and I'm targeting a Horde player, I want it to show texture H and vice versa for my Horde character. I've tried many scripts regarding this issue but they don't work. 3- Can I use it (or any other addon) to anchor 2 separate frames from different addons so when one of them is moved the other one also follows? This one isn't that important but it helps. Many thanks in advance. |
No one? I can live without the others but at least maybe someone can help me with the 2nd question? I really need to find a way to put a texture for enemy Horde/Alliance players.
Maybe an onLoad script? local _, faction= UnitFaction("player"); if faction == "horde" then self:Show() else self:Hide() end Then another onEvent script for PVP targets. FFA players might provide an issue. I wrote this with what's left in my mind so there must be some errors. |
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") Lua Code:
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. |
Much appreciated mate.
What I meant to say was, I have 2 custom made Horde and Alliance symbols. Just like in default UI mine will also display an icon for enemy Horde/Alliance players, I want these icons as these custom textures. If possible I'd like to show an icon for FFA players as well. About my anchoring question. I was talking about making KGPanels to hide another Addon's frame, so in this case when the anchored texture disappears, I want that frame to disappear as well. So in other words I'm trying to set a condition for target's specialization. Depending on this situation the frame will be hidden. This sounds very complicated though, I'm not sure if this is possible at all. I'll will try the scripts when I get back to my PC. Thanks again. |
Okay I tried them.
Message: [string "Horde PVP_OnEvent"]:8: attempt to call method 'SetTexture' (a nil value) Time: Thu Apr 25 20:12:19 2019 Count: 1 Stack: [string "Horde PVP_OnEvent"]:8: attempt to call method 'SetTexture' (a nil value) [string "Horde PVP_OnEvent"]:8: in function <[string "Horde PVP_OnEvent"]:1> [C]: in function `CameraOrSelectOrMoveStop' [string "CAMERAORSELECTORMOVE"]:4: in function <[string "CAMERAORSELECTORMOVE"]:1> Locals: self = kgPanel4 { 0 = <userdata> _backdrop_options = <table> { } _GetBackdropColor = <function> defined =[C]:-1 SetBackdropGradientAlpha = <function> defined @Interface\AddOns\kgPanels\Libs\LibBackdrop-1.0\LibBackdrop-1.0.lua:535 _SetBackdrop = <function> defined =[C]:-1 GetBackdropBorderSection = <function> defined @Interface\AddOns\kgPanels\Libs\LibBackdrop-1.0\LibBackdrop-1.0.lua:155 GetBackdropColor = <function> defined =[C]:-1 _backdrop = <unnamed> { } _GetBackdropBorderColor = <function> defined =[C]:-1 SetBackdropBorderColor = <function> defined =[C]:-1 bg = <unnamed> { } missing_anchor_at_load = false missing_parent_at_load = false scripts_loaded = false SetBackdropBorderGradientAlpha = <function> defined @Interface\AddOns\kgPanels\Libs\LibBackdrop-1.0\LibBackdrop-1.0.lua:568 GetBackdropBackground = <function> defined @Interface\AddOns\kgPanels\Libs\LibBackdrop-1.0\LibBackdrop-1.0.lua:147 text = <unnamed> { } _SetBackdropColor = <function> defined =[C]:-1 BorderTextureFunction = <function> defined @Interface\AddOns\kgPanels\Libs\LibBackdrop-1.0\LibBackdrop-1.0.lua:136 SetBackdrop = <function> defined =[C]:-1 GetBackdropBorderColor = <function> defined =[C]:-1 _GetBackdrop = <function> defined =[C]:-1 GetBackdrop = <function> defined =[C]:-1 SetBackdropBorderGradient = <function> defined @Interface\AddOns\kgPanels\Libs\LibBackdrop-1.0\LibBackdrop-1.0.lua:542 _SetBackdropBorderColor = <function> defined =[C]:-1 SetBackdropColor = <function> defined =[C]:-1 SetBackdropGradient = <function> defined @Interface\AddOns\kgPanels\Libs\LibBackdrop-1.0\LibBackdrop-1.0.lua:528 } event = "PLAYER_TARGET_CHANGED" arg1 = nil arg2 = nil arg3 = nil arg4 = nil arg5 = nil arg6 = nil arg7 = nil arg8 = nil arg9 = nil arg10 = nil kgPanels = <table> { SetDefaultModuleLibraries = <function> defined @Interface\AddOns\Masque\Libs\AceAddon-3.0\AceAddon-3.0.lua:367 FetchFont = <function> defined @Interface\AddOns\kgPanels\kgPanels.lua:385 SetupScript = <function> defined @Interface\AddOns\kgPanels\kgPanels.lua:1018 Enable = <function> defined @Interface\AddOns\Masque\Libs\AceAddon-3.0\AceAddon-3.0.lua:294 RegisterChatCommand = <function> defined @Interface\AddOns\Bartender4\libs\AceConsole-3.0\AceConsole-3.0.lua:85 EnableModule = <function> defined @Interface\AddOns\Masque\Libs\AceAddon-3.0\AceAddon-3.0.lua:332 modules = <table> { } GetModule = <function> defined @Interface\AddOns\Masque\Libs\AceAddon-3.0\AceAddon-3.0.lua:210 IterateEmbeds = <function> defined @Interface\AddOns\Masque\Libs\AceAddon-3.0\AceAddon-3.0.lua:442 ResetFont = <function> defined @Interface\AddOns\kgPanels\kgPanels.lua:1000 defaultModuleLibraries = <table> { } eframe = kgPanels_Dep_Frame { } UnregisterChatCommand = <function> defined @Interface\AddOns\Bartender4\libs\AceConsole-3.0\AceConsole-3.0.lua:111 Printf = <function> defined @Interface\AddOns\Bartender4\libs\AceConsole-3.0\AceConsole-3.0.lua:69 angles = <table> { } GetName = <function> defined @Interface\AddOns\Masque\Libs\AceAddon-3.0\AceAddon-3.0.lua:279 AddMissingMedia = <function> defined @Interface\AddOns\kgPanels\kgPanels.lua:470 ReParent = <function> defined @Interface\AddOns\kgPanels\kgPanels.lua:725 name = "kgPanels" FetchArt = <function> defined @Interface\AddOns\kgPanels\kgPanels.lua:382 IsEnabled = <function> defined @Interface\AddOns\Masque\Libs\AceAddon-3.0\AceAddon-3.0.lua:451 orderedModules = <table> { } CommandLine = <function> defined @Interface\AddOns\kgPanels\kgPanels.lua:619 DisableModule = <function> defined @In I get this error. Every target showed my Horde texture for some reason, and I do mean every target. Even the NPCs or pets. I should have been more specific with this. my apologies. I'd like to explain what I want step by step: -I want the game to display a custom Horde symbol whenever I target a Horde Player if I'm playing as Alliance. -I want the game to display a custom Alliance symbol whenever I target an Alliance Player if I'm playing as Horde. -Lastly I'd also like to show a custom texture for an FFA character. |
I don't know KG so my code was intended as "adjust for use" rather than intended as literal.
The call to "SetTexture" should be replaced by whatever KGPanels uses to dynamically update a panels texture (maybe KG function or some method of determining which element of the panel is the texture widget). You don't say what (if any) texture you want to display if you are targeting a member of the same faction. |
The conditions could look something like:
Lua Code:
|
Quote:
|
Actually I do have a working script but it's only for attackable PVP players. I'm thinking about adding an OnLoad script that checks player faction to show the mentioned texture. The only problem is it FFA players. So, if we can eliminate FFA from the conditions it looks like it could work.
if UnitExists("target") == nil then self:Hide() return end if (UnitIsEnemy("player","target") and UnitIsPlayer("target")) then self:Show() else self:Hide() end I'm a super newbie when it comes to this work but I remember seeing "not" operator when there was a condition that needed to be removed. So for example I was using a Death Knight only frame and it had this condition: local _, class = UnitClass("player"); if class == "DEATHKNIGHT" then self:Show() else self:Hide() end If I can change the values so that it can check for my faction instead of my class, everything should work. Am I wrong here? Am I making any mistakes? Hope I'm not. |
I found a workaround for my faction texture problem. Since I'm using STUF Unit Frames I just replaced the default Blizzard textures and activated faction textures in the AddOn. It worked, heh.
|
All times are GMT -6. The time now is 12:00 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI