• 0

    posted a message on Unregistering an Event
    Say I have two addons that registered "ACommonBlizzardEvent".

    If one addon unregisters this event, is it still registered in the other addon?

    Posted in: Lua Code Discussion
  • 0

    posted a message on Dropdown menu woes
    Quote from Xinhuan »

    Yes. ToggleDropDownMenu indeed executes the function stored in .initialize when the menu appears, same for submenus, hence there is a "level" argument.

    Note that the CreateFrame() must specify a name in the 2nd argument. ToggleDropDownMenu doesn't like unnamed frames.

    Ahh, I see.

    Excellent!

    Finally, a non-XML equivalent of the DropDown object process.

    Hehe... one of those cases where an object name is needed. :)

    Posted in: Lua Code Discussion
  • 0

    posted a message on Dropdown menu woes
    Xinhuan:

    Yeah, I saw that.

    As I was scanning the code, I had expected that the CreateFrame that creates the dropdown would inherit from UIDropDownMenuTemplate.

    Surprised not to see that.

    At this time, I have no need to place any drop down objects on my mod, but, I'll be tagging your code for reference when the time comes (and probably will :))

    Is...
    WoWEquip_TalentsDropDownMenu.initialize	= WoWEquip_GenerateTalentMenu;

    ... the equivalent line for the UIDropDownMenuTemplate?


    In <objectName>.initialize = function, will the function get executed when said object gets shown?

    Posted in: Lua Code Discussion
  • 0

    posted a message on Dropdown menu woes
    If you are using Ace2, try using the /dump command followed by the name of the dropdown object you've created.

    It will give a detailed list on the setting the object allows. It helps me a lot when debugging my addons.

    Also, I recommend getting Buggrabber and Bugsack. Errors will be more easy to find.


    Check the anchors of the drop down maybe it is still referring to the UIParent as a relative point even though the parent is your main frame.

    Posted in: Lua Code Discussion
  • 0

    posted a message on New to mods need some help
    Quote from JaedxRapture »

    Many guilds for this reason (and for the fact that specifically threat addons need to be run by just about everyone to work), will require you to run a threat meter for optimal performance.

    Assuming the guild is at optimal performance for the encounter. :D

    Sorry, can't resist.

    But, I agree, addons do help. I love Clique.
    Posted in: General Chat
  • 0

    posted a message on Memory Usage
    Quote from tekkub »

    Reload as often as I do, and you'll care about it :P

    Quote from Seerah »

    Been there, done that. :) But there are better things to worry about. Different strokes for different folks. ;)

    I have 2 sets of WTF and Interface folders.

    One for development, which has nothing but the addon I'm working on and Buggrabber and Bugsack.

    The other is my "playtime" folders which has all of the addons I'm currently using.

    All it takes is just renaming the folders. :)

    Posted in: General Chat
  • 0

    posted a message on Problem with 'WelcomeHome' Tutorial
    Another option is to get Buggrabber and Bugsack (available in files.wowace.com).

    It helps me a lot in finding errors in my addons.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Raising Custom Events
    Quote from tekkub »

    We're actually moving away from this with Ace3. Yes the mechanism will still be there, but "custom events" are becoming "messages" and are being uncoupled from the "real" event dispatcher. No matter how many times we said it, nor how big and bold, people were still firing BLIZZARD events thru the Ace2 event dispatcher and potentially fucking other mods. So no more, you can fire "messages" and things registered for "events" will never hear them.

    I, for one, do not have intentions on firing Blizzard Events (such as PLAYER_ALIVE).

    Are these "messages" only available in the Ace3 framework?

    Posted in: Lua Code Discussion
  • 0

    posted a message on Raising Custom Events
    Quote from JaedxRapture »

    Yeah. Just remember not to use very generic event names, just like with variables. You don't want them to cause issues with other addons.

    Yes. I'll always prefix the event with "MyAddOn_".

    Posted in: Lua Code Discussion
  • 0

    posted a message on Raising Custom Events
    Quote from Bam »

    The default API does not support anything like that. Are you using Ace2 or some other framework? In Ace2 you can trigger custom events using AceEvent-2.0. If you are not using a framework, then you are on your own and will have to implement something similar yourself. :)

    Thanks for the response, Bam.

    And yes, I'm using Ace2.


    Hmm... is it as simple as:
    function MyAddOn:OnEnable()
     self:RegisterEvent("MyAddOn_MyCustomEvent")
    end
    
    ..elsewhere in one or more addons
    
    function MyAddOn:DoStuff()
    
      self:TriggerEvent("MyAddOn_MyCustomEvent")
    
    end



    EDIT: Changed some name data
    Posted in: Lua Code Discussion
  • 0

    posted a message on Raising Custom Events
    Can I within my addon(s) raise my own custom event?

    So, when I raise the custom event, 2 or more of my addons can respond to the event and make updates and do sh!t.


    Posted in: Lua Code Discussion
  • 0

    posted a message on Get Name of Party Members
    Quote from Verdemis »

    Hi,

    since some days i trying to learn how to make my own addons for wow.
    But know i have a problem. I didnt find a way until know, maybe some
    can help me?
    What im trying is to get the names of all partymembers. Is there a way to
    get the characternames from the members of the party?

    cya
    Verdemis



    http://fara.webeddie.com/frames/
    http://fara.webeddie.com/ui/
    http://www.wowwiki.com/Widget_API
    http://www.wowwiki.com/World_of_Warcraft_API

    The above links are what I normally use as reference.

    Posted in: Lua Code Discussion
  • 0

    posted a message on Scroll Frames
      	FauxScrollFrame_Update(MyScrollFrame,#ScrollDisplayData,numToDisplay,buttonHeight)


    I think I found a bug with FauxScrollFrame_Update.

    If numToDisplay >= the count of ScrollDisplayData, the buttons do not appear and fails silently.

    I create the buttons prior to executing the FauxScrollFrame_Update.

    Posted in: Lua Code Discussion
  • 0

    posted a message on Table Efficiency
    Quote from tekkub »

    In short...
    local x = {} -- Table #1
    local y = {} -- Table #2
    x = {} -- Table #3
    x = {} -- Table #4
    collectgarbage("collect") -- #1 and #3 are collected



    Thanks tekkub.

    Edit:
    Lastly, I've been known to do this:
    function MyAddOn:SomeFuncThatUseLocalTable()
    
      local usedAbusedTable = {} -- or some function that returns a table
    
      ... Do Sh!t
    
    end


    Will GC collect usedAbusedTable when function ends?

    Said function might be called numerous times.

    Please say that GC collects the table...
    Posted in: Lua Code Discussion
  • 0

    posted a message on Table Efficiency
    Thank you for the responses.

    I think I'll add natan_j's recursive function to my collection.

    For the most part, when I create a table it is fairly static, and if the data does change, the size of the table doesn't change (usually).

    Am I right to assume that...
    function CreateButton()
    
      local button = CreateFrame("Button","MyMainButton",UIParent,"UIPanelButtonTemplate")
    
      ... set various settings
    
      return button
    
    end

    ... the variable, button, will contain a table reference and said table reference will be returned to the calling function.

    And if the calling function is:
      local myButton = CreateButton()

    ... myButton (local) and MyMainButton (global) will have the same table reference as what button (local) used to be?
    Posted in: Lua Code Discussion
  • To post a comment, please or register a new account.