Quantcast Notable API changes in Legion - WoWInterface
 
 
Thread Tools Display Modes
03-22-16, 07:32 PM   #1
icyblade
A Deviate Faerie Dragon
 
icyblade's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2014
Posts: 13
Notable API changes in Legion


Hi everyone, I'd like to share some notable API changes in Legion. All of them have been tested in current alpha realm and I'm pretty sure you guys may in need of them. :-)
  • animationGroup:SetChange() has been removed
    This one occurs in such circustance:
    Lua Code:
    1. local flash = item:CreateAnimationGroup()
    2. for i = 1, 3 do
    3.     local fade = flash:CreateAnimation('Alpha')
    4.     fade:SetDuration(.2)
    5.     fade:SetChange(-.8)
    6.     fade:SetOrder(i * 2)
    7.  
    8.  
    9.     local fade = flash:CreateAnimation('Alpha')
    10.     fade:SetDuration(.3)
    11.     fade:SetChange(.8)
    12.     fade:SetOrder(i * 2 + 1)
    13. end
  • GetAuctionItemClasses() has been removed
    This one occurs in such circustance:
    Lua Code:
    1. local QUEST = select(10, GetAuctionItemClasses())
    In fact, QUEST == "Quest" in enUS, just a string indicating quest items.
  • SetTradeSkillItem() has been removed
    This one occurs in such circustance:
    Lua Code:
    1. hooksecurefunc(tooltip, 'SetTradeSkillItem', OnTradeSkill)
  • UnitIsTapped()/UnitIsTappedByPlayer() has been removed
    This one occurs in such circustance:
    Lua Code:
    1. if not isName and (dead or (UnitIsTapped(unit) and not UnitIsTappedByPlayer(unit))) then
    2.     return 0.5, 0.5, 0.5
  • UnitPowerMax()/UnitPower() should specify power type now, not an optional one
    We use this code now:
    Lua Code:
    1. local value = UnitPowerMax(unit)
    In Legion we should do something like this:
    Lua Code:
    1. local value = UnitPowerMax(unit, UnitPowerType(unit))
  • texture:SetTexture(r, g, b, a) changes into texture:SetColorTexture(r, g, b, a)
    texture:SetTexture(texture_path) is working as well, but Blizzard creates as new SetColorTexture to cover texture:SetTexture(r, g, b, a) function.
    In Legion if you want to specify texture by a texture path, use SetTexure. For RGBA value, use SetColorTexture instead.
  • item:125794:::::::::: is allowed now
    For item link, we use something like "item:125794:0:0:0:0:0:0" before.
    But in Legion, we can dismiss these zeros.
    For user who wants to regex an item link, this is useful.
  • We can use texture:SetTexture(file_id) now, so GetSpellInfo will not return a texture path as the 3rd return value
    We use this code to set an icon now:
    Lua Code:
    1. local _, _, icon = GetSpellInfo(spell_id)
    2. texture:SetTexture(icon)
    In Legion, that's easier:
    Lua Code:
    1. file_id = GetSpellTexture(spell_id)
    2. texture:SetTexture(file_id)
Here is what I'm using in alpha realm:
https://github.com/icyblade/wow_addons
I did some changes to these addons so they will work in alpha environment.
__________________
Talk is cheap, show me the shell

Last edited by icyblade : 07-23-16 at 01:41 AM.
 
03-23-16, 04:51 AM   #2
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,694
Originally Posted by icyblade View Post
UnitPowerMax()/UnitPower() should specify power type now
We use this code now:
Lua Code:
  1. local value = UnitPowerMax(unit)
In Legion we should do something like this:
Lua Code:
  1. local value = UnitPowerMax(unit, UnitPowerType(unit))
Not new, this has been in for a few expansions now. Maybe you meant it's not optional any more?
 
03-23-16, 07:03 AM   #3
Gello
A Firelord
AddOn Author - Click to view addons
Join Date: Jan 2005
Posts: 488
All of them have been tested in current alpha realm
Are scripts in some capacity working on alpha realms? Or are these just observed in the alpha UI?
 
03-23-16, 08:20 AM   #4
icyblade
A Deviate Faerie Dragon
 
icyblade's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2014
Posts: 13
Originally Posted by Gello View Post
Are scripts in some capacity working on alpha realms? Or are these just observed in the alpha UI?


Here is what I'm using in alpha
https://github.com/icyblade/wow_addons
__________________
Talk is cheap, show me the shell
 
03-23-16, 08:31 AM   #5
Gethe
RealUI Developer
 
Gethe's Avatar
Premium Member
Featured
Join Date: Sep 2008
Posts: 924
Originally Posted by Gello View Post
Are scripts in some capacity working on alpha realms? Or are these just observed in the alpha UI?
Not officially, there are ways to hack the exe and enable addons.
__________________
Knowledge = Power; Be OP

 
03-23-16, 01:48 PM   #6
JDoubleU00
A Scalebane Royal Guard
 
JDoubleU00's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 427
Originally Posted by Gethe View Post
Not officially, there are ways to hack the exe and enable addons.
I've been playing the Alpha (not as a developer) and the Addon button is active and does go to the addon list (I have two libraries for some reason).
__________________
Author of JWExpBar and JWRepBar.
 
03-23-16, 11:51 PM   #7
Gethe
RealUI Developer
 
Gethe's Avatar
Premium Member
Featured
Join Date: Sep 2008
Posts: 924
Yeah the game recognizes that you have addons installed, but it won't run them.

I currently have RealUI installed on my alpha client (mostly because addons were legit active for that first public build), so if addons were being run it would be very obvious for me.
__________________
Knowledge = Power; Be OP

 
03-23-16, 08:19 AM   #8
icyblade
A Deviate Faerie Dragon
 
icyblade's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2014
Posts: 13
Originally Posted by p3lim View Post
Not new, this has been in for a few expansions now. Maybe you meant it's not optional any more?
Yes, it's not optional now
__________________
Talk is cheap, show me the shell
 
03-23-16, 08:31 AM   #9
Lombra
A Molten Giant
 
Lombra's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 554
Originally Posted by icyblade View Post
We can use texture:SetTexture(spellId) now, so GetSpellInfo will not return a texture path as the 3rd return value
We use this code to set an icon now:
Lua Code:
  1. local _, _, icon = GetSpellInfo(spell_id)
  2. texture:SetTexuture(icon)
In Legion, that's easier:
Lua Code:
  1. texture:SetTexuture(spell_id)
This seems weird...
__________________
Grab your sword and fight the Horde!
 
04-11-16, 03:56 PM   #10
Blazeflack
A Deviate Faerie Dragon
Join Date: Sep 2006
Posts: 12
Originally Posted by icyblade View Post

We can use texture:SetTexture(spellId) now, so GetSpellInfo will not return a texture path as the 3rd return value
We use this code to set an icon now:
Lua Code:
  1. local _, _, icon = GetSpellInfo(spell_id)
  2. texture:SetTexuture(icon)
In Legion, that's easier:
Lua Code:
  1. texture:SetTexuture(spell_id)
Originally Posted by Lombra View Post
This seems weird...
If it does accept spellID, then it isn't limited to spellID only. I think they may have introduced textureIDs too or something like that. The first return of GetLootSlotInfo is now a number and no longer a string path to the texture. This number does not match the itemID of the item in that loot slot, and you can use this number in :SetTexture() as well.

I'm guessing they have made :SetTexture really dynamic.
 
04-11-16, 04:53 PM   #11
jeffy162
A Pyroguard Emberseer
 
jeffy162's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 2,338
Yeah, they're using a "texture atlas" now, but I don't know if that's what is being discussed here. You can find out a very little bit about that HERE.
__________________
Ahhhh, the vagueries of the aging mind. Wait.... What was I saying?


Carbonite <----- GitHub main module (Maps ONLY) download link. The other modules are also available on GitHub.
Carbonite-CLASSIC<----- GitHub link to Carbonite Classic. Thanks to ircdirk for this!
 
04-13-16, 03:58 PM   #12
ykiigor
A Murloc Raider
Join Date: Jun 2014
Posts: 9
Originally Posted by icyblade View Post
local value = UnitPowerMax(unit)
In Legion we should do something like this:
Lua Code:
  1. local value = UnitPowerMax(unit, UnitPowerType(unit))
Power type isn't mandatory, you can use UnitPowerMax(unit) as before

Originally Posted by icyblade View Post
[*] We can use texture:SetTexture(spellId) now, so GetSpellInfo will not return a texture path as the 3rd return value
We use this code to set an icon now:
Lua Code:
  1. local _, _, icon = GetSpellInfo(spell_id)
  2. texture:SetTexuture(icon)
In Legion, that's easier:
Lua Code:
  1. texture:SetTexuture(spell_id)
That is not spellID, it's FileID. So it's only easer if you know exact fileID for texture, otherwise you still need call GetSpellTexture. You can use string path as before.

Last edited by ykiigor : 04-13-16 at 04:01 PM.
 
04-14-16, 06:38 AM   #13
ObbleYeah
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Sep 2008
Posts: 210
Originally Posted by icyblade View Post
  • UnitIsTapped()/UnitIsTappedByPlayer() has been removed
    This one occurs in such circustance:
    Lua Code:
    1. if not isName and (dead or (UnitIsTapped(unit) and not UnitIsTappedByPlayer(unit))) then
    2.     return 0.5, 0.5, 0.5
does this mean tapped mobs no longer exist in legion?
 
04-14-16, 10:14 AM   #14
sirann
A Flamescale Wyrmkin
Join Date: Mar 2007
Posts: 142
Correct, tagging is no longer a thing, I'm unsure of members of the opposite faction tagging tho.
 
04-14-16, 11:51 AM   #15
Gethe
RealUI Developer
 
Gethe's Avatar
Premium Member
Featured
Join Date: Sep 2008
Posts: 924
Tagging is still a thing, but it has changed and the api was consolidated to a single function: UnitIsTapDenied()
__________________
Knowledge = Power; Be OP


Last edited by Gethe : 04-14-16 at 11:53 AM.
 
04-14-16, 04:30 PM   #16
ObbleYeah
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Sep 2008
Posts: 210
that is such a weird call name to choose over just consolidating it all into UnitIsTapped
 
04-14-16, 05:07 PM   #17
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,135
Not really because most mobs will be tapable by more than one player ie. UnitIsTapped would return true but you can still kill the mob and get reward. What you will be checking for is the odd occaision you are denied the tap and reward.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 04-15-16 at 01:07 AM.
 
04-15-16, 05:24 AM   #18
Lombra
A Molten Giant
 
Lombra's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 554
Originally Posted by ObbleYeah View Post
that is such a weird call name to choose over just consolidating it all into UnitIsTapped
I could agree with the new function sounding a bit complicated, but it should make more sense. What the current UnitIsTapped actually means is... "UnitIsTappedBySomeoneElse". Had to look that up actually, thought it meant "UnitIsNotYetTappedBySomeoneElse".
__________________
Grab your sword and fight the Horde!
 
05-13-16, 10:50 AM   #19
VincentSDSH
Non-Canadian Luzer!
 
VincentSDSH's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2006
Posts: 350
Originally Posted by icyblade View Post
  • We can use texture:SetTexture(file_id) now, so GetSpellInfo will not return a texture path as the 3rd return value
We use this code to set an icon now:
Lua Code:
  1. local _, _, icon = GetSpellInfo(spell_id)
  2. texture:SetTexuture(icon)
In Legion, that's easier:
Lua Code:
  1. file_id = GetSpellTexture(spell_id)
  2. texture:SetTexuture(file_id)
Ok, guess I'll be muggins here but can you get the file path somehow or other? From my testing, bgFile doesn't take those index numbers well. (nb: result is a green frame)

lua Code:
  1. local _, _, _, _, _, _, _, _, _, itemTexture = GetItemInfo(v)
  2. hFrame:SetBackdrop( { bgFile = itemTexture })
__________________
AddonsExecutive Assistant User Configurable To-Do ListLegible Mail Choose the Font for Your Mail
 
05-14-16, 05:02 AM   #20
Nitrak
A Deviate Faerie Dragon
 
Nitrak's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 13
Originally Posted by VincentSDSH View Post
Ok, guess I'll be muggins here but can you get the file path somehow or other? From my testing, bgFile doesn't take those index numbers well. (nb: result is a green frame)

lua Code:
  1. local _, _, _, _, _, _, _, _, _, itemTexture = GetItemInfo(v)
  2. hFrame:SetBackdrop( { bgFile = itemTexture })
I would also like to know.

In my UI I have an inline Icon like this:

Code:
local spellname, _, icon = GetSpellInfo(spellID)

name = "\124T" .. icon .. ":24\124t" .. spellname
And with the change, icon returns a value to the icon ID, which is something I'm unable to use here.

Anyone have a workaround, or should I fundamentally change my code for Legion?

I'm also using ACE3 in my code, where I create a list from a key which is spells, and filling in the icon parameter ACE recieves with the Icon path, though hopefully once ACE3 adapts to the changes, the new ID will be sufficient.
 
 

WoWInterface » Site Forums » Archived Beta Forums » Legion Beta archived threads » Notable API changes in Legion

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