Skip to content

Commit b5d191a

Browse files
justjuanguijustjuanguiWires77
authored
Passive Tree pre-update for version 0_2 (#872)
* Passive Tree version 0_2 was added * Passive Tree Script was update * Gimp 3 was out, script for extraction line was updated * Passive Tree version 0_2 was updated * Passive Tree Node Smith's Masterwork support added * Change game version back * Use isDisabled column instead of hardcoding Monk1 --------- Co-authored-by: justjuangui <[email protected]> Co-authored-by: Wires77 <[email protected]>
1 parent ad8c5f8 commit b5d191a

File tree

71 files changed

+90506
-16
lines changed

Some content is hidden

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

71 files changed

+90506
-16
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: 31 additions & 7 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")
@@ -251,7 +252,7 @@ local use4kIfPossible = false
251252
local idPassiveTree = 'Default'
252253
-- Find a way to get version
253254
local basePath = GetWorkDir() .. "/../TreeData/"
254-
local version = "0_1"
255+
local version = "0_2"
255256
local path = basePath .. version .. "/"
256257
local fileTree = path .. "tree.lua"
257258

@@ -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.isDisabled 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.isDisabled then
738748
printf("Ignoring node ascendancy " .. passiveRow.Ascendancy.Name)
739749
goto exitNode
740750
end
@@ -906,6 +916,18 @@ for i, group in ipairs(psg.groups) do
906916
if passiveRow.MultipleChoiceOption then
907917
node["isMultipleChoiceOption"] = true
908918
end
919+
920+
-- Support for Smith of Kitava
921+
if passiveRow["FreeAllocate"] == true then
922+
node["isMultipleChoice"] = true
923+
end
924+
925+
if passiveRow["ApplyToArmour?"] == true then
926+
node["isFreeAllocate"] = true
927+
node["isMultipleChoiceOption"] = true
928+
end
929+
930+
909931
end
910932

911933
for k, connection in ipairs(passive.connections) do
@@ -940,6 +962,7 @@ for i, group in ipairs(psg.groups) do
940962
end
941963
end
942964

965+
MakeDir(basePath .. version)
943966
-- write file with missing Stats
944967
if #missingStatInfo > 0 then
945968
local file = io.open(basePath .. version .. "/missingStats.txt", "w")
@@ -991,6 +1014,9 @@ for i, classId in ipairs(psg.passives) do
9911014
for _, ascendancy in ipairs(class.ascendancies) do
9921015
local info = ascendancyGroups[ascendancy.id]
9931016
local ascendancyNode = tree.nodes[info.startId]
1017+
if ascendancyNode == nil then
1018+
printf("Ascendancy node " .. ascendancy.id .. " not found")
1019+
end
9941020
local groupAscendancy = tree.groups[ascendancyNode.group]
9951021

9961022
local angle = startAngle + (j - 1) * angleStep
@@ -1019,8 +1045,6 @@ for i, classId in ipairs(psg.passives) do
10191045
end
10201046
end
10211047

1022-
MakeDir(basePath .. version)
1023-
10241048
printf("Generating sprite info...")
10251049
for i, sheet in ipairs(sheets) do
10261050
printf("Calculating sprite dimensions for " .. sheet.name)

src/Export/Tree/gimpbatch/extract_lines.scm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
)
8787
)
8888

89-
(set! new-layer (car (gimp-layer-new new-image width height RGBA-IMAGE "new-layer" 100 LAYER-MODE-NORMAL)))
89+
(set! new-layer (car (gimp-layer-new new-image "new-layer" width height RGBA-IMAGE 100 LAYER-MODE-NORMAL)))
9090
(gimp-image-insert-layer new-image new-layer -1 -1)
9191
(gimp-edit-copy (vector src-layer-id))
9292
(gimp-floating-sel-anchor (vector-ref (car (gimp-edit-paste new-layer TRUE)) 0))
@@ -121,14 +121,14 @@
121121
)
122122
)
123123

124-
(set! new-layer (car (gimp-layer-new new-image width-image height-image RGBA-IMAGE "new-layer" 100 LAYER-MODE-NORMAL)))
124+
(set! new-layer (car (gimp-layer-new new-image "new-layer" width-image height-image RGBA-IMAGE 100 LAYER-MODE-NORMAL)))
125125
(gimp-image-insert-layer new-image new-layer -1 -1)
126126
(gimp-selection-none src-image)
127127
(gimp-edit-copy (vector src-layer-id))
128128
(gimp-floating-sel-anchor (vector-ref (car (gimp-edit-paste new-layer TRUE)) 0))
129129

130130
;; add new mask layer to the new image
131-
(set! mask-layer (car (gimp-layer-new new-image width-image height-image RGBA-IMAGE "mask" 100 LAYER-MODE-NORMAL)))
131+
(set! mask-layer (car (gimp-layer-new new-image "mask" width-image height-image RGBA-IMAGE 100 LAYER-MODE-NORMAL)))
132132
(gimp-context-set-foreground '(255 255 255))
133133
(gimp-image-insert-layer new-image mask-layer -1 -1)
134134
(gimp-drawable-edit-fill mask-layer FILL-FOREGROUND)

src/Export/spec.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1506,7 +1506,7 @@ return {
15061506
},
15071507
[14]={
15081508
list=false,
1509-
name="",
1509+
name="isDisabled",
15101510
refTo="",
15111511
type="Bool",
15121512
width=150

src/GameVersions.lua

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,20 @@ liveTargetVersion = "0_1"
77
-- Skill tree versions
88
---Added for convenient indexing of skill tree versions.
99
---@type string[]
10-
treeVersionList = { "0_1" }
10+
treeVersionList = { "0_1", "0_2" }
1111
--- Always points to the latest skill tree version.
1212
latestTreeVersion = treeVersionList[#treeVersionList]
1313
---Tree version where multiple skill trees per build were introduced to PoBC.
1414
defaultTreeVersion = treeVersionList[1]
1515
---Display, comparison and export data for all supported skill tree versions.
16-
---@type table<string, {display: string, num: number, url: string}>
16+
---@type table<string, {display: string, num: number}>
1717
treeVersions = {
1818
["0_1"] = {
1919
display = "0_1",
2020
num = 0.1,
2121
},
22+
["0_2"] = {
23+
display = "0_2",
24+
num = 0.2,
25+
},
2226
}

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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
254 KB
Binary file not shown.
539 KB
Binary file not shown.
8.44 KB
Binary file not shown.
470 KB
Binary file not shown.
Binary file not shown.
176 KB
Binary file not shown.

src/TreeData/0_2/orbit_active0.png

1.96 KB

src/TreeData/0_2/orbit_active1.png

654 KB

src/TreeData/0_2/orbit_active2.png

532 KB

src/TreeData/0_2/orbit_active3.png

369 KB

src/TreeData/0_2/orbit_active4.png

262 KB

src/TreeData/0_2/orbit_active5.png

170 KB

src/TreeData/0_2/orbit_active6.png

105 KB

src/TreeData/0_2/orbit_active7.png

74 KB

src/TreeData/0_2/orbit_active8.png

38.4 KB

src/TreeData/0_2/orbit_active9.png

18.2 KB
1.81 KB
284 KB
231 KB
162 KB
117 KB
77.2 KB
48.8 KB
34.8 KB
19.1 KB
11.1 KB

src/TreeData/0_2/orbit_normal0.png

1.66 KB

src/TreeData/0_2/orbit_normal1.png

234 KB

src/TreeData/0_2/orbit_normal2.png

189 KB

src/TreeData/0_2/orbit_normal3.png

129 KB

src/TreeData/0_2/orbit_normal4.png

91.2 KB

src/TreeData/0_2/orbit_normal5.png

58.7 KB

src/TreeData/0_2/orbit_normal6.png

35.9 KB

src/TreeData/0_2/orbit_normal7.png

25.9 KB

src/TreeData/0_2/orbit_normal8.png

14.3 KB

src/TreeData/0_2/orbit_normal9.png

8.29 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2.22 MB
Binary file not shown.
11.8 KB
Binary file not shown.
16.9 KB
Binary file not shown.
300 KB
Binary file not shown.

src/TreeData/0_2/tree.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)