04-15-18, 06:41 AM | #1 | ||
Need help with a hard trigger
Need your help guys, trying to get this trigger to work...
My table file
Last edited by GreyFox777 : 04-15-18 at 06:58 AM. |
|||
04-15-18, 08:40 AM | #2 |
You can just pass a function as a second argument to RegisterEvent:
Lua Code:
--- edit for verbosity: Right now you're passing function that's supposed to be executed as a callback to SetScript: Lua Code:
Since oUF rewrote the RegisterEvent function, this might not work out as planned. Instead, you can just define that function locally and pass it as a second argument to RegisterEvent() like I showed above: Lua Code:
Last edited by jukx : 04-15-18 at 09:11 AM. |
|
04-15-18, 09:42 AM | #3 | ||
the error:
Last edited by GreyFox777 : 04-15-18 at 09:52 AM. |
|||
04-15-18, 09:49 AM | #4 |
For debugging (=making stuff work that doesn't work right now), I'd recommend installing BugSack and BugGrabber so you can see where the error is.
--- Also, you're calling m.locale[servers[serverName]] which won't work. servers[serverName] returns something like "English" which is not a valid key in your table m.locale. To make it work you'd have to match the keys to the content of the servers table: Lua Code:
--- Furthermore, if your question is how to insert the code for the table into the code above, just rename m.locale to locale and insert the table definition at the top, like this: Lua Code:
Last edited by jukx : 04-15-18 at 09:53 AM. |
|
04-15-18, 09:54 AM | #5 | |
yes, it was already
|
||
04-15-18, 10:16 AM | #6 | ||
Now, it has zero errors, but still not working...
Uiiii it works now! I forget to add
Last edited by GreyFox777 : 04-15-18 at 10:20 AM. |
|||
04-15-18, 10:36 AM | #7 |
For the record, you created a frame under that var name there, and then overwrote it with a function right after. Hence the error, because your frame is gone and :SetTexture is not valid for functions.
You've changed that later and have it working now, but you need to be careful with variable names not to overwrite other important stuff. Also, you can do localicon.texture:CreateTexture(name, layer) to create a texture for your frame, without having to declare a second local variable. What you did would work too, but this way is cleaner and more straightforward. You can add pretty much anything you want to frames that way. It doesn't specifically have to be called ".texture" for it to work as a texture (lua variables are typeless, you put anything you want in them), but it is recommended to use descriptive variable names so that's why I use that as the example. |
|
WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Need help with a hard trigger |
«
Previous Thread
|
Next Thread
»
|
Display Modes |
Linear Mode |
Switch to Hybrid Mode |
Switch to Threaded Mode |
|
|