Less spammy doom counter message
This commit is contained in:
parent
5621ed2270
commit
808b6c45d2
@ -89,8 +89,10 @@ function broadcastDoom(val)
|
||||
|
||||
local doomInPlayCounter = guidReferenceApi.getObjectByOwnerAndType("Mythos", "DoomInPlayCounter")
|
||||
if doomInPlayCounter and md.subtractDoomInPlay then
|
||||
doomInPlayCounter.call("toggleSubtractDoom", true)
|
||||
broadcastToAll("Right-click the small 'Doom in Play' counter and select 'Toggle Doom Mode' to change this.")
|
||||
local previousState = doomInPlayCounter.call("toggleSubtractDoom", true)
|
||||
if previousState == false then
|
||||
broadcastToAll("Right-click the small 'Doom in Play' counter and select 'Toggle Doom Mode' to change this.")
|
||||
end
|
||||
end
|
||||
local doomInPlay = doomInPlayCounter and doomInPlayCounter.call("getDoomCount") or 0
|
||||
local totalDoom = val + doomInPlay
|
||||
|
@ -5,16 +5,10 @@ local ZONE, TRASH
|
||||
local doomURL = "https://i.imgur.com/EoL7yaZ.png"
|
||||
local IGNORE_TAG = "DoomCounter_ignore"
|
||||
local TOTAL_PLAY_AREA = {
|
||||
upperLeft = {
|
||||
x = -9,
|
||||
z = -35
|
||||
},
|
||||
lowerRight = {
|
||||
x = -60,
|
||||
z = 35
|
||||
}
|
||||
upperLeft = { x = -9, z = -35 },
|
||||
lowerRight = { x = -60, z = 35 }
|
||||
}
|
||||
local subtractDoom = false
|
||||
local subtractDoom = false
|
||||
|
||||
function updateSave()
|
||||
self.script_state = JSON.encode(subtractDoom)
|
||||
@ -23,7 +17,7 @@ end
|
||||
-- create button, context menu and start loop
|
||||
function onLoad(savedData)
|
||||
if savedData and savedData ~= "" then
|
||||
subtractDoom = JSON.decode(savedData)
|
||||
subtractDoom = JSON.decode(savedData) or false
|
||||
end
|
||||
|
||||
self.addContextMenuItem("Toggle Doom Mode", function() toggleSubtractDoom() end)
|
||||
@ -54,7 +48,7 @@ function toggleSubtractDoom(override)
|
||||
end
|
||||
|
||||
-- early exit if nothing was changed
|
||||
if previousState == subtractDoom then return end
|
||||
if previousState == subtractDoom then return previousState end
|
||||
|
||||
updateSave()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user