Add button to show passive allocation order to passive tree tab (rebranch)#3546
Add button to show passive allocation order to passive tree tab (rebranch)#3546Voronoff wants to merge 6 commits into
Conversation
…l for build guides
…dancy, and resetting tree.
…g them adding the nodes to the end of allocation order
Wires77
left a comment
There was a problem hiding this comment.
Any reason you chose to not store the order alongside the nodes themselves? Seems like a cleaner solution to me...
When I have the champion node on Ascendant selected, and select the gladiator ascendancy, I get this crash:

The checkbox disappears in portrait mode, and when coming back to landscape mode, the text is overlapping:

Using shift to choose a path before selecting also results in some odd behavior:

At one point I was able to have the first part of my tree not have an allocation order and the second half started at '1'.
I'm not sure about the visibility of the red numbers next to nodes, honestly. I'm not exactly sure what would look better, maybe a full replacement of the node or a gradient from the beginning to the end. Might want to see what other people think.
| if a.allocationOrder == nil and b.allocationOrder == nil then | ||
| return false | ||
| elseif a.allocationOrder == nil then | ||
| return true | ||
| elseif b.allocationOrder == nil then | ||
| return false | ||
| else | ||
| return a.allocationOrder > b.allocationOrder | ||
| end |
There was a problem hiding this comment.
This logic can be simplified:
| if a.allocationOrder == nil and b.allocationOrder == nil then | |
| return false | |
| elseif a.allocationOrder == nil then | |
| return true | |
| elseif b.allocationOrder == nil then | |
| return false | |
| else | |
| return a.allocationOrder > b.allocationOrder | |
| end | |
| if b.allocationOrder == nil then | |
| return false | |
| elseif a.allocationOrder == nil then | |
| return true | |
| else | |
| return a.allocationOrder > b.allocationOrder | |
| end |
| local size = 175 * scale / self.zoom ^ 0.4 | ||
| DrawImage(self.highlightRing, scrX - size, scrY - size, size * 2, size * 2) | ||
| end | ||
| if self.showAllocationOrder and node.allocationOrder ~= nil then |
There was a problem hiding this comment.
| if self.showAllocationOrder and node.allocationOrder ~= nil then | |
| if self.showAllocationOrder and node.allocationOrder then |
| SetDrawLayer(nile, 29) | ||
| SetDrawColor(1, 0, 0) | ||
| local size = 100 * scale | ||
| local offset = node.size * 1.8 * scale | ||
| DrawString(m_floor(scrX - offset), m_floor(scrY - offset), "LEFT", size, "VAR", tostring(node.allocationOrder)) | ||
| end | ||
| if self.showAllocationOrder and node.ascendancyAllocationOrder ~= nil then | ||
| SetDrawLayer(nile, 29) | ||
| SetDrawColor(1, 0, 0) | ||
| local size = 100 * scale | ||
| local offset = node.size * 1.8 * scale | ||
| DrawString(m_floor(scrX - offset), m_floor(scrY - offset), "LEFT", size, "VAR", tostring(node.ascendancyAllocationOrder)) | ||
| end |
There was a problem hiding this comment.
This can all be combined into two calls to a local function
| end | ||
|
|
||
| self.controls.treeAllocationOrder.state = self.viewer.showAllocationOrder | ||
|
|
| end | ||
| end | ||
|
|
||
| ConPrintTable(reserverdAllocationOrders) |
There was a problem hiding this comment.
| ConPrintTable(reserverdAllocationOrders) |
| for nodeId, unallocated in pairs(reserverdAllocationOrders) do | ||
| self:RemoveFromAllocationOrder(self.nodes[nodeId]) | ||
| end | ||
| ConPrintTable(self.allocationOrder) |
There was a problem hiding this comment.
| ConPrintTable(self.allocationOrder) |
|
Decided against merging this even if the issues are fixed, as it's not enough added value for the amount of complexity it introduces. Build creators can still specify certain clusters in their notes as important or make different trees for different stages of a character |
|
@Wires77 I never got a github notification about the corrections, whoops. I'm happy to fix it and I do think it adds a lot of value to automagically track the order, especially for POBs that don't get written up into fully complete guides, but if you don't want it that's okay too. |
Rebranch of #3318 at @Wires77 request
Description of the feature added:
A button to show the order that passive nodes have been allocated on the tree for the build. This lets build creators have a single tree that people can follow the order of unless there are big respecs. Main tree and ascendency are tracked separately. Supports cluster jewel swapping, class switching, tree reset, and undo/redo.
Steps taken to verify a working solution:
Created testing builds with cluster jewels to swap around, tested old builds without existing allocation order for crashes, including swapping cluster jewels.
Screenshot:
https://imgur.com/aMppNoO