
.namespace s03_HotSpot

function OnActivate()
	
	OPLog.Log("onactivate "..self.Name)
	
	if self.Name == "fenetre_hotspot" then
		SequencePlayer.Enabled = true
		SequencePlayer.PlaySequence("GP_312",nil,nil)	
	end
	
	if self.Name == "back_s03" then
		NavigationManager.SwitchTo(nil,"s01_SearchSite")	
	end
	
	if self.Name == "s03_liste01_hotspot" then
		@ObjectManager.LaunchNewResearch("s03",3)
		s03_liste01.Enabled = false
		s03_liste01_hotspot.Enabled = false
		PlaySoundEffect("gmp_grabpaper")
	end	
	if self.Name == "s03_liste02_hotspot" then
		@ObjectManager.LaunchNewResearch("s03",1)
		s03_liste02.Enabled = false
		s03_liste02_hotspot.Enabled = false
		InventoryManager.AddInInventory("InventoryCodeCadenas")	
		InventoryCodeCadenas.Equipped = true
		documents_parent.Enabled = true
		--indice.Enabled = true
		--plan_maison.Enabled = false
		SetVariables("CurrentGamePhase","Document")
		DocumentViewer.Image = "media/graph/documents/indice_"..DebugOptions.curlanguage..".png"
		documents_parent.Enabled = true
		PlaySoundEffect("gmp_grabpaper")
		SequencePlayer.Enabled = true
		SequencePlayer.PlaySequence("GP_303",nil,nil)
		
	end		
		
	if self.Name == "fissure_ouverte_hotspot" and SampleLevel.IsEqual("s03_tableau",false) then 
		SequencePlayer.Enabled = true
		SequencePlayer.PlaySequence("GP_313",nil,nil)
		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 == "s03_liste01_hotspot" then
		return 3
	elseif	self.Name == "back_s03" then
		return 11,"s01"
	elseif self.Name == "fissure_ouverte_hotspot" and SampleLevel.IsEqual("s03_tableau",true) then
		return 0
	elseif self.Name == "fissure_ouverte_hotspot" and SampleLevel.IsEqual("s03_tableau",false) then
		return 1
	elseif self.Name == "fenetre_hotspot" then
		return 1
	elseif self.Name == "s03_liste02_hotspot" then
		return 3			
	else
		return CURSOR_AREA_HOTSPOT
	end
end
function OnDropObject()
	OPLog.Log("drop "..self.Name)
	if IsEqualVariables("CurrentObject","InventoryPiedBiche") and self.Name == "fissure_ouverte_hotspot" then
		PlaySoundEffect("gmp_breakwall")
		InventoryManager.RemoveFromInventory("InventoryPiedBiche")
		fissure_ouverte.Enabled = true
		fissure_ouverte_hotspot.Enabled = false
		SampleLevel.Set("s03_fissure_open",true)
		SequencePlayer.Enabled = true
		SequencePlayer.PlaySequence("GP_314",nil,nil)
		return true
		--sprite liste visible (ex : nomdelunit.Flags_Visible = true)
	end
		
	-- if IsEqualVariables("CurrentObject","InventoryPiedBiche") then
		-- SequencePlayer.Enabled = true
		-- SequencePlayer.PlaySequence("GP_308",nil,nil)
		-- return true
	-- end
	
	
end