hintDt = 0.0167

function init()
	time = 0
end


function notify(str)
	SetString("hud.notification", str)
	SetInt("hud.notification.numicons", 0)
end

function tick(dt)
	if GetBool("game.paused") then
		return
	end

	local missionDone = (time > 60 * hintDt and not GetBool("level.alarm") and GetBool("level.complete"))
	if missionDone and not GetBool("game.map.enabled") and GetString("level.state") ~= "win" then
		if not GetBool("level.notified") and math.floor(time / hintDt) % 600 == 0 then
            if GetInt("level.failed") + GetInt("level.clearedprimary") + GetInt("level.clearedsecondary") < GetInt("level.primary") + GetInt("level.secondary") then return end
			notify(GetTranslatedStringByKey("UI_HUD_NOTE_ALL_DONE_TEXT"))
            SetBool("level.notified", true)
		end
	end
end


function update(dt)
	if GetBool("game.paused") or GetBool("game.map.enabled") then
		return
	end
	time = time + dt
end
