Thread Tools Display Modes
Prev Previous Post   Next Post Next
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.
 
 

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