Quantcast Beta API discussion - Page 11 - WoWInterface
 
Thread Tools Display Modes
08-06-12, 07:23 PM   #201
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,623
Thanks Talyrius
 
08-06-12, 07:33 PM   #202
Farmbuyer
A Cyclonian
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 43
Originally Posted by Allara View Post
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...).
 
08-06-12, 10:01 PM   #203
Talyrius
An Onyxian Warder
 
Talyrius's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 354
[Bug] SecureAuraHeader
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
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

Last edited by Talyrius : 08-08-12 at 11:15 PM.
 
08-11-12, 07:58 PM   #204
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,623
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

Last edited by p3lim : 08-11-12 at 09:22 PM.
 
08-11-12, 08:10 PM   #205
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,623
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",
},
 
08-12-12, 12:26 AM   #206
AcidWeb
A Wyrmkin Dreamwalker
 
AcidWeb's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 57
Originally Posted by p3lim View Post
Decided to get the info from what specs have what IDs from GetSpecializationInfoByID()
<snip>
Thank you for this one. Less work for me :P
 
08-12-12, 07:29 AM   #207
Meorawr
A Chromatic Dragonspawn
AddOn Author - Click to view addons
Join Date: Nov 2010
Posts: 193
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

Last edited by Meorawr : 08-12-12 at 08:02 AM.
 
08-12-12, 07:36 AM   #208
Jarod24
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Jul 2012
Posts: 66
Originally Posted by Talyrius View Post
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?
 
08-12-12, 12:19 PM   #209
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,623
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
 
08-12-12, 04:03 PM   #210
Farmbuyer
A Cyclonian
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 43
Originally Posted by p3lim View Post
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.
 
08-13-12, 12:58 PM   #211
Lombra
A Molten Giant
 
Lombra's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 544
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.
__________________
Grab your sword and fight the Horde!
 
08-13-12, 01:08 PM   #212
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,623
Originally Posted by Farmbuyer View Post
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:
 
08-13-12, 08:05 PM   #213
Farmbuyer
A Cyclonian
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 43
Originally Posted by p3lim View Post
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.
 
08-13-12, 08:47 PM   #214
Lombra
A Molten Giant
 
Lombra's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 544
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.
__________________
Grab your sword and fight the Horde!

Last edited by Lombra : 08-14-12 at 10:09 AM.
 
08-14-12, 11:15 AM   #215
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,623
5.0.4 on Live servers the 28th of August.
 
08-16-12, 03:09 PM   #216
Jarod24
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Jul 2012
Posts: 66
Originally Posted by Jarod24 View Post
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?
Originally Posted by p3lim View Post
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");

Last edited by Jarod24 : 08-16-12 at 03:18 PM.
 
08-17-12, 10:44 AM   #217
Iza
A Cyclonian
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 43
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?

Last edited by Iza : 08-17-12 at 10:59 AM.
 
08-17-12, 11:56 AM   #218
Xrystal
nUI User and Supporter
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,074
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.
__________________
 
08-17-12, 01:06 PM   #219
Iza
A Cyclonian
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 43
Originally Posted by Xrystal View Post
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.
 
08-17-12, 01:59 PM   #220
Xrystal
nUI User and Supporter
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,074
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.
__________________
 
 

WoWInterface » Site Forums » Archived Beta Forums » MoP Beta archived threads » Beta API discussion

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off