Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:GetTradeskillIcon

From RoR Wiki

UI Lua API · Crafting functions
Version: WAR 1.4.8

Returns the icon number of a trade skill.

iconNum = GetTradeskillIcon(tradeSkill)

Arguments

tradeSkill
number – A GameData.TradeSkills value, 0 to 6.

Returns

iconNum
number – Icon id for GetIconData. 0 for values of 7 or more.

Details

  • Note the lower-case "s" in the name: GetTradeskillIcon, not GetTradeSkillIcon.
  • If there is no player object or the Lua state is not available, nothing is returned.
  • Exactly one argument must be passed.

Errors

None besides the generic Invalid Parameters message when the argument is missing or not a number.

Example

From default/ea_abilitieswindow/source/abilitieswindow.lua:

for tradeSkill = AbilitiesWindow.FirstTradeSkill, AbilitiesWindow.MaxTradeSkill do
    if (GameData.TradeSkillLevels[tradeSkill] ~= nil) and (GameData.TradeSkillLevels[tradeSkill] > 0) then
        ...
        AbilitiesWindow.GeneralLists[AbilitiesWindow.GeneralTabs.FILTER_TRADE_SKILLS][index].iconNum      = GetTradeskillIcon (tradeSkill)

See also