• 0

    posted a message on new fubarplugin lib for Ace3?
    What sort of information would you have Category convey? Just curious.
    Posted in: Libraries
  • 0

    posted a message on new fubarplugin lib for Ace3?
    You should have a required attribute of Name and Description so that users can choose which addons to display where based on name and description, rather than guessing.
    Posted in: Libraries
  • 0

    posted a message on new fubarplugin lib for Ace3?
    do
      local legos = LibStub("LegoBlock-Beta1")
      local broker = LibStub("LibDataBroker-1.0")
      local addon = Castle or {}
      Castle = addon
      local blocks = {}
      
      -- register for callbacks
      function addon:LDB_dataobject_registered(event, objectName, object)
       -- new object registered
       local object = object or broker:GetDataObjectByName(objectName)
       if object.lego then
         -- object wants to be a legoblock, let's do it
         local block = blocks[objectName] or legos:New(objectName)
         blocks[objectName] = block
         if type(object.legoDB) == "table" then block:SetDB(object.legoDB) end
         if object.text then block:ShowText(true); block:SetText(object.text) end
         if object.icon then block:ShowIcon(true); block:SetIcon(object.icon) end
         if type(object.click) == "function" then block:SetScript("OnClick", object.click) end
         if type(object.enter) == "function" then block:SetScript("OnEnter", object.enter) end
         if type(object.leave) == "function" then block:SetScript("OnLeave", object.leave) end
       end
       
       broker.RegisterCallback(addon, "LDB_attribute_changed_"..objectName, "Attribute_Changed")
      end
      
      function addon:Attribute_Changed(event, objectName, attribute, value)
       local object = object or broker:GetDataObjectByName(objectName)
       if object.lego then
         -- object wants to be a legoblock, let's do it
         local block = blocks[objectName] or legos:New(objectName)
         blocks[objectName] = block
         if type(object.legoDB) == "table" then block:SetDB(object.legoDB) end
         if object.text then block:ShowText(true); block:SetText(object.text) end
         if object.icon then block:ShowIcon(true); block:SetIcon(object.icon) end
         
         if type(object.click) == "function" then block:SetScript("OnClick", object.click) end
         if type(object.enter) == "function" then block:SetScript("OnEnter", object.enter) end
         if type(object.leave) == "function" then block:SetScript("OnLeave", object.leave) end
       end
      end
      
      broker.RegisterCallback(addon, "LDB_dataobject_registered")
      for name in broker:DataObjectIterator() do
       broker.RegisterCallback(addon, "LDB_attribute_changed_"..name, "Attribute_Changed")
      end
    end
    
    do
      local broker = LibStub("LibDataBroker-1.0")
      local object = broker:NewDataObject()
      object.legoDB = {}
      object.text = "Hello World"
      object.lego = true
      broker:RegisterDataObject("TestBlock", object)
    end


    and there you go, a simple mod to display anything that wants to be displayed as a lego block, that was relatively painless...

    -- edit --
    woops, forgot code blocks
    Posted in: Libraries
  • 0

    posted a message on new fubarplugin lib for Ace3?
    ok, so through my very naive experimentations, here's how I would use this lib:

    local broker = LibStub("LibDataBroker-1.0")
    
    print("Creating listener")
    local listener = {}
    function listener:LDB_dataobject_registered (event, objectName)
      --do stuff
    end
    
    function listener:Attribute_Changed(event, name, key, value)
      -- do stuff here
    end
    
    broker.RegisterCallback(listener, "LDB_dataobject_registered", listen)
    for name in broker:DataObjectIterator() do
      broker.RegisterCallback(listener, "LDB_attribute_changed_"..name, "Attribute_Changed")
    end


    then for an object it is just
    local broker = LibStub("LibDataBroker-1.0")
    
    local object = broker:NewDataObject()
    -- you can put new key, value pairs in now, but they won't fire to anything (which may be what you want)
    broker:RegisterDataObject("MySpiffyNewStuff", object)
    -- now you can put new key, value pairs in and they will fire events


    -- edit --
    btw, registering for each object change by name sucks imo
    Posted in: Libraries
  • 0

    posted a message on new fubarplugin lib for Ace3?
    is this data broker lib being developed anywhere or does it only exist on pastey?
    Posted in: Libraries
  • 0

    posted a message on Please no -Ace3- tag!
    Quote from Bam »

    TOC files are usually made by copy-pasting from another addon (because nobody can remember what fields are required.. lol).


    Correct, so let's make sure that we don't have any toc files for people to copy that include Ace3 in them (unless they are the Ace3 libraries).

    While there is no "good" reason for being so bitchy about branding, they did mention the biggest point.

    Ace3 is not a magic bullet that makes mods work better. It is just a framework for developing addons.

    I like to think of it as this: how many programs do you know include C# in their title or Java in their title (in color to make it stand out no less).

    Imo, just don't do it.
    Posted in: General Chat
  • 0

    posted a message on hosting -> thataway
    Quote from Industrial »

    08:05 < Industrial><snip> anything below toc 20100<snip>


    Just because it doesn't have toc 20100 doesn't mean it won't work.

    Out of all the addons in /trunk, there is only 1 addon that does not have a Interface of at least 20000 and that is a FixMe addon that does nothing.
    Posted in: General Chat
  • 0

    posted a message on Trying out Ace3 config
    I could see Ace3ConfigDialog taking an optional "Layout" field for the Open function

    maybe someone should put in a JIRA ticket
    Posted in: Ace3
  • 0

    posted a message on Development state
    bastard.
    Posted in: Ace3
  • 0

    posted a message on Development state
    it is fairly stable, we recently broke it last night (cough nevcairiel cough) but it should be fixed this morning.

    kaelten and i would like an Ace3 Beta by christmas :D
    Posted in: Ace3
  • 0

    posted a message on Development state
    There are several mods that are using Ace3 atm. I recommend you do any development in the branches directory and don't put Ace3 mods in /trunk (if you develop on the Ace SVN). If you release a mod, please make sure it is marked as Beta.

    (PS, in no way do I represent anybody but myself)
    Posted in: Ace3
  • 0

    posted a message on Combuctor: All in one, filterable displays for your inventory and bank
    they are pulling different versions of the embedded libraries, install the Ace3/Beta branch of Ace3 and they both work
    Posted in: General AddOns
  • 0

    posted a message on Outlining the differences between Ace2 and Ace3
    @AceLocale, please join in the jira discussion on it
    Posted in: Ace3
  • 0

    posted a message on Rock/Ace3 - Regarding drama and functionality.
    Please do not liken ckknight to Linus Torvalds, they aren't really similar.

    The idea is that Ace3 and beyond will NOT be branded like Ace2 was. If you get rid of the branding then you get rid of users saying "Ace this please!" which will make other addon writers happy because they won't be asked any longer.
    Posted in: Frameworks
  • 0

    posted a message on Rock + Ace3
    i would create a thread in the addon specific forum
    Posted in: Frameworks
  • To post a comment, please or register a new account.