Show custom frame when having a target?
Im trying to create a panel that toggles on and off based on if i have a target or not. I just can't seem to get it to work.
Im using: Code:
if (event == PLAYER_TARGET_CHANGED) then What am i doing wrong? |
I can only suggest to post/pastey your whole code .. don't see anything wrong, assuming that Target_Power is your custom defined frame
you're however missing double quotes for the string "PLAYER_TARGET_CHANGED" |
Here is my code:
Code:
if not Stuf then return end |
That if-then construct won't do anything just like that .. you need to register your frame to an event
Code:
local function OnEvent(self, event) It might be better to use different variable names, if you have multiple frames you want to keep a table reference to |
anyway, I'm really a frame methods/widgets noob, so now is my turn to ask questions ;)
What is the difference between: Code:
CreateFrame("Frame", "TestFrame") Code:
local tableReference = CreateFrame("Frame") Code:
local tableReference = CreateFrame("Frame", "TestFrame") Edit: @ Nibelheim Thanks for giving one of the reasons and an explanation/example :) |
Quote:
I.e. I could create an Info Line module, this module consists of a background panel, and info panels. Now, I could create each frame as so: Code:
CreateFrame("Frame", "InfoLine_Background") Code:
InfoLine_Durability.text = CreateFontString(etc) Code:
Local ILFrames = {} Code:
for i,v in pairs(Opts.Panels) do |
Thank you so much. That solved it.
Im just starting to learn the LUA so a bit nabbing around and much trying out. Tbh, im a "total" nob with LUA so can't give you a perfect answer. But i have 2 different "templates". In this example it just the framestrata mainly that is changed. Since im making panels that "partly" overlap. Im just using the example Sniffles posted to my earlyer question in http://www.wowinterface.com/forums/s...ad.php?t=39182 Thx again :):banana: Edited: Thx Nibelheim for your good example. |
All times are GMT -6. The time now is 09:31 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI