• 0

    posted a message on Dynamic Frames
    You can't destory a frame. Setting dynFrames [2] = nil, would only remove Its "link" to the frame. The frame it self, would still exist.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Dynamic Frames
    To make a template, you have to set virtual="true" on the frame in your xml file.
    Posted in: Lua Code Discussion
  • 0

    posted a message on OnUpdate question, or: how to timeout a dialog?
    OnUpdate is triggered every time the frame is redrawn. So if you have 43 fps, it will trigger it 43 times a second. Which is perfectly fine for small tasks, like making a timer.

    If you hide the frame, the OnUpdate will stop.

    I'm still learning, but I'm pretty sure it's no better way than doing it the way you are.
    Posted in: Lua Code Discussion
  • 0

    posted a message on [code cleanup/questions] first addon
    Quote from essmene
    Hi,
    Now i have 175 times
       if not self.db.profile.zones[tag] or type(self.db.profile.zones[tag]) ~= 'table' then
          self.db.profile.zones[tag] = {}
       end
    to check for empty non-existent tables to prevent 'trying to index table xx - which is nil'.


    I'm still learning, so I might not be the best to answer this, but I believe what you want to do is to set up a metatable, so everytime you index your db table, it will access your defaults table if it cant find it.

    Something like this:
    <script src="http://gist.github.com/75789.js"></script>
    Posted in: Lua Code Discussion
  • 0

    posted a message on Assessment - Official Thread
    The "Bar count" option seems too be changing the height of the bars, instead of how many bars it should be, guess this is a bug. Using revision 47163.
    Posted in: General AddOns
  • 0

    posted a message on Actionbar addon + change page when hostile target
    Hello.

    I'm looking for a actionbar addon that allows me too change the page when I'm targeting a hostile target.

    Like, if I got page1 on my mainbar, then if I target a enemy, the bar will change page too 3.
    Bongos got a function that allows me too change page if I got a friendly target, so I tried too look trough the lua files.

    I tried changing: (I know nothing about lua coding)
    	--friently target check
    	if(UnitCanAssist("player", "target") and self:GetStateOffset("help")) then
    		return HELP_STATE
    	end


    too
    	--friently target check
    	if(UnitCanAttack("player", "target") and self:GetStateOffset("harm")) then
    		return HELP_STATE
    	end


    Without success.

    I've also tried Bartender3 and InfiBar, but none of them seems too have a function like this.
    Would be really helpfull if someone knew any actionbar mod that does this, or if someone could change the bongos files too change page on hostile instead of friendly target.

    Thanks.


    /nifty
    Posted in: General Chat
  • To post a comment, please or register a new account.