
.namespace s11_SearchSite

function OnEnable()
	SearchSite.OnEnable()
	OPLog.Log("OnEnable unit "..self.Name)
	--On définit le nom du tableau
	s11_door.SetFrame(0)
		if  SampleLevel.IsEqual("s11_search_1","unstarted") then 
		bateau_hotspot.Enabled = false
		liste_s11_1.Enabled = true
		end
		if SampleLevel.IsEqual("s11_door",true) then	
		s11_door.SetFrame(16)
		s11_door.Flags_Visible=true
		end	
		
end

function OnEnter()
	if SampleLevel.IsEqual("s11_firstenter",true) then
		SequencePlayer.Enabled = true
		SequencePlayer.PlaySequence("GP_1101",nil,nil)
		-- @ObjectManager.LaunchNewResearch("s11",1)
		SampleLevel.Set("s11_firstenter",false)
	end	
	
	if  SampleLevel.IsEqual("s11_search_1","finished") and InventoryClefCapitainerie.Equipped == false and SampleLevel.IsEqual("s12_firstenter",true) then 
		bateau_hotspot.Enabled = true
		InventoryCorne.Equipped = true
	end

				
	
end


function UpdateAll()
	
end

function OnPickObject(objname)
	if objname == "obj_jerrycan" then
	SampleLevel.Set("Page_5",true)
	PopupManager.OpenPopup("msg_ig_livre",nil,"Livre")
	end
end

function OnSequenceEnd (keyword)
if keyword == "GP_1107" then
		InventoryManager.AddInInventory("InventoryClefCapitainerie","msg_ig_inventaire")
		InventoryClefCapitainerie.Equipped = true
  end
end

function OnSearchEnd(typesearch)
	if typesearch == 1 then
		InventoryManager.AddInInventory("InventoryCorne","msg_ig_inventaire")
		InventoryCorne.Equipped = true
		bateau_hotspot.Enabled = true 	
		SampleLevel.Set("Page_5",true)
		end

end
function OnPopupLeave(objname)
	if objname == "InventoryCorne" then
		SequencePlayer.Enabled = true
		SequencePlayer.PlaySequence("GP_1103",s11_SearchSite,nil)
	end
end


function CondSpecificToFinish()

end

function OnDocumentUse(docname)
	if docname == "InventoryCorne" then
		InventoryManager.RemoveFromInventory("InventoryCorne")
		PlaySoundEffect("gmp_horn")
		bateau_hotspot.Enabled = false
		SequencePlayer.Enabled = true
		SequencePlayer.PlaySequence("GP_1107",s11_SearchSite,nil)
		return true
	end
	return false
end