Thread Tools Display Modes
06/28/21, 01:49 PM   #1
rp12439_3
AddOn Author - Click to view addons
Join Date: Jun 2021
Posts: 45
Style material - function to get style?

Hi there,

I am searching for some hours now but i cant find anything...

Is there a Get function to get the style for which a style material is for?

like GetString("SI_ITEMTRAITTYPE", GetItemLinkTraitType(control.data.link)) for weapon and armor traits.

man, cant find it

thx!
  Reply With Quote
06/28/21, 02:06 PM   #2
rp12439_3
AddOn Author - Click to view addons
Join Date: Jun 2021
Posts: 45
found something
GetItemLinkFlavorText()

Seams to work for some style mats

Adamantite is working

Defiled Whiskers not
  Reply With Quote
07/01/21, 10:46 PM   #3
Dolgubon
 
Dolgubon's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2016
Posts: 408
I'm not able to check the list of functions to make sure, but I don't think such a function exists. But you could mimic such a function pretty easily.Paraphrased code:


Local styles ={}
for I=1, getnumstyles() do
Styles[getItemLinkItemId(getstyleitemlink(I))] = getStyle(I)
End
Function getitemlinkstyle(link)
Return styles [getItemLinkItemId]
End
  Reply With Quote
07/02/21, 03:53 AM   #4
rp12439_3
AddOn Author - Click to view addons
Join Date: Jun 2021
Posts: 45
Originally Posted by Dolgubon View Post
I'm not able to check the list of functions to make sure, but I don't think such a function exists. But you could mimic such a function pretty easily.Paraphrased code:


Local styles ={}
for I=1, getnumstyles() do
Styles[getItemLinkItemId(getstyleitemlink(I))] = getStyle(I)
End
Function getitemlinkstyle(link)
Return styles [getItemLinkItemId]
End
Thanks! Thats the missing piece to finish my tooptips
  Reply With Quote
07/02/21, 01:54 PM   #5
rp12439_3
AddOn Author - Click to view addons
Join Date: Jun 2021
Posts: 45
i am not trying to get the style from an item but to get the style a stylemat is for
  Reply With Quote
07/02/21, 02:34 PM   #6
rp12439_3
AddOn Author - Click to view addons
Join Date: Jun 2021
Posts: 45
got it.

for the record:

Code:
Crafty.myStyles = {}

function Crafty.BuildStyleTable()
  Crafty.DB("Crafty: BuildStyleTable")
  for i=1,  GetNumValidItemStyles() do
    Crafty.myStyles[i] = GetItemStyleName(i)
  end
end

function Crafty.ReturnStyle(arg)
  Crafty.DB("Crafty: ReturnStyle")  
  return Crafty.myStyles[arg]
end

local icon,sellPrice,meetsUsageRequirement,equipType,itemStyleId = GetItemLinkInfo(itemLink)
  Crafty.DB(Crafty.ReturnStyle(itemStyleId))
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » Style material - function to get style?

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