Quantcast Notable API changes in Legion - Page 3 - WoWInterface
 
Thread Tools Display Modes
05-14-16, 02:07 AM   #41
TOM_RUS
A Warpwood Thunder Caller
Join Date: Sep 2008
Posts: 95
Originally Posted by MunkDev View Post
Does someone know how to get the localized string for items now that GetAuctionItemClasses has been removed?
GetItemClassInfo, GetItemSubClassInfo. Also GetItemInfo has 2 new returns itemClassId and itemSubClassId.
 
05-14-16, 03:37 AM   #42
siweia
A Warpwood Thunder Caller
 
siweia's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2011
Posts: 97
Are there any changes in Statusbar functions?
I used to create a bar to monitor some auras, but it is no longer changing its value in BETA and staying at the end.

https://github.com/siweia/NDui/blob/.../AuraWatch.lua

----------------------------------
I just find out the problem is those lines:
Code:
Event.Timer = 0
local onUpdate = function(self, elapsed)
	self.Timer = self.Timer + elapsed
	if self.Timer > 0 then
		self.Timer = 0
		CleanUp()
		UpdateCD()
		for _, value in pairs(UnitIDTable) do
			UpdateAura(value)
		end
	end
end
Event:SetScript("OnUpdate", onUpdate)
if I change "self.Timer > 0" to "self.Timer > 0.1", it would work but flashing.

Last edited by siweia : 05-14-16 at 04:59 AM.
 
05-14-16, 05:02 AM   #43
Nitrak
A Deviate Faerie Dragon
 
Nitrak's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 12
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.
 
05-14-16, 01:48 PM   #44
Ketho
A Molten Giant
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 847
Spell Links have an extra parameter glyphId.
It's required to include it when used in chat channels, otherwise the link won't show up.
Code:
/run SendChatMessage("\124cff71d5ff\124Hspell:133:0\124h[Fireball]\124h\124r")
Code:
TEXT_MODE_A_STRING_SPELL = "|Hspell:%s:%s:%s|h%s|h"
Code:
local _, spellId, glyphId, event = strsplit(":", link);
https://github.com/Gethe/wow-ui-sour...tLog.lua#L3178
https://github.com/Gethe/wow-ui-sour...tLog.lua#L3533

Only the number 0 seems to work for normal spell links. Haven't checked it with any glyphs on yet.
Ofcourse we can still just use GetSpellLink() if the glyphId is not important.

Not sure if this was already documented by someone else.

Last edited by Ketho : 05-14-16 at 03:17 PM.
 
05-14-16, 10:07 PM   #45
siweia
A Warpwood Thunder Caller
 
siweia's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2011
Posts: 97
Originally Posted by MunkDev View Post
Does someone know how to get the localized string for items now that GetAuctionItemClasses has been removed?

This is what I used to have:
Lua Code:
  1. local QUEST = select(10, GetAuctionItemClasses())
https://github.com/Gethe/wow-ui-sour...uctionData.lua

Go check the file, you would get something like "AUCTION_CATEGORY_CONSUMABLES, AUCTION_CATEGORY_GLYPHS, AUCTION_CATEGORY_RECIPES, AUCTION_CATEGORY_MISCELLANEOUS".
 
05-15-16, 01:56 AM   #46
galvin
A Cobalt Mageweaver
Join Date: Nov 2006
Posts: 236
Originally Posted by Nitrak View Post
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.
You shouldn't have to change anything unless you were doing something with pathnames.
Code snippet below uses Icon the same was as live.

Code:
  local Name, _, Icon = GetSpellInfo(SpellID)

  -- Check if the spell was removed from the game.
  if Name == nil then
    Name = format('%s removed from the game', SpellID)
    Icon = [[INTERFACE\ICONS\INV_MISC_QUESTIONMARK]]
  end

  TO.args[AuraGroup] = {
    type = 'group',
    name = format('|T%s:20:20:0:5|t |cFFFFFFFF%s|r (%s)', Icon, Name, SpellID),

Last edited by galvin : 05-15-16 at 02:04 AM.
 
05-15-16, 06:00 AM   #47
Edik
A Murloc Raider
 
Edik's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 5
Originally Posted by siweia View Post
https://github.com/Gethe/wow-ui-sour...uctionData.lua

Go check the file, you would get something like "AUCTION_CATEGORY_CONSUMABLES, AUCTION_CATEGORY_GLYPHS, AUCTION_CATEGORY_RECIPES, AUCTION_CATEGORY_MISCELLANEOUS".
Is easy, there is new function for it. By example:

_G.GetItemClassInfo(LE_ITEM_CLASS_QUESTITEM) is now equal to old select(10, GetAuctionItemClasses())

BTW value for LE_ITEM_CLASS_QUESTITEM is now 12.

I have problems with textures and fontstring. It seems taht somehow don't work as is. Tested my code from 6.2.x on 7.0.x and no textures in back and font don't changing. Will try place some nispets and more testing.

OK here is piece of code what really works on 6.2.x but don't on 7.0.x

local MF = CreateFrame("Frame", "TEST_FRAME", UIParent); MF:SetSize(200,200); MF:SetPoint("CENTER",UIParent,"CENTER",0,0)
MF.texture = MF:CreateTexture(nil,"BACKGROUND"); MF.texture:SetTexture(0,0,0,1); MF.texture:SetAllPoints(MF)
MF:Show()

Actually I think problem is change in SetTexture function it seems 2nd variant with only RGBA don't working or need different arguments), As I reading thru SetTexture now taking path or ID not RGBA, valid. So it shall use SetColorTexture now for Legion. Am I right? (yes tested) shees

Last edited by Edik : 05-15-16 at 07:21 AM.
 
05-15-16, 01:42 PM   #48
lucro
A Murloc Raider
Join Date: May 2016
Posts: 5
Originally Posted by SinusPi View Post
DrawLine isn't exactly anything revolutionary, sadly. It's just a shortcut to rotating and resizing texture A on top of texture B so that it resembles a line. It's actually Iriel's code, congratulations on getting featured

Code:
DrawLine(texture, canvasFrame, startX, startY, endX, endY, lineWidth, lineFactor, relPoint)
There's a new line widget that may be what you're looking for. It can be animated to scale along the line. It's used in the artifact UI and the new flight map.
Code:
	<Frame name="FlightMap_HighlightFlightLineTemplate" virtual="true">
		<Layers>
			<Layer level="BACKGROUND" textureSubLevel="-1">
				<Line parentKey="Fill" file="Interface/TaxiFrame/UI-Taxi-Line" thickness="28" alpha="0" alphaMode="ADD" />
			</Layer>
		</Layers>
		<Animations>
			<AnimationGroup parentKey="RevealAnim" setToFinalAlpha="true">
				<Alpha parentKey="Alpha" childKey="Fill" duration=".15" fromAlpha="0" toAlpha="1" order="1"/>
				<LineScale parentKey="Scale" childKey="Fill" duration=".15" order="1" fromScaleX="0" fromScaleY="1" toScaleX="1" toScaleY="1">
					<Origin point="LEFT">
						<Offset x="1" y="0"/>
					</Origin>
				</LineScale>
			</AnimationGroup>
			<AnimationGroup parentKey="FadeAnim" setToFinalAlpha="true">
				<Alpha parentKey="Alpha" childKey="Fill" duration=".1" fromAlpha="1" toAlpha="0" order="1"/>
			</AnimationGroup>
		</Animations>
	</Frame>
 
05-15-16, 02:35 PM   #49
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,704
Btw...the new API does not support AnimationGroup:SetChange() any more. They introduced setToFinalAlpha sort of. Does anyone have an example on how to do frame flashing with animation groups in legion?
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW) | TDMOG

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
 
05-16-16, 07:18 AM   #50
Rainrider
A Scalebane Royal Guard
AddOn Author - Click to view addons
Join Date: Nov 2008
Posts: 449
Originally Posted by MunkDev View Post
Does someone know how to get the localized string for items now that GetAuctionItemClasses has been removed?

This is what I used to have:
Lua Code:
  1. local QUEST = select(10, GetAuctionItemClasses())
GetItemInfo has 2 new returns:
[12] - itemClassID (number)
[13] - itemSubClassID (number)

You could get their values (localized strings) by either the 6th and the 7th return of GetItemInfo or by:
GetItemClassInfo(itemClassID)
GetItemSubClassInfo(itemClassID, itemSubClassID)

You could also compare the itemClassIDs directly to LE_ITEM_CLASS_* (LE_ITEM_CLASS_QUESTITEM in your case as Edik pointed out above)

There is one case which is somewhat inconsistent and that is LE_ITEM_CLASS_CONSUMABLE.
GetItemClassInfo(LE_ITEM_CLASS_CONSUMABLE) returns nil, but the 6th return of GetItemInfo for consumable items is "" (an empty string).
 
05-16-16, 07:53 AM   #51
TOM_RUS
A Warpwood Thunder Caller
Join Date: Sep 2008
Posts: 95
Originally Posted by Rainrider View Post
There is one case which is somewhat inconsistent and that is LE_ITEM_CLASS_CONSUMABLE.
GetItemClassInfo(LE_ITEM_CLASS_CONSUMABLE) returns nil, but the 6th return of GetItemInfo for consumable items is "" (an empty string).
It's a bug. Theirs DB2 lookup code fails looking for 0 index (LE_ITEM_CLASS_CONSUMABLE is 0). I doubt it will ever be fixed... Also GetItemSubClassInfo works for consumable (the reason for this is that it enumerates all DB2 rows instead of using lookup by id).
 
05-16-16, 08:31 AM   #52
sezz
A Warpwood Thunder Caller
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 98
Did anyone find out how to get the correct item level of all those scalable quest rewards without tooltip scanning?

GetItemInfo(140722) for example returns the base itemlevel of 680 - the itemlevel for 110 is in the returned link when I query it at level 110, but when I try to get it with a level 100 character is shows 254 in the link, which seems too low
 
05-16-16, 09:58 AM   #53
siweia
A Warpwood Thunder Caller
 
siweia's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2011
Posts: 97
Originally Posted by sezz View Post
Did anyone find out how to get the correct item level of all those scalable quest rewards without tooltip scanning?

GetItemInfo(140722) for example returns the base itemlevel of 680 - the itemlevel for 110 is in the returned link when I query it at level 110, but when I try to get it with a level 100 character is shows 254 in the link, which seems too low
What's wrong with tooltip scanning?
 
05-16-16, 10:02 AM   #54
ykiigor
A Murloc Raider
Join Date: Jun 2014
Posts: 9
OnUpdate changed to only 4 calls per second for anyone else?
 
05-16-16, 10:37 AM   #55
Ketho
A Molten Giant
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 847
For me it's at least more than 4 times per second

https://gfycat.com/IgnorantThankfulArabianwildcat
 
05-16-16, 10:58 AM   #56
sezz
A Warpwood Thunder Caller
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 98
Originally Posted by siweia View Post
What's wrong with tooltip scanning?
Nothing, but if there's a more efficient way I'd prefer using that instead.

Originally Posted by ykiigor View Post
OnUpdate changed to only 4 calls per second for anyone else?
I also had that issue in the last build before it went beta, it also affect Blizzard stuff (like the big zone text in the middle of the screen when you change zones) but it works fine now without changing anything. (Had to remove my cache folder because of other problems, but I don't think the limit is somewere in the data files)

Last edited by sezz : 05-16-16 at 12:10 PM.
 
05-16-16, 11:23 AM   #57
ykiigor
A Murloc Raider
Join Date: Jun 2014
Posts: 9
Thanks, I found problem. GetTime is rounded to 0.25 for me, no idea why. (debugprofilestop works as intended, no problem with GetTime on live client)
Seems it is rounded on that gif too, but more accurate.

Last edited by ykiigor : 05-16-16 at 11:37 AM.
 
05-16-16, 11:35 AM   #58
ceylina
A Wyrmkin Dreamwalker
Join Date: Oct 2014
Posts: 50
Looks like GetTradeSkillSelectionIndex has changed in legion to C_TradeSkillUI.GetTradeSkillLine

Full arguments are

local tradeSkillID, skillLineName, skillLineRank, skillLineMaxRank, skillLineModifier = C_TradeSkillUI.GetTradeSkillLine();
 
05-18-16, 02:33 AM   #59
Simca
An Aku'mai Servant
 
Simca's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2012
Posts: 33
Originally Posted by ceylina View Post
Looks like GetTradeSkillSelectionIndex has changed in legion to C_TradeSkillUI.GetTradeSkillLine

Full arguments are

local tradeSkillID, skillLineName, skillLineRank, skillLineMaxRank, skillLineModifier = C_TradeSkillUI.GetTradeSkillLine();
TradeSkill functions have been radically changed, yes. You can also no longer iterate recipes by 'tradeSkillIndex' like before, you have to 'GetAllIDs' and then use IDs.
__________________
Assistant admin for MMO-Champion
WoW database file expert - ask me anything
 
05-19-16, 08:13 AM   #60
Nevcairiel
Premium Member
Premium Member
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 60
Originally Posted by zork View Post
Btw...the new API does not support AnimationGroup:SetChange() any more. They introduced setToFinalAlpha sort of. Does anyone have an example on how to do frame flashing with animation groups in legion?
Its really not that complicated. SetChange used an offset and SetFromAlpha/SetToAlpha use absolute values - which IMHO makes for clearer logic either way. You can easily rewrite it using that.
 
 

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