
.namespace s15_SearchSite

function OnEnable()
	SearchSite.OnEnable()
	OPLog.Log("OnEnable unit "..self.Name)
	--On définit le nom du tableau
		if  SampleLevel.IsEqual("s15_search_3","unstarted") then 
		liste_s15_3.Enabled = true
		elseif SampleLevel.IsEqual("s15_search_3","finished") and unit("InventoryCorde").Equipped == false then
			InventoryManager.AddInInventory("InventoryCorde","msg_ig_inventaire")
		end
end

function OnEnter()
	if SampleLevel.IsEqual("s15_firstenter",true) then
		SequencePlayer.Enabled = true
		SequencePlayer.PlaySequence("GP_1500",nil,nil)
		
		SampleLevel.Set("s15_firstenter",false)
	end	
	
end


function UpdateAll()
	
end

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


function OnSearchEnd(typesearch)
	if typesearch == 3 then
		InventoryManager.AddInInventory("InventoryCorde","msg_ig_inventaire")
		InventoryCorde.Equipped = true
		SampleLevel.Set("Page_8",true)


	end

end

-- function OnSequenceEnd (keyword)
	-- if keyword == "GP_1502" then
	  -- NavigationManager.SwitchTo(nil,"s16_SearchSite")
   -- end
  -- end


function OnPopupLeave(objname)
	if objname == "InventoryCorde" then
		SequencePlayer.Enabled = true
		SequencePlayer.PlaySequence("GP_1502",s15_SearchSite,nil)
	end
end

function CondSpecificToFinish()

end