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:19 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 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:20 AM   #5
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   #6
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!
 
03-23-16, 08:31 AM   #7
Gethe
RealUI Developer
 
Gethe's Avatar
Premium Member
Featured
Join Date: Sep 2008
Posts: 923
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   #8
JDoubleU00
A Scalebane Royal Guard
 
JDoubleU00's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 422
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   #9
Gethe
RealUI Developer
 
Gethe's Avatar
Premium Member
Featured
Join Date: Sep 2008
Posts: 923
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-24-16, 02:44 PM   #10
galvin
A Frostmaul Preserver
Join Date: Nov 2006
Posts: 263
animationGroup:SetCharge()

I think you mean SetChange?
What do we use now, the SetChange is what creates the fade over time. Is there a setting some place else for this.

Was looking thru the code and found SetToAlpha() and SetFromAlpha(). Think these are new animationgroup functions.

I wonder if this fixes a bug from live. If you fade out a parent frame, and its children are also fading out at the same time. You can cause the child frames to be stuck in faded state. Only way is to reloadUI. I had to do some complicated coding in my addon to work around this bug. Be awesome if it was fixed.

Last edited by galvin : 03-24-16 at 02:54 PM.
 
03-24-16, 06:54 PM   #11
icyblade
A Deviate Faerie Dragon
 
icyblade's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2014
Posts: 13
Originally Posted by galvin View Post
animationGroup:SetCharge()

I think you mean SetChange?
What do we use now, the SetChange is what creates the fade over time. Is there a setting some place else for this.

Was looking thru the code and found SetToAlpha() and SetFromAlpha(). Think these are new animationgroup functions.

I wonder if this fixes a bug from live. If you fade out a parent frame, and its children are also fading out at the same time. You can cause the child frames to be stuck in faded state. Only way is to reloadUI. I had to do some complicated coding in my addon to work around this bug. Be awesome if it was fixed.
Yes that's SetChange, thanks for pointing out that
__________________
Talk is cheap, show me the shell
 
03-25-16, 01:54 PM   #12
galvin
A Frostmaul Preserver
Join Date: Nov 2006
Posts: 263
After looking at WorldMapFrame.lua. My best guess until someone tests.
SetFromAlpha() is where you start from.
SetToAlpha() is where you end at.
 
04-11-16, 03:56 PM   #13
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   #14
jeffy162
A Pyroguard Emberseer
 
jeffy162's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 2,330
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   #15
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   #16
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   #17
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   #18
Gethe
RealUI Developer
 
Gethe's Avatar
Premium Member
Featured
Join Date: Sep 2008
Posts: 923
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   #19
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   #20
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,134
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.
 
 

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