diff --git a/src/core/DoomCounter.ttslua b/src/core/DoomCounter.ttslua index 3d047b81..987ae969 100644 --- a/src/core/DoomCounter.ttslua +++ b/src/core/DoomCounter.ttslua @@ -90,7 +90,7 @@ function broadcastDoom(val) local doomInPlayCounter = guidReferenceApi.getObjectByOwnerAndType("Mythos", "DoomInPlayCounter") if doomInPlayCounter and md.subtractDoomInPlay then doomInPlayCounter.call("toggleSubtractDoom", true) - printToAll("Right-click the small 'Doom in Play' counter and select 'Toggle Doom Mode' to change this.") + broadcastToAll("Right-click the small 'Doom in Play' counter and select 'Toggle Doom Mode' to change this.") end local doomInPlay = doomInPlayCounter and doomInPlayCounter.call("getDoomCount") or 0 local totalDoom = val + doomInPlay @@ -102,7 +102,7 @@ function broadcastDoom(val) table.insert(broadcastParts, " doom on the agenda (") -- add the middle part - if doomThreshold then + if doomThreshold - mod > 0 then -- maybe add color if threshold is reached if totalDoom >= doomThreshold then table.insert(broadcastParts, "[" .. Color.fromString("Red"):toHex() .. "]") @@ -118,8 +118,12 @@ function broadcastDoom(val) table.insert(broadcastParts, " total)") else - table.insert(broadcastParts, val + math.abs(doomInPlay)) - table.insert(broadcastParts, " in play)") + table.insert(broadcastParts, val + doomInPlay) + if doomInPlay < 0 then + table.insert(broadcastParts, " total)") + else + table.insert(broadcastParts, " in play)") + end end broadcastToAll(table.concat(broadcastParts, "")) diff --git a/src/core/DoomInPlayCounter.ttslua b/src/core/DoomInPlayCounter.ttslua index 89bf5d02..cfca2055 100644 --- a/src/core/DoomInPlayCounter.ttslua +++ b/src/core/DoomInPlayCounter.ttslua @@ -26,7 +26,7 @@ function onLoad(savedData) subtractDoom = JSON.decode(savedData) end - self.addContextMenuItem("Toggle Doom Mode", toggleSubtractDoom) + self.addContextMenuItem("Toggle Doom Mode", function() toggleSubtractDoom() end) self.createButton({ label = "0", click_function = "none", @@ -52,7 +52,7 @@ function toggleSubtractDoom(override) else subtractDoom = not subtractDoom end - + -- early exit if nothing was changed if previousState == subtractDoom then return end