WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   MoP Beta archived threads (https://www.wowinterface.com/forums/forumdisplay.php?f=162)
-   -   Beta API discussion (https://www.wowinterface.com/forums/showthread.php?t=43091)

p3lim 08-06-12 07:23 PM

Thanks Talyrius :)

Farmbuyer 08-06-12 07:33 PM

Quote:

Originally Posted by Allara (Post 259298)
It wouldn't surprise me if units were stored as a bitmask or some other representation (not a string) at the C level, which is why this isn't working as you'd expect. It'd also be much faster than a string comparison, which is why this new function is very helpful.

Lua string comparisons are O(1); in fact, inside the scripting engine, they are a simple pointer comparison, as equal string values are guaranteed to be at the same place in the string pool.

That said, I agree they're likely doing something special with unit IDs, and wouldn't expect this function to work on random strings (although my armchair guess is that, given the way string "interning" works, it wouldn't be Too Difficult to make it work...).

Talyrius 08-06-12 10:01 PM

[Bug] SecureAuraHeader
Quote:

There is a bug (present since patch 4.3) within the SecureAuraHeader. When using the 'consolidateTo' or 'includeWeapons' attributes, buffs aren't correctly hiding after the timer is dead or cancelled by the player if there are any temporary weapon enchants or consolidated buffs active.

Related thread:
http://eu.battle.net/wow/en/forum/topic/2868633701
An example:
http://www.wowinterface.com/forums/s...ad.php?t=43833

HOW TO FIX
Build 15952 - SecureGroupHeaders.lua, line 812:
Code:

        local deadIndex = display + 1;
        local button = self:GetAttribute("child"..deadIndex);
        while ( button ) do
                button:Hide();
                deadIndex = deadIndex + 1;
                button = self:GetAttribute("child"..deadIndex)
        end

Make a copy of the above code block and move it back to line 736. That's where it resided the last time it worked properly (patch 4.2). You'll have to redefine 'deadIndex' as being: #buttons + 1.

Your original modifications regarding the placement of this code block were made at the suggestion of Dargen (link below). However, he forgot to account for the use of the 'consolidateTo' and 'includeWeapons' attributes.
http://us.battle.net/wow/en/forum/topic/1920720200

IN ADDITION
http://us.battle.net/wow/en/forum/to...45961?page=1#3
Quote:

A second change that is still needed is to hide all of the items in the "buttons" table which are not being explicitly shown. Other buttons may have been shown during a previous call to this function, and the addon may have since reduced the values in the "wrapAfter" and/or "maxWraps" attributes.

In SecureGroupHeaders.lua, in the configureAuras function, after the loop that shows buttons from the "buttons" table, line 820 which currently reads:

Code:

        if ( display >= 1 ) then
should be changed to:

Code:

        for hideIndex = display + 1, #buttons do
                buttons[hideIndex]:Hide();
        end
        if ( display >= 1 ) then




p3lim 08-11-12 07:58 PM

UnitClass() has a 3rd return, classID.

Code:

1 = Warrior
2 = Paladin
3 = Hunter
4 = Rogue
5 = Priest
6 = Death Knight
7 = Shaman
8 = Mage
9 = Warlock
10 = Monk
11 = Druid


p3lim 08-11-12 08:10 PM

Decided to get the info from what specs have what IDs from GetSpecializationInfoByID()

Here is the list:
Code:

["HUNTER"] = {
        [255] = "Survival",
        [254] = "Marksmanship",
        [253] = "Beast Mastery",
},
["WARRIOR"] = {
        [73] = "Protection",
        [71] = "Arms",
        [72] = "Fury",
},
["PALADIN"] = {
        [70] = "Retribution",
        [65] = "Holy",
        [66] = "Protection",
},
["MAGE"] = {
        [64] = "Frost",
        [63] = "Fire",
        [62] = "Arcane",
},
["PRIEST"] = {
        [257] = "Holy",
        [258] = "Shadow",
        [256] = "Discipline",
},
["WARLOCK"] = {
        [266] = "Demonology",
        [267] = "Destruction",
        [265] = "Affliction",
},
["DEATHKNIGHT"] = {
        [252] = "Unholy",
        [251] = "Frost",
        [250] = "Blood",
},
["SHAMAN"] = {
        [263] = "Enhancement",
        [264] = "Restoration",
        [262] = "Elemental",
},
["DRUID"] = {
        [103] = "Feral",
        [104] = "Guardian",
        [102] = "Balance",
        [105] = "Restoration",
},
["MONK"] = {
        [269] = "Windwalker",
        [270] = "Mistweaver",
        [268] = "Brewmaster",
},
["ROGUE"] = {
        [260] = "Combat",
        [261] = "Subtlety",
        [259] = "Assassination",
},


AcidWeb 08-12-12 12:26 AM

Quote:

Originally Posted by p3lim (Post 259481)
Decided to get the info from what specs have what IDs from GetSpecializationInfoByID()
<snip>

Thank you for this one. Less work for me :P

Meorawr 08-12-12 07:29 AM

UnitAura seems to have changed but I couldn't find this mentioned anywhere. More importantly it's behaving in a really horrible way.

On live there's 13 return values (name through to isBossDebuff) plus an additional 3 return values for tooltip information.

In the latest build there's a minimum of 14 return values, the last one being a boolean. You'd expect the 3 tooltip values to then be values 15-17, however here's how it works for the following two buffs:

Legacy of the White Tiger:

14 return values, last one is a boolean. Values 15-17 aren't returned (so they're nil, effectively).

Life Cocoon:

17 return values, however 14-16 are the tooltip values, whereas this mystery boolean is #17.

Basically it's a major pain now because whereas we could (hopefully) have assumed #14-16 to be nil/number values, we now have to check if #17 is not nil in order to determine whether or not tooltip values exist.

Of course I could be completely missing something here so do correct me if I'm wrong :)

/dump's of the returns:
Code:

Dump: value=UnitAura("player", 1, "HELPFUL")
[1]="Legacy of the White Tiger",
[2]="",
[3]="Interface\\Icons\\ability_monk_prideofthetiger",
[4]=0,
[5]="Magic",
[6]=3600,
[7]=7377.351,
[8]="player",
[10]=1,
[11]=116781,
[12]=true,
[14]=true -- Mystery boolean, ooOOooOOoooOO!

Dump: value=UnitAura("player", 1, "HELPFUL")
[1]="Life Cocoon",
[2]="",
[3]="Interface\\Icons\\ability_monk_chicocoon",
[4]=0,
[5]="Magic",
[6]=12,
[7]=3926.258,
[8]="player",
[11]=116849,
[12]=true,
[14]=36848, -- Tooltip value #1 (absorb damage)
[15]=50, -- Tooltip value #2 (periodic healing bonus %)
[16]=0, -- Unused value #3
[17]=true, -- Mystery boolean, ooOOooOOoooOO!

In short the stack needs 0's or nil's at 14-16 for the first case :)

Jarod24 08-12-12 07:36 AM

Quote:

Originally Posted by Talyrius (Post 259303)

Been looking through globalstrings.lua and so far i have not been able to find the strings for the friendship levels. I hoped that there would be something similar to FACTION_BAR_COLORS and FACTION_STANDING_LABEL in there.

I did some digging and according to Nat Pagle (ref: http://www.elsanglin.com/nat_pagle.html) there are 6 ranks called: "Stranger", "Pal", "Buddy", "Friend", "Good Friend", and "Best Friend" in English.

I can't post on the US-forums, so im kindly asking Talyrius :) if he can do another post.
Is this a oversight by the devs or is there some other method to get this info?

p3lim 08-12-12 12:19 PM

The 6th return from GetFriendshipReputationByID(id) gives you the standing name of an NPC.
Also, the colors for bars are green all the way, since you can't go neutral or below with them.

To see how it could be implemented, here is a link to framexml and my addon, oUF_Friendship:

https://github.com/p3lim/wow-ui-sour...Frame.lua#L171
https://github.com/p3lim/oUF_Friends...ndship.lua#L80

As for the ID used for this function, you can gather them into a table by using this:
Code:

for index = 1100, 1500 do
    if(GetFriendshipReputationByID(index)) then
        table[index] = true
    end
end


Farmbuyer 08-12-12 04:03 PM

Quote:

Originally Posted by p3lim (Post 259480)
UnitClass() has a 3rd return, classID.

Code:

1 = Warrior
2 = Paladin
3 = Hunter
4 = Rogue
5 = Priest
6 = Death Knight
7 = Shaman
8 = Mage
9 = Warlock
10 = Monk
11 = Druid


If any of you are wondering, like me, what the point of these values are when the 2nd return value is already locale-independent, the answer seems to be: the numeric form is fed to talent-related functions. So far I see it passed to GameTooltip:SetTalent() and to GetTalentLink().

AFAICT there are no named constants for these values yet.

Lombra 08-13-12 12:58 PM

I only just got the beta, so this is probably "old", but I noticed a new event BAG_UPDATE_DELAYED firing, which I haven't seen any mention of so far. Not sure of the exact details, but basically seems to fire once per batch of BAG_UPDATE, presumably letting us no longer worry about throttling bag update event spam. Passes no arguments.

p3lim 08-13-12 01:08 PM

Quote:

Originally Posted by Farmbuyer (Post 259512)
If any of you are wondering, like me, what the point of these values are when the 2nd return value is already locale-independent, the answer seems to be: the numeric form is fed to talent-related functions. So far I see it passed to GameTooltip:SetTalent() and to GetTalentLink().

AFAICT there are no named constants for these values yet.

Look at the class order for the updated version of Interface\MINIMAP\POIICONS.BLP:

Farmbuyer 08-13-12 08:05 PM

Quote:

Originally Posted by p3lim (Post 259569)
Look at the class order for the updated version of Interface\MINIMAP\POIICONS.BLP:

Cute. I wonder if we'll start seeing function wrappers to do modulo math and return the texcoords, rather than a series of hardcoded texcoords like CLASS_ICON_TCOORDS.

Lombra 08-13-12 08:47 PM

Calling GetTransmogrifySlotInfo during PLAYER_LOGIN on a 64-bit client crashes the client. (still, so might not be wholly relevant to this thread) Could anyone perhaps file a US report on this? I mentioned it in the 64 bit feedback thread when they launched that, but didn't seem to help.

p3lim 08-14-12 11:15 AM

5.0.4 on Live servers the 28th of August.

Jarod24 08-16-12 03:09 PM

Quote:

Originally Posted by Jarod24 (Post 259497)
Been looking through globalstrings.lua and so far i have not been able to find the strings for the friendship levels. I hoped that there would be something similar to FACTION_BAR_COLORS and FACTION_STANDING_LABEL in there.

I did some digging and according to Nat Pagle (ref: http://www.elsanglin.com/nat_pagle.html) there are 6 ranks called: "Stranger", "Pal", "Buddy", "Friend", "Good Friend", and "Best Friend" in English.

I can't post on the US-forums, so im kindly asking Talyrius :) if he can do another post.
Is this a oversight by the devs or is there some other method to get this info?

Quote:

Originally Posted by p3lim (Post 259500)
The 6th return from GetFriendshipReputationByID(id) gives you the standing name of an NPC.
Also, the colors for bars are green all the way, since you can't go neutral or below with them.

To see how it could be implemented, here is a link to framexml and my addon, oUF_Friendship:
https://github.com/p3lim/wow-ui-sour...Frame.lua#L171
https://github.com/p3lim/oUF_Friends...ndship.lua#L80


Cool, all thats missing then are localized strings for the titles (stranger, pal, buddy etc).

There is nothing in _G about this at the moment so the only thing you can get is the current value from the function itself.

In other words: You can't get the next/previous level of friendship titles like you can with faction rep and FACTION_STANDING_LABEL1, FACTION_STANDING_LABEL2, etc

(some pseudocode to show what im trying to do).
Code:

local ... standingString = GetFriendshipReputationByID(666);
local standingID = <math to make standingID between 1 to 6>;
local nextString = _G["THIS_IS_MISSING"..tostring(standingID+1)];

Print("You are currently "..standingString..". You got X points until you reach "..nextString");


Iza 08-17-12 10:44 AM

GetSpellBookItemName(index, booktype) will cause an error ("... invalid spell slot ...") instead of returning <nil> values for non-existant spell slots it seems. I solved this by using pcall for the moment, but that's just not very smart. Is there way to tell how many slots there are?

Xrystal 08-17-12 11:56 AM

I used that in one of my addons earlier but managed to bypass it somehow but can't remember how but now I see that same error for GetSpellInfo as well in nUI. Not double checked my own addons yet. Something for tonight me thinks.

Iza 08-17-12 01:06 PM

Quote:

Originally Posted by Xrystal (Post 259793)
I used that in one of my addons earlier but managed to bypass it somehow but can't remember how but now I see that same error for GetSpellInfo as well in nUI. Not double checked my own addons yet. Something for tonight me thinks.

GetSpellInfo(spellId) is still working fine for me for some reason. I remember some people reporting inconsistent return values for some of the GetSpellxxx functions on official forums these days.

Xrystal 08-17-12 01:59 PM

I just took a look at my post in the nUI forums about my investigations yesterday and I found that somehow the way Scott has coded it to build the spell database for cool downs wow no longer likes it twice as the first time it goes through fine but the second time it errors out.

For no apparent reason barring it is a different event. Which makes it difficult if SPELLS_CHANGED isn't called when you learn a spell as if you tried to also run through the update routine when LEARNED_SPELL_IN_TAB event is fired it would error out. Or any such other Spell related event required an update to the table the way it currently does it in nUI.

If it isn't a blizzard oversight I may have to recode how it builds the spell database so that it could be dynamically built rather than rebuilt everytime.


All times are GMT -6. The time now is 11:43 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI