
.namespace s11_HotSpot

function OnActivate()
	
	OPLog.Log("onactivate "..self.Name)
	
	if self.Name == "porte_hotspot" and InventoryClefCapitainerie.Equipped == false and SampleLevel.IsEqual("s11_door",false) then
		SequencePlayer.Enabled = true
		SequencePlayer.PlaySequence("GP_1104",nil,nil)	
		PlaySoundEffect("gmp_closeddoor")
	end
	
	if self.Name == "porte_hotspot" and InventoryClefCapitainerie.Equipped == true then
		SequencePlayer.Enabled = true
		SequencePlayer.PlaySequence("GP_1102",nil,nil)	
		PlaySoundEffect("gmp_closeddoor")
	end
	
	if self.Name == "porte_hotspot" and SampleLevel.IsEqual("s11_door",true) then
		NavigationManager.SwitchTo(nil,"s12_SearchSite")	
		PlaySoundEffect("gmp_opendoor")
	end
	
	
	
		
end

function OnEnable()
	AreaHotspot.OnEnable()
	--self.firstclick = true
	OPLog.Log("mon onenable "..self.Name)

end

function PrivateCanClickOn()
	--if SampleLevel.IsEqual("CloseupMecaState","finished")  then
	--	return false
	--end
	
	return true
end
function GetSpecificCursor()
	if self.Name == "porte_hotspot" then
		return 4,"s12"

	elseif self.Name == "bateau_hotspot"  then
		return 0			
	else
		return CURSOR_AREA_HOTSPOT
	end
end
function OnDropObject()
	OPLog.Log("drop "..self.Name)
	-- if IsEqualVariables("CurrentObject","InventoryCorne") and self.Name == "bateau_hotspot" then
		-- InventoryManager.RemoveFromInventory("InventoryCorne")
		-- bateau_hotspot.Enabled = false
		-- SequencePlayer.Enabled = true
		-- SequencePlayer.PlaySequence("GP_1107",s11_SearchSite,nil)
		
		
		-- return true
		
	-- end

	
	
	if IsEqualVariables("CurrentObject","InventoryClefCapitainerie") and self.Name == "porte_hotspot" then
		InventoryClefCapitainerie.Equipped = false
		s11_door.Play()
		SampleLevel.Set("s11_door",true)
		PlaySoundEffect("gmp_openkey")
		--NavigationManager.SwitchTo(nil,"s12_SearchSite")
		
		return true
	end
	return false
end

