From 60fab35b5c01921e58038bf6eb7425b134c29a66 Mon Sep 17 00:00:00 2001 From: Simpy Date: Fri, 10 Jan 2025 05:30:28 -0500 Subject: [PATCH] adjust this --- ElvUI/Core/General/API.lua | 73 +++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 37 deletions(-) diff --git a/ElvUI/Core/General/API.lua b/ElvUI/Core/General/API.lua index 609746f693..9c47c23a1b 100644 --- a/ElvUI/Core/General/API.lua +++ b/ElvUI/Core/General/API.lua @@ -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