Skip to content

Commit

Permalink
adjust this
Browse files Browse the repository at this point in the history
  • Loading branch information
kodewdle committed Jan 10, 2025
1 parent 6f6af10 commit 60fab35
Showing 1 changed file with 36 additions and 37 deletions.
73 changes: 36 additions & 37 deletions ElvUI/Core/General/API.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1208,44 +1208,43 @@ function E:LoadAPI()
local MALE = _G.LOCALIZED_CLASS_NAMES_MALE
local FEMALE = _G.LOCALIZED_CLASS_NAMES_FEMALE

for classFile, info in next, E.ClassInfoByFile do
for classFile, specData in next, E.SpecByClass 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
local info = E.ClassInfoByFile[classFile]

for index, id in next, specData 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
Expand Down

0 comments on commit 60fab35

Please sign in to comment.