omit the threshold if doom is reset

This commit is contained in:
Chr1Z93 2024-01-06 13:42:58 +01:00
parent 06e81835e9
commit 8115f0cb3c

View File

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