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
26 changes: 24 additions & 2 deletions runtime/lua/dkjson.lua
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,26 @@ local function escapeutf8 (uchar)
end
end

local function sortedkeys(tbl)
local keys = {}
for k in pairs(tbl) do
keys[#keys + 1] = k
end
table.sort(keys, function(a, b)
local ta, tb = type(a), type(b)
if ta == tb then
return a < b
end
if ta == "number" then
return true
elseif tb == "number" then
return false
end
return ta < tb
end)
return keys
end

local function fsub (str, pattern, repl)
-- gsub always builds a new string in a buffer, even when no match
-- exists. First using find should be more efficient when most strings
Expand Down Expand Up @@ -333,7 +353,10 @@ encode2 = function (value, indent, level, buffer, buflen, tables, globalorder, s
end
end
else -- unordered
for k,v in pairs (value) do
local keys = sortedkeys(value)
for i = 1, #keys do
local k = keys[i]
local v = value[k]
buflen, msg = addpair (k, v, prev, indent, level, buffer, buflen, tables, globalorder, state)
if not buflen then return nil, msg end
prev = true -- add a seperator before the next element
Expand Down Expand Up @@ -711,4 +734,3 @@ if always_try_using_lpeg then
end

return json

13 changes: 8 additions & 5 deletions src/Export/Scripts/passivetree.lua
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ local function calculateDDSPack(sheet, from_base, to_base, is4kEnabled)
end
main.ggpk:ExtractList(filesToExtract, cacheExtract)

for icon, sections in pairs(sheet.files) do
for icon, sections in pairsSortByKey(sheet.files) do
local tex = Texture.new()
local rc
if is4kEnabled then
Expand All @@ -170,7 +170,7 @@ local function calculateDDSPack(sheet, from_base, to_base, is4kEnabled)
end


for iden, stackInfo in pairs(stackTextures) do
for iden, stackInfo in pairsSortByKey(stackTextures) do
local stacks = {}
local file = sheet.name .. "_" .. iden .. ".dds.zst"
ddsCoords[file] = {}
Expand Down Expand Up @@ -713,7 +713,10 @@ for i, classId in ipairs(psg.passives) do
addToSheet(getSheet("group-background"), ascFrameLargeAllocated, "frame", commonMetadata(ascendency.Name .. "FrameLargeAllocated"))

-- include the connection art in case doesn't exist
connectionArtToDecompose[ascendency.UIArt.ConnectionsArt.Id] = true
-- ignore Lich art as it currently breaks the GIMP script to extract lines
if ascendency.UIArt.ConnectionsArt.Id:find("Lich") == nil then
connectionArtToDecompose[ascendency.UIArt.ConnectionsArt.Id] = true
end
:: continue3 ::
end

Expand Down Expand Up @@ -979,7 +982,7 @@ for i, group in ipairs(psg.groups) do
node["stats"] = node["stats"] or {}

for _, gemEffect in pairs(passiveRow.GrantedSkill.GemEffects) do
local skillName = gemEffect.GrantedEffect.ActiveSkill.DisplayName
local skillName = passiveRow.GrantedSkill.BaseItemType.Name
table.insert(node["stats"], "Grants Skill: " .. skillName)

-- -- include the stat description
Expand Down Expand Up @@ -1353,7 +1356,7 @@ local typeOfConnections = {
"Normal", "Intermediate", "IntermediateActive"
}

for connectionArtId, _ in pairs(connectionArtToDecompose) do
for connectionArtId, _ in pairsSortByKey(connectionArtToDecompose) do
local connectionArt = dat("PassiveSkillTreeConnectionArt"):GetRow("Id", connectionArtId)
if connectionArt == nil then
printf("Connection art " .. connectionArtId .. " not found")
Expand Down
Binary file modified src/TreeData/0_4/ascendancy-background_1500_1500_BC7.dds.zst
Binary file not shown.
Binary file modified src/TreeData/0_4/ascendancy-background_4000_4000_BC7.dds.zst
Binary file not shown.
Binary file modified src/TreeData/0_4/group-background_104_104_BC7.dds.zst
Binary file not shown.
Binary file modified src/TreeData/0_4/group-background_152_156_BC7.dds.zst
Binary file not shown.
Binary file modified src/TreeData/0_4/group-background_160_164_BC7.dds.zst
Binary file not shown.
Binary file modified src/TreeData/0_4/group-background_208_208_BC7.dds.zst
Binary file not shown.
Binary file modified src/TreeData/0_4/group-background_220_224_BC7.dds.zst
Binary file not shown.
Binary file modified src/TreeData/0_4/jewel-sockets_152_156_BC7.dds.zst
Binary file not shown.
Binary file modified src/TreeData/0_4/legion_128_128_BC1.dds.zst
Binary file not shown.
Binary file modified src/TreeData/0_4/legion_564_564_BC7.dds.zst
Binary file not shown.
Binary file modified src/TreeData/0_4/legion_64_64_BC1.dds.zst
Binary file not shown.
Binary file modified src/TreeData/0_4/mastery-active-effect_776_768_BC7.dds.zst
Binary file not shown.
Binary file modified src/TreeData/0_4/monster-categories_36_36_BC7.dds.zst
Binary file not shown.
Binary file modified src/TreeData/0_4/oils_108_108_RGBA.dds.zst
Binary file not shown.
Binary file modified src/TreeData/0_4/skills-disabled_128_128_BC1.dds.zst
Binary file not shown.
Binary file modified src/TreeData/0_4/skills-disabled_64_64_BC1.dds.zst
Binary file not shown.
Binary file modified src/TreeData/0_4/skills_128_128_BC1.dds.zst
Binary file not shown.
Binary file modified src/TreeData/0_4/skills_64_64_BC1.dds.zst
Binary file not shown.
2 changes: 1 addition & 1 deletion src/TreeData/0_4/tree.json

Large diffs are not rendered by default.

Loading
Loading