Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Classes/CalcsTab.lua
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ function CalcsTabClass:Load(xml, dbFileName)
end

function CalcsTabClass:Save(xml)
for k, v in pairs(self.input) do
for k, v in pairsSortByKey(self.input) do
local child = { elem = "Input", attrib = {name = k} }
if type(v) == "number" then
child.attrib.number = tostring(v)
Expand Down
4 changes: 2 additions & 2 deletions src/Classes/ConfigTab.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1006,7 +1006,7 @@ function ConfigTabClass:Save(xml)
local child = { elem = "ConfigSet", attrib = { id = tostring(configSetId), title = configSet.title } }
t_insert(xml, child)

for k, v in pairs(configSet.input) do
for k, v in pairsSortByKey(configSet.input) do
if v ~= self:GetDefaultState(k, type(v)) then
local node = { elem = "Input", attrib = { name = k } }
if type(v) == "number" then
Expand All @@ -1019,7 +1019,7 @@ function ConfigTabClass:Save(xml)
t_insert(child, node)
end
end
for k, v in pairs(configSet.placeholder) do
for k, v in pairsSortByKey(configSet.placeholder) do
local node = { elem = "Placeholder", attrib = { name = k } }
if type(v) == "number" then
node.attrib.number = tostring(v)
Expand Down
5 changes: 3 additions & 2 deletions src/Classes/ItemsTab.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1371,7 +1371,8 @@
for _, itemSetId in ipairs(self.itemSetOrderList) do
local itemSet = self.itemSets[itemSetId]
local child = { elem = "ItemSet", attrib = { id = tostring(itemSetId), title = itemSet.title, useSecondWeaponSet = tostring(itemSet.useSecondWeaponSet) } }
for slotName, slot in pairs(self.slots) do
for _, slot in ipairs(self.orderedSlots) do
local slotName = slot.slotName
if not slot.parentSlot or itemSet[slotName].selItemId ~= 0 then
if not slot.nodeId then
t_insert(child, { elem = "Slot", attrib = { name = slotName, itemId = tostring(itemSet[slotName].selItemId), itemPbURL = itemSet[slotName].pbURL or "", active = itemSet[slotName].active and "true", note = itemSet[slotName].note }})
Expand All @@ -1382,7 +1383,7 @@
end
end
end
for slotName, _ in pairs(self.runeSlots) do
for _, slotName in ipairs(self.runeSlotOrder) do
local runeName = (itemSet[slotName] and itemSet[slotName].runeName) or "None"
local node = { elem = "RuneSlot", attrib = { slotName = slotName, runeName = runeName } }
t_insert(child, node)
Expand Down Expand Up @@ -3456,7 +3457,7 @@
mod = mod,
type = "desecrated",
})
end

Check warning on line 3460 in src/Classes/ItemsTab.lua

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (RUNEINFLUENCED)
end
for _, mod in pairs(self.build.data.itemMods.Desecrated) do
if isDesecratedMod(mod) and self.displayItem:GetModSpawnWeight(mod) > 0 then
Expand Down Expand Up @@ -3508,7 +3509,7 @@
if hasDesecratedMods then
t_insert(sourceList, { label = "Desecrated", sourceId = "DESECRATED" })
end
if self.displayItem.base.type == "Jewel" then

Check warning on line 3512 in src/Classes/ItemsTab.lua

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (RUNEINFLUENCED)
buildMods("EMOTION")
if #modList > 0 then
t_insert(sourceList, { label = "Emotion", sourceId = "EMOTION" })
Expand All @@ -3519,7 +3520,7 @@
local function addModifier()
local item = new("Item"):Item(self.displayItem:BuildRaw())
item.id = self.displayItem.id
local sourceId = sourceList[controls.source.selIndex].sourceId

Check warning on line 3523 in src/Classes/ItemsTab.lua

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (RUNEINFLUENCED)
if sourceId == "CUSTOM" then
if controls.custom.buf:match("%S") then
t_insert(item.explicitModLines, { line = controls.custom.buf, custom = true })
Expand Down
50 changes: 42 additions & 8 deletions src/Classes/PassiveSpec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,13 @@ end
function PassiveSpecClass:Save(xml)
local allocNodeIdList = { }
local weaponSets = {}
for nodeId, node in pairs(self.allocNodes) do
local sortedAllocNodeIds = { }
for nodeId in pairs(self.allocNodes) do
t_insert(sortedAllocNodeIds, nodeId)
end
table.sort(sortedAllocNodeIds)
for _, nodeId in ipairs(sortedAllocNodeIds) do
local node = self.allocNodes[nodeId]
if not (node.isGrantedPassive and node.isFreeAllocate) then
t_insert(allocNodeIdList, nodeId)
end
Expand All @@ -264,9 +270,14 @@ function PassiveSpecClass:Save(xml)
t_insert(weaponSets[weaponSet], nodeId)
end
end
local masteryNodeIdList = { }
for mastery in pairs(self.masterySelections) do
t_insert(masteryNodeIdList, mastery)
end
table.sort(masteryNodeIdList)
local masterySelections = { }
for mastery, effect in pairs(self.masterySelections) do
t_insert(masterySelections, "{"..mastery..","..effect.."}")
for _, mastery in ipairs(masteryNodeIdList) do
t_insert(masterySelections, "{"..mastery..","..self.masterySelections[mastery].."}")
end

local classInternalId = self.tree.classes[self.curClassId].integerId
Expand Down Expand Up @@ -296,18 +307,29 @@ function PassiveSpecClass:Save(xml)
})

if #weaponSets > 0 then
for weaponSet, nodes in pairs(weaponSets) do
local weaponSetNumbers = { }
for weaponSet in pairs(weaponSets) do
t_insert(weaponSetNumbers, weaponSet)
end
table.sort(weaponSetNumbers)
for _, weaponSet in ipairs(weaponSetNumbers) do
t_insert(xml, {
elem = "WeaponSet"..weaponSet,
attrib = { nodes = table.concat(nodes, ",") }
attrib = { nodes = table.concat(weaponSets[weaponSet], ",") }
})
end
end

local sockets = {
elem = "Sockets"
}
for nodeId, itemId in pairs(self.jewels) do
local socketNodeIdList = { }
for nodeId in pairs(self.jewels) do
t_insert(socketNodeIdList, nodeId)
end
table.sort(socketNodeIdList)
for _, nodeId in ipairs(socketNodeIdList) do
local itemId = self.jewels[nodeId]
-- jewel socket contents should not be saved unless they contain a valid jewel
if itemId > 0 then
local socket = { elem = "Socket", attrib = { nodeId = tostring(nodeId), itemId = tostring(itemId) }}
Expand All @@ -321,7 +343,13 @@ function PassiveSpecClass:Save(xml)
}
if self.hashOverrides then
local strList, dexList, intList = { }, { }, { }
for nodeId, node in pairs(self.hashOverrides) do
local overrideNodeIdList = { }
for nodeId in pairs(self.hashOverrides) do
t_insert(overrideNodeIdList, nodeId)
end
table.sort(overrideNodeIdList)
for _, nodeId in ipairs(overrideNodeIdList) do
local node = self.hashOverrides[nodeId]
if node.isAttribute then
if node.dn == "Strength" then
t_insert(strList, nodeId)
Expand Down Expand Up @@ -616,7 +644,13 @@ function PassiveSpecClass:EncodeURL(prefix)
local clusterNodeIds = {}
local masteryNodeIds = {}

for id, node in pairs(self.allocNodes) do
local encodeNodeIdList = { }
for id in pairs(self.allocNodes) do
t_insert(encodeNodeIdList, id)
end
table.sort(encodeNodeIdList)
for _, id in ipairs(encodeNodeIdList) do
local node = self.allocNodes[id]
if node.type ~= "ClassStart" and node.type ~= "AscendClassStart" and id < 65536 and nodeCount < 255 then
t_insert(a, m_floor(id / 256))
t_insert(a, id % 256)
Expand Down
2 changes: 1 addition & 1 deletion src/Modules/Build.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2754,7 +2754,7 @@ function buildMode:SaveDB(fileName)
end

-- Call on all savers to save their data in their respective sections
for elem, saver in pairs(self.savers) do
for elem, saver in pairsSortByKey(self.savers) do
local node = { elem = elem }
saver:Save(node)
t_insert(dbXML, node)
Expand Down
Loading