
.namespace s13_c01

function OnEnable()
	Closeup.OnEnable("MiniGame")
	Reset()
	gamestart=true
	SaveManager.saveGame("Profil"..ProfilConfig.Get("CurrentProfil"))
	local lang = DebugOptions.curlanguage 
	indices.Image="media/graph/documents/indice_port_3_"..lang..".png"
	--indice_port_3_fre.png
end

function Reset()
	translaind=0
	
end

function OnUpdate()
	-- OPLog.Log("valid "..valid)
	-- OPLog.Log("truc "..translaind)
	
	if translaind==1 then
		if indices.Position_X > 800 then
			indices.Position_X = indices.Position_X - 10
		end
	end
	
	if translaind==0 then
		if indices.Position_X < 1200 then
			indices.Position_X = indices.Position_X + 10
		end
	end
	
end

function Itsawin()
	InventoryManager.RemoveFromInventory("InventoryIndicePort3")
	PlaySoundEffect("int_closeupwin")
	s13_c01.Enabled = false
	NavigationManager.SwitchTo(nil,"s14_SearchSite")
end

function OnEnter()
	--SearchInterface.Enabled = false	
	SequencePlayer.Enabled = true
	SequencePlayer.PlaySequence("GP_1305",nil,nil)
	--interfaceclsp.Enabled = true
end

function OnSequenceEnd(dialogue)
	if dialogue == "GP_1305" then
		SequencePlayer.Enabled = true
		SequencePlayer.PlaySequence("AI_"..GetCurrentManager().Name,self,nil,"help")
		return true
	end
end

function OnDocumentUse(docname)
	if docname == "InventoryIndicePort3" then
		PlaySoundEffect("gmp_droppaper")
		indices.Enabled = true
		SpriteFader.Fade(indices,true,1,self)
		InventoryManager.RemoveFromInventory("InventoryIndicePort3")
		indices.Position_X = 700
		translaind=-1
		return true
	end
	return false
end

function OnPickObject(objname)

end

function OnFaderEnd()
	translaind=0

end

function CondSpecificToFinish() 

end