"Storing" functions
I just encountered a little problem and hope, someone can give me a hint:
I'm working on a ActionBar-Framework. While setting the button's position (and size), I want to make sure, the button is not moved again (line 11&12). lua Code:
Now I want to create an ingame-config, but obviously I can't set the buttons' positions again. I tried to "store" the original function and use it later, but with no success. Code was: lua Code:
lib.buttonFunc is an array and of course, this code was executed before I noop'ed the functions. But the stored value has get noop'ed aswell, I guess because they are only function pointers, not real functions. Can anybody give me a hint, how I can noop a function, but store it's functionality to use it later on? |
Your buttonFunc table solution should work. Are you sure you weren't calling MoveButton on the same button twice (and overriding your first copy of SetPoint)?
____ Edit: Just realized this is a library. Do you have two copies of the embedded library running, overriding each others' hooks? |
lib is really just my array holding functions and porting them through the namespace...
Hm, will try again later, can't say definetely, that the function wasn't called twice... Thx for the reply |
k, it is working now... I moved the grabbing of the buttons one layer higher:
lua Code:
Thx for your reply Saiket, your confirmation was necessary and I think you solved it by pointing out, that maybe I'm filling the array twice! |
All times are GMT -6. The time now is 12:46 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI