ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   Lua/XML Help (https://www.esoui.com/forums/forumdisplay.php?f=175)
-   -   Style material - function to get style? (https://www.esoui.com/forums/showthread.php?t=9818)

rp12439_3 06/28/21 01:49 PM

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!

rp12439_3 06/28/21 02:06 PM

found something
GetItemLinkFlavorText()

Seams to work for some style mats

Adamantite is working

Defiled Whiskers not

Dolgubon 07/01/21 10:46 PM

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

rp12439_3 07/02/21 03:53 AM

Quote:

Originally Posted by Dolgubon (Post 44319)
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 :)

rp12439_3 07/02/21 01:54 PM

i am not trying to get the style from an item but to get the style a stylemat is for

rp12439_3 07/02/21 02:34 PM

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))



All times are GMT -6. The time now is 04:58 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI