View Single Post
10-11-18, 04:37 PM   #10
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,892
The EXPANSIONx values are localised...

Work out which index you need from the localised names and display that instead.

Here is how I do it in my mageports addon.


Code:
addonData.Expansion = 
{
    [0] = EXPANSION_NAME0,  -- Classic
    [1] = EXPANSION_NAME1,  -- The Burning Crusade
    [2] = EXPANSION_NAME2,  -- Wrath of the Lich King
    [3] = EXPANSION_NAME3,  -- Cataclysm
    [4] = EXPANSION_NAME4,  -- Mists of Pandaria
    [5] = EXPANSION_NAME5,  -- Warlords of Draenor
    [6] = EXPANSION_NAME6,  -- Legion
    [7] = EXPANSION_NAME7,  -- Battle for Azeroth
}

addonData.Spells = {
    -- Expansion 0
    [3561] = {faction = "Alliance", expansion = 0, level = 17, map = 13, isPortal = false}, -- Teleport:Stormwind  (Alliance)
}
As you can see the expansion value informs the addon to look at index 0 of the Expansion list whenever I need to access the name for display purposes.

Hmm, you would use the following line but none of it shows an ID unless skillLine returns something useful.


Code:
local name, icon, skillLevel, maxSkillLevel, numAbilities, spelloffset, skillLine, skillModifier, specializationIndex, specializationOffset = GetProfessionInfo(index)
However, because of the different way languages work even a search for the string may not work as some languages change some words dependent on the usage. But it may be worth trying in case this example proves otherwise.
__________________

Last edited by Xrystal : 10-11-18 at 04:40 PM.
  Reply With Quote