• 0

    posted a message on Memory Usage - Something that puzzles me
    Quote from sylvanaar »

    I completely understand that part. Lets drop the local reference topic.



    Here is what you said about the first 2 numbers:


    Why does adding a function closure add 28K?

    The function is never executed. So why does it also use the 31K the globals would have.

    Why is there another ~29K that is unaccounted for.


    http://www.wowwiki.com/Lua_object_memory_sizes

    I have no idea where that ~29k came from. That page says function closures at 20k but in fact they're 28k.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Memory Usage - Something that puzzles me
    Quote from sylvanaar »

    what the local is refering to is gc'd. My simple example just used numbers, but replace those with tables then. My point is that they are discarded.

    Why doesnt referencing a local make sense?

    local a = {}
    
    foo = a <-- referencing a local


    By the way, i'm not concerned with the locals anyways. I want to know why the first 2 numbers differ by so much.




    It's not referencing a local. If you did a = 5, foo would not be 5. foo would still reference the table. The statement is just setting foo to reference what a is referencing. Anyways, I explained how the sizes differ in my first post.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Memory Usage - Something that puzzles me
    Locals arent gc'd, they're stored on the stack. Referencing a local doesn't even make sense.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Memory Usage - Something that puzzles me
    2nd example should add 28k because it added a function closure. I don't know where the other ~29k came from. 3rd example just has a bunch of local variables referencing constants. From what I've read, local variables are stored on the Lua stack so it's basically 'free'. I never heard of a limit of 200 locals. I know that you can only have 2^18-1 constants.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Self-generating code anyone?
    How do you handle non-unit events in your unitframe addon?
    Posted in: Lua Code Discussion
  • 0

    posted a message on ElkBuffBar trouble
    Quote from Seerah »

    afaik, EBB just uses the icon provided by the client. cyCircled doesn't even have a plugin for it, because it's not a button frame to skin (or something like that...). I believe that if you want to change the look of the icons themselves, you'd have to get the UI mod from the WoW site, extract all of the icon art, and edit each one yourself. But that's just a guess. :) Oh - or you could alter the code in EBB to change the part of the icon we see.... /shrug

    For example: attached is the icon for Fire Armor. Notice the built-in border around it.


    You could just use the SetTexCoord function on a texture to make it appear like you removed the border.
    Posted in: General Chat
  • 0

    posted a message on Making Frames fill Gaps
    Hi, I'm planning on making a row of buttons and if I removed a certain button, the correct buttons will shift to fill in the gap caused by the removed button.

    For example if I had

    btn1 | btn2 | btn3 | btn4 | btn5 |


    and removed btn3 it would look like
    btn1 | btn2 |   | btn4 | btn5 |


    I want to make the btn4 and btn5 automatically shift over if its removed so it looks like
    btn1 | btn2 | btn4 | btn5 |


    So, I'm just wondering if anyone can give me some tips on how to do the anchoring and updating. Thanks.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Looping a CandyBar
    TremorBar = AceLibrary("AceAddon-2.0"):new("AceEvent-2.0", "AceConsole-2.0", "CandyBar-2.0") 
    
    
    local CandyBar = AceLibrary("CandyBar-2.0")
    
    function TremorBar:OnEnable()
    		self:RegisterCandyBar("totem", 4, "")
    		self:SetCandyBarGroupPoint("totem","CENTER","UIParent","CENTER")
    		self:SetCandyBarReversed("totem", true)
    		self:RegisterEvent("CHAT_MSG_SPELL_SELF_BUFF","createBar")
    end
    
    function TremorBar:createBar(msg)
    	if msg == "You cast Tremor Totem." then
    		TremorBar:loopBar()
    	end
    end
    
    function TremorBar:loopBar()
            self:StartCandyBar("totem")
    		self:SetCandyBarCompletion("totem",TremorBar.loopBar,TremorBar)
    end


    I just removed the 2nd arg and it still doesn't loop. Should I just register a new name for each bar everytime it loops or would that be really memory inefficient?
    Posted in: Lua Code Discussion
  • 0

    posted a message on Looping a CandyBar
    I got it to recall the function

    self:StartCandyBar("totem",false)

    The line above just doesn't work more than once

    I tried unregistering "totem", then registering it again, and trying to start, it but it doesn't work

    I have to register a completely different name like "totem2" to be able to fire another bar that's not named "totem". Is this how it's suppose to work?
    Posted in: Lua Code Discussion
  • 0

    posted a message on Looping a CandyBar
    Yeah, I checked that it's the right event. When I test this it creates a bar, but only once. I've tried unregistering the candybar, stopping the candybar and then trying to start it again but it won't fire for some reason. I can't find the underlying problem.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Looping a CandyBar
    TremorBar = AceLibrary("AceAddon-2.0"):new("AceEvent-2.0", "AceDB-2.0", "AceConsole-2.0", "CandyBar-2.0")
    
    
    local CandyBar = AceLibrary("CandyBar-2.0")
    
    
    function TremorBar:OnInitialize()
      -- Called when the addon is loaded
    	self:RegisterCandyBar("totem", 4, "")
    	self:SetCandyBarGroupPoint("totem","CENTER","UIParent","CENTER")
    
    end
    
    function TremorBar:OnEnable()
      -- Called when the addon is enabled
    		self:RegisterEvent("CHAT_MSG_SPELL_SELF_BUFF","createBar")
    end
    
    function TremorBar:createBar()
    	self:StartCandyBar("totem",false)
    	self:SetCandyBarCompletion("totem",TremorBar.createBar,self)
    end
    
    
    function TremorBar:destroyBar()
    
    end
    
    function TremorBar:OnDisable()
      -- Called when the addon is disabled
    end


    I'm trying to loop a bar whenever I drop a totem but it doesn't seem to work. Anyone got a quick fix?
    Posted in: Lua Code Discussion
  • 0

    posted a message on [Request] Tremor Totem Timer Bar
    Hi, I play a Shaman and do arena a lot. I use a mod called TotemTimers and it has a vertical bar that grows upwards until it hits the top and resets itself. Basically it simulates a pulse of a totem and only appears once you drop the totem. I don't want to have to look at the TotemTimers frame and concentrate on the bar to see when it would pulse. Could someone create a horizontal bar that simulates the pulse of a tremor totem? It'd kind of look like this.

    I primarily want it for tremor totem but someone could make it more flexible so it works for every totem spell. Like you can create a pulse bar for every totem if you wanted to. Of course, it'd be resizable and movable.

    Thanks for reading.
    Posted in: Addon Ideas
  • To post a comment, please or register a new account.