#include "script/common.lua"

function init()
	signs = FindShapes("sign")
	done = false
end

function tick(dt)
	if not done then
		local broken = 0
		for i=1, #signs do
			local shape = signs[i]
			if IsShapeBroken(shape) or not IsHandleValid(shape) then
				broken = broken + 1
				if not GetBool("level.alarm") then
					SetBool("level.alarm", true)
					SetString("hud.notification", GetTranslatedStringByKey("UI_HUD_NOTE_BROKEN_NEON"))
				end
				local joints = GetShapeJoints(shape)
				for j=1, #joints do
					if HasTag(joints[j], "anim") then
						RemoveTag(joints[j], "anim")
					end
				end
			end
		end
	end
end

