Skip to content
Draft
Show file tree
Hide file tree
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
15 changes: 10 additions & 5 deletions src/Classes/TreeTab.lua
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ local TreeTabClass = newClass("TreeTab", "ControlHost", function(self, build)
self.controls.treeHeatMapStatSelect.shown = state

if state == false then
self.controls.powerReportList.shown = false
self.controls.powerReportList.shown = false
end
end)

Expand Down Expand Up @@ -302,12 +302,17 @@ local TreeTabClass = newClass("TreeTab", "ControlHost", function(self, build)

self.controls.powerReportList.label = message
self.lastProgressToastUpdate = now
local toastIndex = findToastIndex("^Building Power Report")
local toastIndex = findToastIndex("^Cancelling")
if toastIndex then
main.toastMessages[toastIndex] = message
self.viewer.showHeatMap = false
else
t_insert(main.toastMessages, message)
self.powerBuilderToastActive = true
toastIndex = findToastIndex("^Building Power Report")
if toastIndex then
main.toastMessages[toastIndex] = message
else
t_insert(main.toastMessages, message)
self.powerBuilderToastActive = true
end
end
end
-- Completion callback from the CalcsTab power builder coroutine
Expand Down
6 changes: 6 additions & 0 deletions src/Modules/Main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,9 @@ function main:Init()
self.controls.dismissToast = new("ButtonControl", {"BOTTOMLEFT",self.anchorMain,"BOTTOMLEFT"}, {0, function() return -self.mainBarHeight + self.toastHeight end, 80, 20}, "Dismiss", function()
self.toastMode = "HIDING"
self.toastStart = GetTime()
if self.toastMessages[1]:match("^Building Power Report") then
self.toastMessages[1] = "Cancelling"
end
end)
self.controls.dismissToast.shown = function()
return self.toastMode == "SHOWN"
Expand Down Expand Up @@ -386,6 +389,9 @@ function main:OnFrame()

-- Run toasts
if self.toastMessages[1] then
if self.toastMessages[1]:match("^Building Power Report") then
self.controls.dismissToast.label = "Cancel"
end
if not self.toastMode then
self.toastMode = "SHOWING"
self.toastStart = GetTime()
Expand Down