@@ -12,6 +12,29 @@ if not loadStatFile then
12
12
end
13
13
loadStatFile (" passive_skill_stat_descriptions.csd" )
14
14
15
+ local function CalcOrbitAngles (nodesInOrbit )
16
+ local orbitAngles = {}
17
+
18
+ if nodesInOrbit == 16 then
19
+ -- Every 30 and 45 degrees, per https://github.com/grindinggear/skilltree-export/blob/3.17.0/README.md
20
+ orbitAngles = { 0 , 30 , 45 , 60 , 90 , 120 , 135 , 150 , 180 , 210 , 225 , 240 , 270 , 300 , 315 , 330 }
21
+ elseif nodesInOrbit == 40 then
22
+ -- Every 10 and 45 degrees
23
+ orbitAngles = { 0 , 10 , 20 , 30 , 40 , 45 , 50 , 60 , 70 , 80 , 90 , 100 , 110 , 120 , 130 , 135 , 140 , 150 , 160 , 170 , 180 , 190 , 200 , 210 , 220 , 225 , 230 , 240 , 250 , 260 , 270 , 280 , 290 , 300 , 310 , 315 , 320 , 330 , 340 , 350 }
24
+ else
25
+ -- Uniformly spaced
26
+ for i = 0 , nodesInOrbit do
27
+ orbitAngles [i + 1 ] = 360 * i / nodesInOrbit
28
+ end
29
+ end
30
+
31
+ for i , degrees in ipairs (orbitAngles ) do
32
+ orbitAngles [i ] = math.rad (degrees )
33
+ end
34
+
35
+ return orbitAngles
36
+ end
37
+
15
38
local function extractFromGgpk (listToExtract , useRegex )
16
39
useRegex = useRegex or false
17
40
local sweetSpotCharacter = 6000
@@ -542,36 +565,37 @@ end
542
565
local tree = {
543
566
[" tree" ] = idPassiveTree ,
544
567
[" min_x" ]= 0 ,
545
- [" min_y" ]= 0 ,
546
- [" max_x" ]= 0 ,
547
- [" max_y" ]= 0 ,
568
+ [" min_y" ]= 0 ,
569
+ [" max_x" ]= 0 ,
570
+ [" max_y" ]= 0 ,
548
571
[" classes" ] = {},
549
572
[" groups" ] = { },
550
573
[" nodes" ]= { },
551
574
[" assets" ]= {},
552
575
[" ddsCoords" ] = {},
553
576
[" jewelSlots" ] = {},
554
577
[" constants" ]= { -- calculate this
555
- [" classes" ]= {
556
- [" StrDexIntClass" ]= 0 ,
557
- [" StrClass" ]= 1 ,
558
- [" DexClass" ]= 2 ,
559
- [" IntClass" ]= 3 ,
560
- [" StrDexClass" ]= 4 ,
561
- [" StrIntClass" ]= 5 ,
562
- [" DexIntClass" ]= 6
563
- },
564
- [" characterAttributes" ]= {
565
- [" Strength" ]= 0 ,
566
- [" Dexterity" ]= 1 ,
567
- [" Intelligence" ]= 2
568
- },
569
- [" PSSCentreInnerRadius" ]= 130 ,
570
- [" skillsPerOrbit" ]= {},
571
- [" orbitRadii" ]= {
578
+ [" classes" ]= {
579
+ [" StrDexIntClass" ]= 0 ,
580
+ [" StrClass" ]= 1 ,
581
+ [" DexClass" ]= 2 ,
582
+ [" IntClass" ]= 3 ,
583
+ [" StrDexClass" ]= 4 ,
584
+ [" StrIntClass" ]= 5 ,
585
+ [" DexIntClass" ]= 6
586
+ },
587
+ [" characterAttributes" ]= {
588
+ [" Strength" ]= 0 ,
589
+ [" Dexterity" ]= 1 ,
590
+ [" Intelligence" ]= 2
591
+ },
592
+ [" PSSCentreInnerRadius" ]= 130 ,
593
+ [" skillsPerOrbit" ]= {},
594
+ [" orbitAnglesByOrbit" ] = {},
595
+ [" orbitRadii" ]= {
572
596
0 , 82 , 162 , 335 , 493 , 662 , 846 , 251 , 1080 , 1322
573
- }
574
- },
597
+ },
598
+ },
575
599
}
576
600
577
601
printf (" Generating classes..." )
@@ -605,6 +629,16 @@ for i, classId in ipairs(psg.passives) do
605
629
[" base_dex" ] = character .BaseDexterity ,
606
630
[" base_int" ] = character .BaseIntelligence ,
607
631
[" ascendancies" ] = {},
632
+ [" background" ] = {
633
+ [" active" ] = { width = 2000 , height = 2000 },
634
+ [" bg" ] = { width = 2000 , height = 2000 },
635
+ image = " Classes" .. character .Name ,
636
+ section = " AscendancyBackground" ,
637
+ x = 0 ,
638
+ y = 0 ,
639
+ width = 1500 ,
640
+ height = 1500
641
+ }
608
642
}
609
643
610
644
-- add assets
@@ -622,7 +656,15 @@ for i, classId in ipairs(psg.passives) do
622
656
table.insert (classDef .ascendancies , {
623
657
[" id" ] = ascendency .Name ,
624
658
[" name" ] = ascendency .Name ,
625
- [" internalId" ] = ascendency .Id
659
+ [" internalId" ] = ascendency .Id ,
660
+ [" background" ] = {
661
+ image = " Classes" .. ascendency .Name ,
662
+ section = " AscendancyBackground" ,
663
+ x = 0 ,
664
+ y = 0 ,
665
+ width = 1500 ,
666
+ height = 1500
667
+ }
626
668
})
627
669
628
670
-- add assets
@@ -985,6 +1027,11 @@ for i, orbit in ipairs(orbitsConstants) do
985
1027
tree .constants .skillsPerOrbit [i ] = orbit
986
1028
end
987
1029
1030
+ -- calculate the orbit radius
1031
+ for orbit , skillsInOrbit in ipairs (tree .constants .skillsPerOrbit ) do
1032
+ tree .constants .orbitAnglesByOrbit [orbit ] = CalcOrbitAngles (skillsInOrbit )
1033
+ end
1034
+
988
1035
-- Update position of ascendancy base on min / max
989
1036
-- get the orbit radius + hard-coded value, calculate the angle of the class start
990
1037
-- translate the ascendancy to the new position in arc position
@@ -1025,12 +1072,25 @@ for i, classId in ipairs(psg.passives) do
1025
1072
local groupAscendancy = tree .groups [ascendancyNode .group ]
1026
1073
1027
1074
local angle = startAngle + (j - 1 ) * angleStep
1028
- local newX = hardCoded * math.cos (angle )
1029
- local newY = hardCoded * math.sin (angle )
1075
+ local cX = hardCoded * math.cos (angle )
1076
+ local cY = hardCoded * math.sin (angle )
1077
+
1078
+ ascendancy .background .x = cX
1079
+ ascendancy .background .y = cY
1080
+
1081
+ local innerRadious = dat (" ascendancy" ):GetRow (" Id" , ascendancy .internalId ).distanceTree
1082
+
1083
+ local newInnerX = cX + math.cos (angleToCenter ) * innerRadious
1084
+ local newInnerY = cY + math.sin (angleToCenter ) * innerRadious
1085
+
1086
+ local nodeAngle = tree .constants .orbitAnglesByOrbit [ascendancyNode .orbit + 1 ][ascendancyNode .orbitIndex + 1 ]
1087
+ local orbitRadius = tree .constants .orbitRadii [ascendancyNode .orbit + 1 ]
1088
+ local newX = newInnerX - math.sin (nodeAngle ) * orbitRadius
1089
+ local newY = newInnerY + math.cos (nodeAngle ) * orbitRadius
1030
1090
1031
1091
local offsetX = newX - groupAscendancy .x
1032
1092
local offsetY = newY - groupAscendancy .y
1033
-
1093
+
1034
1094
-- now update the whole groups with the offset
1035
1095
for groupId , value in pairs (info ) do
1036
1096
if type (value ) == " boolean" then
0 commit comments