• 0

    posted a message on date leakage...
    When does the timezone change occur ? And when should you detect it ?

    As long as they don't change it during a playing session, calculing the delta a load time is sufficient.
    Posted in: Lua Code Discussion
  • 0

    posted a message on date leakage...
    What about this ?

    -- Calculate the timezone offset from time(), which should fixed for a given client
    local now = time()
    local delta = time(date("!*t", now)) - now
    -- Calculate the UTC time, based on time()
    function utc_time()
      return time() - delta
    end


    The table is used once at initialization.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Unable to check out AceConsole and AceEvent as externals
    AFAIK, the packager only uses the .pkgmeta file. It doesn't rely on other files and it doesn't directly use the svn:externals property (which wouldn't work with git repository anyway). However, it does use the standard svn tools. So when it gets your addon sources for packaging, it pulls the externals. I'm not sure about what happens if the libraries are listed in the .pkgmeta file too.
    Posted in: Need Help?
  • 0

    posted a message on new widget: Browser
    Given that all the GM chat thingy is still in the FrameXML, it's quite possible the in-game browser signals itself as such (using the User-Agent HTTP header), so they can identify these tickets and answer accordingly.

    I agree that's still a problem for people with considerable visual impairments.
    Posted in: Lua Code Discussion
  • 0

    posted a message on new widget: Browser
    The browser is used in HelpFrame.lua (look for "HelpBrowser") but it seems there is no much control over it. It seems the actual URLs are handled in the non-Lua part of the client.
    Posted in: Lua Code Discussion
  • 0

    posted a message on new widget: Browser
    Quote from myrroddin
    I'm confused. Is Blizzard using Chrome as its in-game help browser? Why are they not using something they wrote, or the OS's built-in browser, be it Safari or Internet Explorer?

    I am using Chrome for Windows right now; Firefox has become a bloated mess and Internet Explorer is a great way to get hacked. Chrome is lacking in several ways, but that is definitely off topic.


    I think they actually use a Chromium-based browser and not Chrome. The former is open-source (BSD license) and cross-platform. This makes sense to me :
    • they can integrate it in their project building process, be it for Windows, MacOS or Linux,
    • they don't have to cope with every quirks of every system browsers,
    • and they probably remove the features they don't want at compilation time.

    By the way, not using Internet Explorer seems a win for me. Does anyone remember when computers were infected by some malicious ads because the Curse Client uses IE for rendering them ?
    Posted in: Lua Code Discussion
  • 0

    posted a message on Inline Aura - display aura information inside action buttons
    Quote from Nathanyel
    Can IA track by ID only?


    It doesn't right now. Historically, there was no way to track (de)buffs by ID. This has been added in Cataclysm. But, alas, all IA configuration (built-in and user-defined) uses one ID to get the name for all variants of a (de)buff. Switching to an ID-only configuration would require to list all ID in the default settings and they would be some issues in some cases (macros and items).
    Posted in: General AddOns
  • 0

    posted a message on LibFunctional-1.0
    Some core review :

    contains, find_first_of, find_last_of, find_if create a new table, assign it to r, but never use nor return it.

    find_first_of, find_last_of could be implemented by creating a map out of ... (with true as a value) instead of using contains. The result would be in o(n) instead of o(n²).

    Moreover, this :
    local len = #list
    for i = 1, len do
    	local v = list[i]
    


    could be written as the more idiomatic form :

    for i, v in ipairs(list) do
    


    Some functions could also apply to maps as way as lists by using "for k, v in pairs(list) do" in their loops.

    And lastly, there is no need for :

    local len = #list
    for i = s, len do
    


    for arguments are evaluated only once, so it is equivalent for this, which is more idiomatic :

    for i = s, #list do
    
    Posted in: Libraries
  • 0

    posted a message on Addon author's reward program
    Quote from myrroddin
    Your points paid for all that? Congratulations! However, that is kind of deflating for us mere mortals.


    They paid for that over several years. I'm getting around 95 points per day.
    Posted in: General Chat
  • 0

    posted a message on Addon author's reward program
    Quote from Phanx
    The rewards are a nice bonus, but are completely incidental.


    Though I originally code addons to "scratch my itches", the author's reward is a nice bonus too and incidentally pays my subscription, my last computer and my wife and I are going in holiday to Rome this year. :-) However, as I seldom play now, finding some motivation to maintain my addons gets harder, maybe because my itches scratch less than before...
    Posted in: General Chat
  • 0

    posted a message on :SetShown("n") (and similar methods) evaluates false
    I've done some quick tests, that show that "n", "N" (actually any string starting with "n", lke "no"), 0, "0", 0.0, "f", "F" (actually any string starting with "f", like "false"), false and nil are considered false and anything else is considered true.
    Posted in: Lua Code Discussion
  • 0

    posted a message on "Convention" for certain commonly hooked functions?
    IIRC, AceEvent uses only one frame to handle all events. This was beneficial when Blizzard's event dispatching code was awful with too many frames. Anyway, AceEvent-3.0 is just a thin layer on top of CallbackHandler.
    Posted in: Lua Code Discussion
  • 0

    posted a message on :SetShown("n") (and similar methods) evaluates false
    It is probably the way "boolean values" (not the boolean type of Lua) are handled by Blizzard C code. It probably also handles 0 as false, even though 0 yields true in Lua.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Best Lua coding practise for continuously called functions
    Strings are allocated in the heap and freed by the garbage collector. However, if the computation returns a string that is already in use, it returns the existing string instance instead of creating a new one. However this is totally transparent for the programmer, and unless your function creates a lot of unique strings, you should not care about it.

    Moreover, explicitly cleaning up local variables has no effect, as leaving their scope has the same effect.
    Posted in: Need Help?
  • 0

    posted a message on Packager issues
    Same for AdiBags, plus bonus error when viewing packager status : "There was an error displaying this markup. Please report this to a moderator."
    Posted in: General Chat
  • To post a comment, please or register a new account.