Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions src/Classes/TreeTab.lua
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ function TreeTabClass:TreeTab(build)
self.jumpToX = selectedNode.x
self.jumpToY = selectedNode.y
end
self.powerReportNodeId = selectedNode.x and selectedNode.id or nil
end)
self.controls.powerReportList.shown = false
-- Progress callback from the CalcsTab power builder coroutine
Expand Down Expand Up @@ -451,6 +452,22 @@ function TreeTabClass:Draw(viewPort, inputEvents)
self.viewer.compareSpec = self.isComparing and self.specList[self.activeCompareSpec] or nil
self.viewer:Draw(self.build, treeViewPort, inputEvents)

if not self.controls.powerReportList.shown then
self.powerReportNodeId = nil
end
local node = self.powerReportNodeId and self.build.spec.nodes[self.powerReportNodeId]
if node then
local scale = m_min(treeViewPort.width, treeViewPort.height) / self.build.spec.tree.size * self.viewer.zoom
local x = node.x * scale + self.viewer.zoomX + treeViewPort.width / 2
local y = node.y * scale + self.viewer.zoomY + treeViewPort.height / 2
local radius = node.size * scale * 1.4
SetViewport(treeViewPort.x, treeViewPort.y, treeViewPort.width, treeViewPort.height)
SetDrawLayer(nil, 31)
SetDrawColor(0, 1, 0)
DrawImage(self.viewer.highlightRing, x - radius, y - radius, radius * 2, radius * 2)
SetViewport()
end

local newSpecList = self:GetSpecList()
self.controls.compareSelect.selIndex = self.activeCompareSpec
self.controls.compareSelect:SetList(newSpecList)
Expand Down Expand Up @@ -550,6 +567,9 @@ function TreeTabClass:SetActiveSpec(specId, deferSync)
local prevSpec = self.build.spec
self.activeSpec = m_min(specId, #self.specList)
local curSpec = self.specList[self.activeSpec]
if prevSpec ~= curSpec then
self.powerReportNodeId = nil
end
data.setJewelRadiiGlobally(curSpec.treeVersion)
self.build.spec = curSpec
self.build.buildFlag = true
Expand Down
Loading