------------------------------------------------
-- ScenarioScript.lua
-- 03.07.2013
-- TrainTeamBerlin
--
-- Scenario Script
------------------------------------------------

file = nil;
TTB_SCENARIO_PATH = "Content/Routes/46b581ec-d477-4f20-bce6-0b40d24c0c79/Scenarios/a767b931-5e97-487a-8e7f-130b46168c42";
TTB_EBULAFILE = "TTB-Material/TTB-Ebula/TTB_EBULA_PATH.txt";

-- true/false
FALSE = 0
TRUE = 1

-- message types
TTB_MESSAGE_INFO = 0			-- large centre screen pop up
TTB_MESSAGE_ALERT = 1		-- top right alert message

TTB_MESSAGE_TOP = 1
TTB_MESSAGE_CENTER = 2
TTB_MESSAGE_BOTTOM = 4
TTB_MESSAGE_LEFT = 8
TTB_MESSAGE_CENTER = 16
TTB_MESSAGE_RIGHT = 32

TTB_MESSAGE_SMALL = 0
TTB_MESSAGE_MID = 1
TTB_MESSAGE_BIG = 2


-----------------------------------------------
-- on loading scenario: write Ebula Path file
-----------------------------------------------

	-- file = io.open( TTB_EBULAFILE,"w");
	-- file:write(TTB_SCENARIO_PATH);
	-- file:close();

-----------------------------------------------
-- 	Fn OnEvent
-- 	event - name of the event
--	return - TRUE/FALSE if event handled
function OnEvent ( event )

	-- ab hier block fuer textnachrichten

	if event == "introtext" then 
		SysCall ( "ScenarioManager:ShowInfoMessageExt", "BRB Bayrische Regiobahn GmbH", "intromessage.html", 20, TTB_MESSAGE_RIGHT + TTB_MESSAGE_TOP, TTB_MESSAGE_BIG, FALSE );
		return TRUE;
	end
	
	-- ab hier block fuer ansagen
	
	if (event == "cabcamera") then
		SysCall ( "CameraManager:ActivateCamera", "CabCamera", 0 );
	end	
	
	if event == "Ans1" then
	SysCall ( "ScenarioManager:PlayDialogueSound", "Ans1.wav");
	end	
	
	if event == "Ans2" then
	SysCall ( "ScenarioManager:PlayDialogueSound", "Ans2.wav");
	end	
	
	if event == "Ans3" then
	SysCall ( "ScenarioManager:PlayDialogueSound", "Ans3.wav");
	end	
	
	if event == "Ans4" then
	SysCall ( "ScenarioManager:PlayDialogueSound", "Ans4.wav");
	end	
	
	if event == "Ans5" then
	SysCall ( "ScenarioManager:PlayDialogueSound", "Ans5.wav");
	end	
	
	if event == "Ans6" then
	SysCall ( "ScenarioManager:PlayDialogueSound", "Ans6.wav");
	end	
	
	if event == "Ans7" then
	SysCall ( "ScenarioManager:PlayDialogueSound", "Ans7.wav");
	end	
	
	if event == "Ans8" then
	SysCall ( "ScenarioManager:PlayDialogueSound", "Ans8.wav");
	end	
	
	if event == "Ans9" then
	SysCall ( "ScenarioManager:PlayDialogueSound", "Ans9.wav");
	end	
	
	if event == "Ans10" then
	SysCall ( "ScenarioManager:PlayDialogueSound", "Ans10.wav");
	end	
	
	if event == "Ans11" then
	SysCall ( "ScenarioManager:PlayDialogueSound", "Ans11.wav");
	end	
	
	if event == "TextGross02" then 
		SysCall ( "ScenarioManager:ShowInfoMessageExt", "af7a2b92-ad57-4bdc-88be-eef5f7459b6a", "TextGross02.html", 20, TTB_MESSAGE_RIGHT + TTB_MESSAGE_TOP, TTB_MESSAGE_BIG, FALSE );
		return TRUE;
	end
	
end	