Skip to content

Commit 0927682

Browse files
committed
bloodline and gem+item import
1 parent ec61c3b commit 0927682

1 file changed

Lines changed: 13 additions & 15 deletions

File tree

src/Classes/ImportTab.lua

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -741,13 +741,19 @@ function ImportTabClass:ImportPassiveTreeAndJewels(charData)
741741
self.build.itemsTab:AddUndoState()
742742

743743

744-
744+
local alternateAscendancyId
745+
if charPassiveData.alternate_ascendancy then
746+
local bloodline = self.build.latestTree.secondaryAscendNameMap[charPassiveData.alternate_ascendancy]
747+
alternateAscendancyId = bloodline.ascendClassId
748+
else
749+
alternateAscendancyId = 0
750+
end
745751
-- Character import uses current GGG cluster hashes.
746752
self.build.spec.clusterHashFormatVersion = 2
747753
self.build.spec:ImportFromNodeList(charData.class,
748754
nil,
749755
nil,
750-
charPassiveData.alternate_ascendancy or 0,
756+
alternateAscendancyId,
751757
charPassiveData.hashes,
752758
charPassiveData.skill_overrides,
753759
charPassiveData.mastery_effects or {},
@@ -882,15 +888,7 @@ local function applySocketGroupReimportState(socketGroup, state)
882888
end
883889
end
884890

885-
function ImportTabClass:ImportItemsAndSkills(json)
886-
--local out = io.open("get-items.json", "w")
887-
--out:write(json)
888-
--out:close()
889-
local charItemData, errMsg = self:ProcessJSON(json)
890-
if errMsg then
891-
self.charImportStatus = colorCodes.NEGATIVE.."Error processing character data, try again later."
892-
return
893-
end
891+
function ImportTabClass:ImportItemsAndSkills(charData)
894892
if self.controls.charImportItemsClearItems.state then
895893
for _, slot in pairs(self.build.itemsTab.slots) do
896894
if slot.selItemId ~= 0 and not slot.nodeId then
@@ -922,7 +920,7 @@ function ImportTabClass:ImportItemsAndSkills(json)
922920
end
923921
self.charImportStatus = colorCodes.POSITIVE.."Items and skills successfully imported."
924922
--ConPrintTable(charItemData)
925-
for _, itemData in pairs(charItemData.items) do
923+
for _, itemData in ipairs(charData.equipment) do
926924
self:ImportItem(itemData)
927925
end
928926
if skillOrder then
@@ -984,11 +982,11 @@ function ImportTabClass:ImportItemsAndSkills(json)
984982
self.build.itemsTab:PopulateSlots()
985983
self.build.itemsTab:AddUndoState()
986984
self.build.skillsTab:AddUndoState()
987-
self.build.characterLevel = charItemData.character.level
985+
self.build.characterLevel = charData.level
988986
self.build.configTab:UpdateLevel()
989-
self.build.controls.characterLevel:SetText(charItemData.character.level)
987+
self.build.controls.characterLevel:SetText(tostring(charData.level))
990988
self.build.buildFlag = true
991-
return charItemData.character -- For the wrapper
989+
return charData -- For the wrapper
992990
end
993991

994992
local rarityMap = { [0] = "NORMAL", "MAGIC", "RARE", "UNIQUE", [9] = "RELIC", [10] = "RELIC" }

0 commit comments

Comments
 (0)