Auras.PostCreateIcon?
Hello folks!
At first id like to thank everyone for the initial help they gave me on here. My layout is coming together the way i want to. But sadly im running into a Problem again with displaying Auras, or rather setting the TexCoord of the related icon. this is located inside another .lua file Lua Code:
inside my Layout file im doing Lua Code:
For some reason, ns.UpdateAuraIcon doesnt trigger as far as i experienced Other stuff inside the namespace, for example cfg.numBuffs is working fine. But it feels like it isnt triggering the function outside the .lua-file but inside the namespace? Am i doing something wrong regarding functions inside the namespace? Thanks in advance and greetings! EDIT: I solved the issue by doing lua Code:
i dont know why the other option didnt work, if someone knows. please feel free to explain :) |
Code:
ns:UpdateAuraIcon = function(element, button) Code:
ns.UpdateAuraIcon = function(element, button) Your new function definition works because: Code:
function ns:UpdateAuraIcon(button) Code:
function ns.UpdateAuraIcon(ns, button) |
Okay thanks :)
I thought that the colon is referring to functions, like when setting Properties or Textures on specific frames. But i guess, that ns.<functionname> then refers to the name of the function inside the namespace rather than a function inside the namespace. Thanks alot haste! |
The colon in Lua is essentially shorthand for passing "self", or "this" as it used to be called. When using the colon, you're telling the function you're calling to automatically accept the object before the colon as the first argument. Without the colon, you're just calling the function itself. The dot is irrelevant here, it's just a way to access the function within the table. This can be confusing at times due to WoW's frame objects and the inherit functions that live in a frame's table.
Adding to the last function example of Haste's reply, this is also the same: Code:
function ns["UpdateAuraIcon"](ns, button) |
Quote:
Quote:
|
All times are GMT -6. The time now is 05:31 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI