
.namespace s09_SearchSite

function OnEnable()
	SearchSite.OnEnable()
	OPLog.Log("OnEnable unit "..self.Name)

	if SampleLevel.IsEqual("s09_sonnette","done") then
		sonnette_area.Enabled = false
		morceau_sonnette.Enabled = false
		complet_sonnette.Enabled = true
	else
		sonnette_area.Enabled = true
		morceau_sonnette.Enabled = true
		complet_sonnette.Enabled = false
	end

end

function OnEnter()
	
	if SampleLevel.IsEqual("s09_firstenter",true) then
		SequencePlayer.Enabled = true
		SequencePlayer.PlaySequence("GP_900",nil,nil)
		SampleLevel.Set("s09_firstenter",false)
	end	
	if SampleLevel.IsEqual("s09_sonnette","done") and SampleLevel.IsEqual("s09_search_1","unstarted")  then --or SampleLevel.IsEqual("s09_search_1","started")
	SequencePlayer.Enabled = true
	SequencePlayer.PlaySequence("GP_902",s09_SearchSite,nil)
	end
	
	
end


function UpdateAll()

	
end

function OnPickObject(objname)


end

function OnSequenceEnd (keyword)
	if keyword == "GP_902" then
	@ObjectManager.LaunchNewResearch("s09",1)
  end
end

function OnSearchEnd(typesearch)
	if typesearch == 1 then
	InventoryManager.AddInInventory("InventoryClefs","msg_ig_inventaire")
	InventoryClefs.Equipped = true

	end	
	
end

function OnPopupLeave(objname)
	if objname == "InventoryClefs" then
		SequencePlayer.Enabled = true
		SequencePlayer.PlaySequence("GP_903",nil,nil)
	end
end


function CondSpecificToFinish()

end