• 0

    posted a message on New and broken stuff with Cataclysm
    Quote from Arkayenro
    on live the itemID is always nil. its causing errors in blizzards own code because they use that to generate the chatlink.

    you would hope they chose a better way to reference things than their position in a local list (which they seem to like doing a lot).


    There is a concept of a currency ID, but there's no way to get that ID programmatically... and IDs for currencies you haven't seen will return nil results, even if the currency is valid (with the exception of the Archaeology currencies).

    The itemID is actually one of 4 unknowns that are returned...

    unk1, unk2, unk3, unk4 = 0 (usually), nil, 0, nil.

    unk1 is 400000 for the new Raid/BG currencies, and 10 for the new cooking awards. Unk2-4 are not returning anything unique at the moment.

    This behavior is the same across live, PTR and Beta.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Broker Currency
    Quote from Torhal
    That is not the same AddOn, and I'm actually surprised they allowed it to have the name. I'll be re-writing Broker_Currency for 4.0.


    Now you tell me. :)

    I'm already in the middle of a written-from-scratch replacement that includes Archaeology support. D'oh.
    Posted in: Data Broker AddOns
  • 0

    posted a message on Cooldowntimers3 dislike 4.0.1
    Hard to say without knowing how the addon accesses your spell list. If it used the old spellbook APIs, it will be broken, but you should be getting LUA errors in that case (if you have them turned on).

    The Spellbook and the API to query it has changed pretty drastically, and no addon that looks at the spellbook directly will work without someone making updates to it.

    EDIT: Also, since ranks are a thing of the past, if it did any pattern matching on names, that's bound to have trouble.
    Posted in: Lua Code Discussion
  • 0

    posted a message on GameTooltip:AddLine() and Ace3
    Glad you got it working... although I might use SecureHookScript() anyways the next time you visit the code. It's not vital in this case, but I'm always wary of addons that taint the code path without a need to do so. I get bitten by random addons in the weirdest ways. Good habits make good code. :)
    Posted in: Lua Code Discussion
  • 0

    posted a message on GameTooltip:AddLine() and Ace3
    Quote from Xinhuan
    Your OnMouseOver function needs to call the original hooked function I think. I forgot whether HookScript does this for you automatically or not, Nevcairiel might remember. :)

    The reason is that if the original hooked function is not called, then you don't have a GameTooltip to add text to as it would not have a valid owner, anchor, etc.


    I decided to look it up, since you brought up a good point...

    Quote from AceHook Documentation »
    The hook created will be a "safe hook", that means that your handler will be called before the hooked script ("Pre-Hook"), and you don't have to call the original function yourself, however you cannot stop the execution of the function, or modify any of the arguments/return values.


    So this is a bit of an interesting problem. It does call the original script for you, but it calls yours first. So the GameTooltip hasn't been initialized for the button yet, and any added lines will fall into the abyss.

    If the original poster uses SecureHookScript() instead of HookScript(), it should work, as SecureHookScript() creates a Post-Hook. That will mean the script will have run before you.
    Posted in: Lua Code Discussion
  • 0

    posted a message on GameTooltip:AddLine() and Ace3
    Timing may be important here... if your function is called first (before the function that displays the tooltip you are trying to hook), then the official UI will likely just nuke the lines you added.
    Posted in: Lua Code Discussion
  • 0

    posted a message on New and broken stuff with Cataclysm
    Quote from LaoTseu
    For those interested by the new Justice Points

    localized_label, amount, icon_file_name = GetCurrencyInfo(395)


    In English, localized_label == "Justice Points". icon_file_name == "pvecurrency-justice" (doesn't have the path). I use this to insert the justice point icon in my strings:

    format("%s\124TInterface\\Icons\\pvecurrency-justice:0:0:2:0:64:64\124t",amount)


    A couple additional comments and corrections. GetCurrencyInfo() returns more values...

    name, amount, iconFileName, unk1, unk2, unk3 = GetCurrencyInfo(<currency>)
    unk1, unk2, unk3 = 0, 0, 400000


    400000 is what is returned for Justice Points and Honor Points, as an example.
    There is also the changes to GetCurrencyListInfo()...

    name, isHeader, isExpanded, isUnused, isWatched, count, iconPath, unk1, unk2, unk3, unk4 = GetCurrencyListInfo(<index>)
    unk1, unk2, unk3, unk4 = 400000, nil, 0, nil


    So this 400000 value is important... is it perhaps something related to the cap on how many you can have (I read it was supposed to be 4000 at the start?).

    I think somewhere in the GetCurrencyListInfo return values, the currency ID is supposed to be there, but it isn't yet. Without that, it's tricky to correlate the two different sources of information.

    EDIT: Also an interesting thing to note: Archaeology uses the currency system too. It doesn't show up in the currency list (some internal flag you can't query hides them), but you can query the races and get their currency ID to pass to GetCurrencyInfo(). What's even more puzzling is that Archaeology doesn't even use GetCurrencyInfo for anything. It's just kinda there.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Wiki'd


    Thanks for adding it... I've not been very active in the community (shame on me), and I've just kinda been plugging along with the addon. When the page gets fixed, MrTrader should probably get moved into the Stand Alone section of the page. The data feed is more of a convenience feature than the core purpose these days.
    Posted in: Data Broker AddOns
  • To post a comment, please or register a new account.