• 0

    posted a message on SecureActionButtonTemplate and Attribute Changing
    Quote from Adirelle
    The secure stuff was specifically designed to prevent what you are trying to do.


    I had a feeling that was the case. I just figured that since it was a user initiated event and there was no conditional processing that there might have been a way.

    Thanks either way!
    Posted in: Lua Code Discussion
  • 0

    posted a message on SecureActionButtonTemplate and Attribute Changing
    I've been able to setup a simple secure button but now I'm trying to figure out how to set an attribute (in combat) -- all initiated via a hardware event (mouse button event). Is this possible at all? Or is there even a hold on attribute modification via hardware events when in combat?

    Essentially what I'm looking for... the spell attributes don't change, but I'm looking to be able to change the "target" attribute.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Cooldown Widget
    I've just started playing with the Cooldown widget/frametype... in an attempt to mimic the Auracle "stacks watcher". It seems if I put any kind of nominal throttle on the "OnUpdate" script the cooldown model disappears (if I keep the throttle to sub 10ms everythign is fine). Any known reason for this?

    Also... is there another way of mimicing this that doesn't involve rapidly setting the cooldown timer to an "edge time"? I would like to create my own pie model to represent stacks of some sort. Whether it's sunders on a mob or w/e.

    Thanks again.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Metamethods
    One last question... are there any pitfalls that I need to know about when using the pattern that is similar to what LibCandyBar is using?
    Posted in: Lua Code Discussion
  • 0

    posted a message on Metamethods
    I definitely understand this a lot more thanks to you guys. This is the first time I've ever had the "inkling" to work with metamethods and the frame type. I've always just glossed over this code when reading others' sources.

    Thanks jerry, xinhuan, and adirelle.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Metamethods
    Brilliant jerry. That actually helps me understand this metamethod interaction with the Blizzard "types" (ie: Frame). I guess I never really considered that the __index would not work for functions accessible inside lua, but defined outside.

    I guess my only remaining question goes back to, why do I see some addons using __index = frame_mt (where frame_mt is a chained setmetatable of __index being equal to an anonymous frame). This specific example is found at the top of the file "bars.lua" in the "LibCandyBar-3.0" addon.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Making my frames appear above the actionbar?
    Quote from Galvin
    I thought setting the framelevel to 10 would work. But sometimes my frames in my mod will appear behind the actionbar. I just want to make sure someone wont drag one of the frames behind the actionbar then can't get it back.

    Any ideas on this?


    A. "SetToplevel(boolean)" method.
    B. "SetFrameStrata(stratatype)" method.

    At least as far as the wowwiki community is concerned, manually setting the frame level is poor form.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Metamethods
    Quote from Adirelle
    To "subtype" the Frame (and create multiple instances of that subtype), you'll have to use 2 levels of metamethods, e.g. : http://paste.wowace.com/2427/


    Okay okay, perfect start. My question is... why the multiple levels of metamethods?

    Again, I also wonder why there's 2 frames created. I'm not clear why this is necessary.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Metamethods
    Thanks to Xin's and jerry's help, sincerely. However, I'm still at a loss to understanding these concepts, in the context of some of the addons I've read through.

    I still don't understand why:
    local myt = setmetatable({}, {__index=CreateFrame("Frame")});
    doesn't work.

    Shouldn't anything called on "myt" force a lookup in the object assigned to __index in the metatable?
    Posted in: Lua Code Discussion
  • 0

    posted a message on Metamethods
    There are two places where the value of __index is equal to a frame type (created by CreateFrame("Frame")) that I can name off the top of my head. ClassTimers and LibCandyBar-3.0 (as stated earlier).

    I've actually seen in the LibCandyBar-3.0 addon the use of
    setmetatable(CreateFrame("Frame"), {__index = CreateFrame("Frame")});

    That's an even more confusing issue for me.

    My goal is basically to subclass the Blizzard UI "Frame" type. Perhaps this is something that can't be done at all. My juvenile understanding of metamethods had me jumping to the conclusion that I could do something like I've posted above.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Metamethods
    I guess I must be misunderstanding something.

    Here's my simple example:
    local myt = setmetatable({}, {__index = CreateFrame("Frame")});
    myt:SetParent("UIParent");

    The error produced is:
    "Attempt to find 'this' in non-framescript object"

    Now... I believe I understand the error however I'm not drawing a connection between how I used __index and how (for example) __index is used in "BigWigs" (on its status bar objects).

    I've seen __index = CreateFrame("Frame") used and I still don't completely understand why,
    Posted in: Lua Code Discussion
  • 0

    posted a message on Metamethods
    So why might I see:
    __index=CreateFrame("Frame")
    in other addons? (Apologies I did mean to use __index instead of __newindex)

    I am trying to make simple use of metamethods where I believe they should be used. In this case I'm trying to create a new "frame" type.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Metamethods
    So I've seen:
    setmetatable({}, {__newindex = CreateFrame("Frame")})
    used in a few addons from the wowace community, but I'm not quite understanding it.

    What I am trying to do is mimic inheritance (as I understand that is what metamethods can help accomplish).

    How do I get:
    local newtype = setmetatable({}, {__newindex = CreateFrame("Frame")})
    newtype:SetParent("UIParent")
    to work?

    If I attempt to make that 2nd line call I get a "this" does not exist or can not be found.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Spell Durations
    Sorry, I guess what I should say is: while wearing 4t10 the only buff related to "Mirror Images" is "Quad Core". I'd detest to include hard coded checks for buff/debuff modifications.

    I know some of you guys are in good with the devs at Blizzard. It'd be great if you could pass along at least my desire for a "SpellDuration" api. :)
    Posted in: Lua Code Discussion
  • 0

    posted a message on Spell Durations
    If you are referring to "Quad Core" -- that is a spell supplement provided by 4t10. There is no "Mirror Image" buff.
    Posted in: Lua Code Discussion
  • To post a comment, please or register a new account.