Skip to content

Commit 42febfe

Browse files
author
justjuangui
committed
Passive Tree version 0_2 was updated
1 parent fe7887d commit 42febfe

File tree

68 files changed

+90458
-8
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+90458
-8
lines changed

src/Classes/ItemsTab.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1274,7 +1274,7 @@ end
12741274

12751275
-- Returns the slot control and equipped jewel for the given node ID
12761276
function ItemsTabClass:GetSocketAndJewelForNodeID(nodeId)
1277-
return self.sockets[nodeId], self.items[self.sockets[nodeId].selItemId]
1277+
return self.sockets[nodeId], self.sockets[nodeId] and self.items[self.sockets[nodeId].selItemId] or nil
12781278
end
12791279

12801280
-- Adds the given item to the build's item list

src/Classes/PassiveTree.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ local PassiveTreeClass = newClass("PassiveTree", function(self, treeVersion)
125125
self:LoadImage(file, data, "CLAMP")
126126
for name, position in pairs(fileInfo) do
127127
self.ddsMap[name] = {
128+
found = data.width > 0,
128129
handle = data.handle,
129130
width = data.width,
130131
height = data.height,

src/Classes/PassiveTreeView.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -916,7 +916,7 @@ end
916916

917917
-- Draws the given asset at the given position
918918
function PassiveTreeViewClass:DrawAsset(data, x, y, scale, isHalf)
919-
if not data then
919+
if not data or not data.found then
920920
return
921921
end
922922
if data.width == 0 then

src/Export/Scripts/passivetree.lua

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ local json = require("dkjson")
55
-- by session we would like to don't extract the same file multiple times
66
main.treeCacheExtract = main.treeCacheExtract or { }
77
local cacheExtract = main.treeCacheExtract
8+
local ignoreFilter = "^%[DNT"
89

910
if not loadStatFile then
1011
dofile("statdesc.lua")
@@ -245,7 +246,7 @@ local uiImages = parseUIImages()
245246
-- print_table(uiImages, 0)
246247

247248
-- Set to true if you want to generate assets
248-
local generateAssets = true
249+
local generateAssets = false
249250
local use4kIfPossible = false
250251
-- Find a way to get the default passive tree
251252
local idPassiveTree = 'Default'
@@ -501,10 +502,15 @@ addToSheet(getSheet("lines"), "art/2dart/passivetree/passiveskillscreencurvesnor
501502
-- adding jewel sockets
502503
local jewelArt = dat("PassiveJewelArt")
503504
for jewel in jewelArt:Rows() do
505+
if jewel.Item.Name:find(ignoreFilter) ~= nil then
506+
printf("Ignoring jewel socket " .. jewel.Item.Name)
507+
goto nexttogo
508+
end
504509
local asset = uiImages[string.lower(jewel.JewelArt)]
505510
printf("Adding jewel socket " .. jewel.Item.Name .. " " .. asset.path .. " to sprite")
506511
local name = jewel.Item.Name
507512
addToSheet(getSheet("jewel-sockets"), asset.path, "jewelpassive", commonMetadata(name))
513+
:: nexttogo ::
508514
end
509515

510516
-- adding legion assets
@@ -568,7 +574,6 @@ local tree = {
568574
}
569575

570576
printf("Generating classes...")
571-
local ignoreFilter = "^%[DNT%]"
572577
for i, classId in ipairs(psg.passives) do
573578
local passiveRow = dat("passiveskills"):GetRow("PassiveSkillNodeId", classId)
574579
if passiveRow == nil then
@@ -609,13 +614,14 @@ for i, classId in ipairs(psg.passives) do
609614

610615
local ascendancies = dat("ascendancy"):GetRowList("Class", character)
611616
for k, ascendency in ipairs(ascendancies) do
612-
if ascendency.Name:find(ignoreFilter) ~= nil then
617+
if ascendency.Name:find(ignoreFilter) ~= nil or ascendency.Id == 'Monk1' then
613618
printf("Ignoring ascendency " .. ascendency.Name .. " for class " .. character.Name)
614619
goto continue3
615620
end
616621
table.insert(classDef.ascendancies, {
617622
["id"] = ascendency.Name,
618623
["name"] = ascendency.Name,
624+
["internalId"] = ascendency.Id
619625
})
620626

621627
-- add assets
@@ -706,7 +712,11 @@ for i, group in ipairs(psg.groups) do
706712
if passiveRow == nil then
707713
printf("Passive skill " .. passive.id .. " not found")
708714
else
709-
if passiveRow.Name:find(ignoreFilter) ~= nil then
715+
if passiveRow.Name == "" then
716+
printf("Ignoring passive skill " .. passive.id .. " No name")
717+
goto exitNode
718+
end
719+
if passiveRow.Name:find(ignoreFilter) ~= nil and passiveRow.Name ~= "[DNT] Kite Fisher" and passiveRow.Name ~= "[DNT] Troller" and passiveRow.Name ~= "[DNT] Spearfisher" and passiveRow.Name ~= "[DNT] Angler" and passiveRow.Name ~= "[DNT] Whaler" then
710720
printf("Ignoring passive skill " .. passiveRow.Name)
711721
goto exitNode
712722
end
@@ -734,7 +744,7 @@ for i, group in ipairs(psg.groups) do
734744
-- Ascendancy
735745
if passiveRow.Ascendancy ~= nil then
736746
groupIsAscendancy = true
737-
if passiveRow.Ascendancy.Name:find(ignoreFilter) ~= nil then
747+
if passiveRow.Ascendancy.Name:find(ignoreFilter) ~= nil or passiveRow.Ascendancy.Id == "Monk1" then
738748
printf("Ignoring node ascendancy " .. passiveRow.Ascendancy.Name)
739749
goto exitNode
740750
end
@@ -992,6 +1002,9 @@ for i, classId in ipairs(psg.passives) do
9921002
for _, ascendancy in ipairs(class.ascendancies) do
9931003
local info = ascendancyGroups[ascendancy.id]
9941004
local ascendancyNode = tree.nodes[info.startId]
1005+
if ascendancyNode == nil then
1006+
printf("Ascendancy node " .. ascendancy.id .. " not found")
1007+
end
9951008
local groupAscendancy = tree.groups[ascendancyNode.group]
9961009

9971010
local angle = startAngle + (j - 1) * angleStep

src/Modules/ModTools.lua

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,20 @@ function modLib.formatValue(value)
184184
t_insert(paramNames, name)
185185
end
186186
end
187-
t_sort(paramNames)
187+
188+
t_sort(paramNames, function (a, b)
189+
if type(a) == "number" and type(b) == "number" then
190+
return a < b
191+
end
192+
if type(a) == "number" then
193+
return true
194+
end
195+
if type(b) == "number" then
196+
return false
197+
end
198+
return a < b
199+
end)
200+
188201
if haveType then
189202
t_insert(paramNames, 1, "type")
190203
end
31.8 MB
Binary file not shown.
2.69 MB
Binary file not shown.
232 KB
Binary file not shown.
19.6 KB
Binary file not shown.
77.3 KB
Binary file not shown.

0 commit comments

Comments
 (0)