less spammy feedback message
This commit is contained in:
parent
c9dfdc9171
commit
488d465679
@ -172,7 +172,7 @@ function resetDoomCounter()
|
|||||||
-- reset subtractDoom setting
|
-- reset subtractDoom setting
|
||||||
local doomInPlayCounter = guidReferenceApi.getObjectByOwnerAndType("Mythos", "DoomInPlayCounter")
|
local doomInPlayCounter = guidReferenceApi.getObjectByOwnerAndType("Mythos", "DoomInPlayCounter")
|
||||||
if doomInPlayCounter ~= nil then
|
if doomInPlayCounter ~= nil then
|
||||||
toggleSubtractDoom(false)
|
doomInPlayCounter.call("toggleSubtractDoom", true)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -89,7 +89,7 @@ function broadcastDoom(val)
|
|||||||
|
|
||||||
local doomInPlayCounter = guidReferenceApi.getObjectByOwnerAndType("Mythos", "DoomInPlayCounter")
|
local doomInPlayCounter = guidReferenceApi.getObjectByOwnerAndType("Mythos", "DoomInPlayCounter")
|
||||||
if doomInPlayCounter and md.subtractDoomInPlay then
|
if doomInPlayCounter and md.subtractDoomInPlay then
|
||||||
toggleSubtractDoom(true)
|
doomInPlayCounter.call("toggleSubtractDoom", true)
|
||||||
end
|
end
|
||||||
local doomInPlay = doomInPlayCounter and doomInPlayCounter.call("getDoomCount") or 0
|
local doomInPlay = doomInPlayCounter and doomInPlayCounter.call("getDoomCount") or 0
|
||||||
local totalDoom = val + doomInPlay
|
local totalDoom = val + doomInPlay
|
||||||
|
@ -46,17 +46,22 @@ function onLoad(savedData)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function toggleSubtractDoom(override)
|
function toggleSubtractDoom(override)
|
||||||
|
local previousState = subtractDoom
|
||||||
if override then
|
if override then
|
||||||
subtractDoom = override
|
subtractDoom = override
|
||||||
else
|
else
|
||||||
subtractDoom = not subtractDoom
|
subtractDoom = not subtractDoom
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- early exit if nothing was changed
|
||||||
|
if previousState == subtractDoom then return end
|
||||||
|
|
||||||
updateSave()
|
updateSave()
|
||||||
|
|
||||||
if subtractDoom then
|
if subtractDoom then
|
||||||
broadcastToAll("Doom in play: Subtract from the total doom count.")
|
printToAll("Doom in play: Subtract from the total doom count.", "Orange")
|
||||||
else
|
else
|
||||||
broadcastToAll("Doom in play: Add to the total doom count.")
|
printToAll("Doom in play: Add to the total doom count.", "Orange")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user