Skip to content

Commit

Permalink
Merge branch 'main' into ptr
Browse files Browse the repository at this point in the history
  • Loading branch information
kodewdle committed Jan 10, 2025
2 parents 046221d + 6f6af10 commit ee4d0ea
Showing 1 changed file with 38 additions and 35 deletions.
73 changes: 38 additions & 35 deletions ElvUI/Core/General/API.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1208,41 +1208,44 @@ function E:LoadAPI()
local MALE = _G.LOCALIZED_CLASS_NAMES_MALE
local FEMALE = _G.LOCALIZED_CLASS_NAMES_FEMALE

for _, info in next, E.ClassInfoByID do
local male, female = MALE[info.classFile], FEMALE[info.classFile]
for index, id in next, E.SpecByClass[info.classFile] do
local data = {
id = id,
index = index,
classFile = info.classFile,
className = info.className,
englishName = E.SpecName[id]
}

E.SpecInfoBySpecID[id] = data

for x = 3, 1, -1 do
local _, name, desc, icon, role = GetSpecializationInfoForSpecID(id, x)

if x == 1 then -- SpecInfoBySpecID
data.name = name
data.desc = desc
data.icon = icon
data.role = role

E.SpecInfoBySpecClass[name..' '..info.className] = data
else
local copy = E:CopyTable({}, data)
copy.name = name
copy.desc = desc
copy.icon = icon
copy.role = role

local localized = (x == 3 and female) or male
copy.className = localized

if localized then
E.SpecInfoBySpecClass[name..' '..localized] = copy
for classFile, info in next, E.ClassInfoByFile do
local male, female = MALE[classFile], FEMALE[classFile]
local spec = E.SpecByClass[classFile]
if spec then
for index, id in next, E.SpecByClass[classFile] do
local data = {
id = id,
index = index,
classFile = classFile,
className = info.className,
englishName = E.SpecName[id]
}

E.SpecInfoBySpecID[id] = data

for x = 3, 1, -1 do
local _, name, desc, icon, role = GetSpecializationInfoForSpecID(id, x)

if x == 1 then -- SpecInfoBySpecID
data.name = name
data.desc = desc
data.icon = icon
data.role = role

E.SpecInfoBySpecClass[name..' '..info.className] = data
else
local copy = E:CopyTable({}, data)
copy.name = name
copy.desc = desc
copy.icon = icon
copy.role = role

local localized = (x == 3 and female) or male
copy.className = localized

if localized then
E.SpecInfoBySpecClass[name..' '..localized] = copy
end
end
end
end
Expand Down

0 comments on commit ee4d0ea

Please sign in to comment.