• 0

    posted a message on Can't compare profile tables correctly
    When your saved variables are fresh (i.e. GUB.MainDB is empty), AceDB generates .profile the moment you try to get it using the metatable. This is why AceDB fires "OnNewProfile" when you get GUB.MainDB.profile for the first time.

    By the way, you should use addon:OnInitialize, that is called only once by AceAddon-3.0, instead of using OnEnable + an initOnce value.

    Basically, with AceDB-3.0 you should never tinker with the saved variable nor the defaults directly. If you have something to handle by youtself, like the version, do not put it into the default.

    The other solution is to recognize the version of the variables by checking its content instead of a version field so you wouldn't have to bother with OnNewProfile.
    Posted in: Ace3
  • 0

    posted a message on Can't compare profile tables correctly
    I wasn't aware it fires both OnProfileChanged and OnNewProfile in that order. Anyway, since my upgrade function is idempotent, this is a non-issue. And for calling ApplyProfile twice, it's a bit annoying but I don't think this is something to bother with, unless the player creates a couple profile every seconds during combat...
    Posted in: Ace3
  • 0

    posted a message on Can't compare profile tables correctly
    Several of my addons had to deal with profile upgrading. Here are two ways of handling this :

    1) with a "version" field in the profile : http://www.wowace.com/paste/8815/
    2) using a idempotent upgrade method : http://www.wowace.com/paste/8816/

    In both case you have to handle the old defaults in the upgrading process.
    Posted in: Ace3
  • 0

    posted a message on AceGUI-3.0 child anchoring confusion
    Quote from Dridzt
    In this particular case (the original addon I'm working on, not the stripped down example code I posted to illustrate this particular issue) the button widgets are added based on a dynamic list and the icon widget needs to anchor to any one of them, not a particular one.
    If I wanted to have it be next to button no2 always then doing :AddChild() in the 'proper order' and letting the layout do its job would be sufficient but like I said the anchoring is volatile.


    How do you choose which button the icon should be anchored too ? ???
    Posted in: Ace3
  • 0

    posted a message on AceGUI-3.0 child anchoring confusion
    IIRC, one of the objectives of AceGUI is the automated layouts ; another one being recycling widgets.

    You can add new layouts algorithm using AceGUI:RegisterLayout("layoutId", function(content, children) ... end). The function is called each time the container is resized. You can change the layout of a container with container:SetLayout("layoutId").
    Posted in: Ace3
  • 0

    posted a message on LibNameplateRegistry-1.0
    I'll give it a try to replace LibNamePlate-1.0, which isn't maintained anymore and seems to cause errors.
    Posted in: Libraries
  • 0

    posted a message on LibMounts-1.0
    I have discussed with Stanzilla on the IRC channel. This should be fixed by the latest alpha.

    Since LibMounts-1.0 gets most of this data from the game API introduced some patches ago, addons and the library should wait until those data are available. The original implementation waited for PLAYER_LOGIN, but it seemed it wasn't sufficient with some clients.
    Posted in: Libraries
  • 0

    posted a message on Embedding BugGrabber ?
    Quote from Archarodim

    Also note that many other popular add-ons (Auctioneer for example) implements their own bug grabbing mechanism which will prevent the embedded buggrabber to initialize. In Decursive when bugGrabber is not available I'll register my own error handler to grab errors (using seterrorhandler() ) and do my best to forward them to other handlers


    Why did you embed BugGrabber if you also had to implement your own error handler ?
    Posted in: Lua Code Discussion
  • 0

    posted a message on Embedding BugGrabber ?
    Hello,

    I'm getting tired of reports like "[addon] stopped working" or "[addon] is causing major fps drop", that generally indicate hidden errors. Asking the reporting user to enable Lua error display or to install an error handling addon is useless in most cases.

    So I wonder about embedding BugGrabber in some of my addons. I was thinking about adding a small home-brew error handler but BugGrabber already does it pretty well, see the file embedding.txt in the !BugGrabber folder. I would indicate this on the addon main page so people would know (yes, I know people won't read and complain anyway).

    Any thought on this ?
    Posted in: Lua Code Discussion
  • 0

    posted a message on russian clients fail string match pattern
    Localized strings are encoded in UTF-8 but the string functions, including string.match, do not. So basically %a fails to match letters of 13 locales out of the 15 supported ones.
    Posted in: Need Help?
  • 0

    posted a message on OnUpdate not stopping when set to nil
    Swatter is an alternative to BugSack. You don't have to install both.
    Posted in: Need Help?
  • 0

    posted a message on LibMapPins-1.0
    Actually GatherMate uses the categories so it stores only (coords => categoryId) pairs ; coords being an integer calculated using LibMapData. This is pretty efficient to store lots of points.
    Posted in: Libraries
  • 0

    posted a message on OnUpdate not stopping when set to nil
    Quote from Phanx
    there is also a limit on the number of locals you can have.


    I didn't know. Is this documented somewhere ?

    Quote from Phanx
    (4) I'm not really sure why you're using an OnUpdate at all. It looks like you're just reporting when you see a rare mob if nobody else has already reported it, in which case you should just report it right away, instead of waiting some random small amount of time first.


    If the event is detected simultaneously by several players using the same addon, they will all announce it to the general channel, resulting in some spam. By adding a small random delay, the announces are spread in time. The first one will shut the other ones, since the addon also watches the channel for such announces.
    Posted in: Need Help?
  • 0

    posted a message on LibMapPins-1.0
    If you want some example of world/mini-map display, take a look at Gathermate2. Some parts are definitively deeply tied to Gathermate2 and should be refactored but the whole thing worths looking at. And it's GPL'd.

    I have been thinking about two addons who could use such library. I wrote one of them but it just shoehorns its points into Gathermate (which allows it though it lacks a few API). This is what I would expect :

    • handle a separate database par addon (or even several databases per addon : identify database with an arbitrary keys, which happens to be the addon table when the library is embedded. See how AceEvent handle this),
    • define pin categories (associate labels and icons to keys),
    • add pin to any map,
    • remove any pin ,
    • show/hide all pins,
    • clear all pins,
    • provide some callbacks for user interaction (onEnter, onLeave, onClick) for both minimap and worldmap pins,
    • (optional or configurable) display pins only on either worldmap or minimap,
    • (optional or configurable) display nearby pins on minimap border,
    • (optional or configurable) hide/change minimap pins when the player gets closer to them.

    I'm not sure about point categories. It fits addons like gathermate that handles several points with the same labels and icons but it could be awful for addon handling unique points.
    Posted in: Libraries
  • 0

    posted a message on Check for Flex
    Er... Your ChatType functions awaits a "chatType" parameter but none is given in the call in the example. Is it intended ?
    Posted in: Lua Code Discussion
  • To post a comment, please or register a new account.