Merge pull request #531 from argonui/doom-reset

Doom Counter: omit the threshold from the broadcast if doom is reset
This commit is contained in:
Entrox-Licher 2024-01-08 10:06:58 -05:00 committed by GitHub
commit 8dcbce1542
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -58,7 +58,11 @@ end
function updateVal(number)
val = number or 0
self.editButton({ index = 0, label = tostring(val) })
broadcastDoom(val)
if number then
broadcastDoom(val)
else
broadcastToAll("0 doom on the agenda", "White")
end
end
-- called by updateVal and addVal to broadcast total doom in play, including doom threshold
@ -77,7 +81,8 @@ end
-- called by "Reset" button to remove doom
function startReset()
if options.Agenda then
updateVal(0)
-- omitting the number will broadcast a special message just for this case
updateVal()
end
local doomInPlayCounter = guidReferenceApi.getObjectByOwnerAndType("Mythos", "DoomInPlayCounter")
if doomInPlayCounter then