-- ----------------------------------------------------------------------------
layoutBasementSecretDoor.mExits =
{
}
layoutBasementSecretDoor.mPOIs = 
{
}
layoutBasementSecretDoor.mHOs = 
{
}
layoutBasementSecretDoor.mIOs =
{
	[objectBasementSecretdoorPeephole] = 
	{
		cursors = kCursorMagnify,
	},
	[objectBasementSecretdoorPeepholeLit] = 
	{
		cursors = kCursorMagnify,
	},
}
-- ----------------------------------------------------------------------------
function layoutBasementSecretDoor:onConstruct()
	
	Layout.onConstruct(self)
	
	objectBasementSecretdoorBackgroundLit:ss(kIdle)
	objectBasementSecretdoorBackground:ss(kIdle)
	objectBasementSecretdoorPeepholeLit:ss(kInactive)
	objectBasementSecretdoorPeephole:ss(kActive)
	objectBasementSecretdoorLookLit:ss(kInactive)
	objectBasementSecretdoorLook:ss(kInactive)
	
	objectBasementDoorPeepholeLit:ss(kInactive)
	objectBasementDoorPeepholeLit:animate("flickerPeepholeLit",
		{ startframe=0, endframe=4,	frametime=100, loops="forever" }
	)		
	objectBasementDoorPeephole:ss(kIdle)	
	objectBasementDoorPeephole:animate("flickerPeephole",
		{ startframe=0, endframe=4,	frametime=100, loops="forever" }
	)		
	objectBasementLookDoorLit:ss(kInactive)
	objectBasementLookDoorLit:animate("flickerLookDoorLit",
		{ startframe=0, endframe=1,	frametime=100, loops="forever" }
	)			
	objectBasementLookDoor:ss(kInactive)
	objectBasementLookDoor:animate("flickerLookDoor",
		{ startframe=0, endframe=1,	frametime=100, loops="forever" }
	)			
	
end
-- ----------------------------------------------------------------------------
function layoutBasementSecretDoor:onClickIO(object, x, y)

	if (object == objectBasementSecretdoorPeephole) then
		objectBasementSecretdoorPeephole:ss(kIdle)
		objectBasementSecretdoorLook:ss(kIdle)
		objectBasementLookDoor:ss(kIdle)
		think("MESSAGE_BASEMENT_SECRET_DOOR_LOCKED_UNLIT")
		getAudioManager():playTrack( { tag="SECRETDOOR_DRAUGHT", definition="IRONDOOR_DRAUGHT" } )	
		return true, false
	end

	if (object == objectBasementSecretdoorPeepholeLit) then
		objectBasementSecretdoorPeepholeLit:ss(kIdle)
		objectBasementSecretdoorLookLit:ss(kIdle)
		objectBasementLookDoorLit:ss(kIdle)
		think("MESSAGE_BASEMENT_SECRET_DOOR_LOCKED")
		getAudioManager():playTrack( { tag="SECRETDOOR_DRAUGHT", definition="IRONDOOR_DRAUGHT" } )	
		return true, false
	end

end
-- ----------------------------------------------------------------------------
function layoutBasementSecretDoor:onHide()

	Layout.onHide(self)
	
end
-- ----------------------------------------------------------------------------
function layoutBasementSecretDoor:onShow()
	
	Layout.onShow(self)
	
	if (goalPlaceFuses:isFinished()) then
		objectBasementSecretdoorLookLit:ss(kInactive)
		objectBasementSecretdoorPeepholeLit:ss(kActive)
		objectBasementDoorPeepholeLit:ss(kIdle)
		objectBasementDoorPeephole:ss(kInactive)
		objectBasementLookDoorLit:ss(kInactive)
		objectBasementLookDoor:ss(kInactive)
		
		ghf.cancelAnimation("flickerPeephole")
		ghf.cancelAnimation("flickerLookDoor")
	else
		objectBasementSecretdoorLook:ss(kInactive)
		objectBasementSecretdoorPeephole:ss(kActive)
		objectBasementLookDoor:ss(kInactive)
	end
	
end
-- ----------------------------------------------------------------------------
function layoutBasementSecretDoor:onStartAudio()

end
-- ----------------------------------------------------------------------------
function layoutBasementSecretDoor:onStopAudio()
	stopAudioTrack("SECRETDOOR_DRAUGHT")
end
