PromptHeading = ID_TUTORIAL_3_OFFSET + 1
g_currentprompt = 0;
g_counter = 0;
Tweaks.numyearsin24hours = 0;

-------------------------------------------------------------------------------------------------
-- INITIALISE_Level. Standard level event
-------------------------------------------------------------------------------------------------
function EVENTINITIALISE_Level()
	-- load the building and business file
	C_RunScript("scripts\\maps\\tempmap.lua");
	C_RunScript("scripts\\tutorial1\\initialpref.lua");
end;

-------------------------------------------------------------------------------------------------
-- Level. Standard level event.
-------------------------------------------------------------------------------------------------
function EVENT_Level()
	-- create an initial prompt
	C_TriggerEvent("BlockCam", 1, PACIFIC_AVENUE);
	-- Game.Unpause();
	Interface.DisableAllControls();
	Interface.DisableAll3DPicking();
	Interface.DisableCameraControl();
	-- create the initial prompt
	CreatePrompt(1);
end;

function CATCHEVENT_InterfacePromptDismiss(a)
	CreatePrompt(a);
end;

function CATCHEVENT_TutorialEvent(a)

	if g_currentprompt == 15 then
		Interface.DismissPrompt();
		Interface.DisableAll3DPicking();
	end;

	if g_currentprompt == 14 then
		Interface.DismissPrompt();
		Interface.DisableControl(TUT_AERIAL_BUTTON_4);
	end;

	if g_currentprompt == 13 then
		Interface.DismissPrompt();
		Interface.DisableControl(TUT_AERIAL_INFOBUTTON_3);
	end;

	if a ~= TUT_AERIAL_INFOBUTTON_2 then
	if g_currentprompt == 12 then
		Interface.DismissPrompt();
--		Interface.DisableControl(TUT_AERIAL_BUSINESS_LOCATOR);
		Interface.DisableControl(TUT_AERIAL_INFOBUTTON_2);
	end;
	end;

	if g_currentprompt == 11 then
	   Interface.DismissPrompt();
		Interface.DisableControl(TUT_MPP_INFOBUTTON_2);
	end;

	if g_currentprompt == 10 then
	   Interface.DismissPrompt();
		Interface.DisableControl(TUT_TOGGLE_VIEW);
	end;

	if a == TUT_HYPERLINK then
	  if g_currentprompt == 9 then
		  Interface.DismissPrompt();
		  Interface.DisableControl(TUT_AERIAL_LOCATOR_LISTMYBUSINESS);
		end;
	end;

	if g_currentprompt == 8 then
	   Interface.DismissPrompt();
		Interface.DisableControl(TUT_MPP_GREENBUTTON_3);
	end;

	if a ~= TUT_AERIAL_INFOBUTTON_1 and
	   a ~= TUT_AERIAL_INFOBUTTON_2 and
		a ~= TUT_AERIAL_INFOBUTTON_3 and
		a ~= TUT_AERIAL_INFOBUTTON_4 and
		a ~= TUT_AERIAL_INFOBUTTON_5 and
		a ~= TUT_AERIAL_INFOBUTTON_6 then
		if g_currentprompt == 7 then
			Interface.DismissPrompt();
			Interface.DisableControl(TUT_AERIAL_INFOBUTTON_1);
			Interface.DisableControl(TUT_AERIAL_INFOBUTTON_2);
			Interface.DisableControl(TUT_AERIAL_INFOBUTTON_3);
			Interface.DisableControl(TUT_AERIAL_INFOBUTTON_4);
			Interface.DisableControl(TUT_AERIAL_INFOBUTTON_5);
			Interface.DisableControl(TUT_AERIAL_INFOBUTTON_6);
		end;
	end;

	if g_currentprompt == 6 then
		Interface.DismissPrompt();
		Interface.DisableControl(TUT_AERIAL_BUTTON_2);
	end;

	if a ~= TUT_AERIAL_INFOBUTTON_1 and
	   a ~= TUT_AERIAL_INFOBUTTON_2 and
		a ~= TUT_AERIAL_INFOBUTTON_3 and
		a ~= TUT_AERIAL_INFOBUTTON_4 then
		if g_currentprompt == 5 then
				Interface.DismissPrompt();
				Interface.DisableControl(TUT_AERIAL_INFOBUTTON_1);
				Interface.DisableControl(TUT_AERIAL_INFOBUTTON_2);
				Interface.DisableControl(TUT_AERIAL_INFOBUTTON_3);
				Interface.DisableControl(TUT_AERIAL_INFOBUTTON_4);
			end;
	end;

	if g_currentprompt == 1 then
		Interface.DismissPrompt();
		Interface.DisableControl(TUT_TOGGLE_VIEW);
	end;

end;

function CATCHEVENT_Picked3D(a)

	if a == 0 and g_currentprompt == 15 then
		Interface.DismissPrompt();
		Interface.DisableAll3DPicking();
	end;

end;

-- prompt manager
function CreatePrompt(a)
	g_currentprompt = a;
	body = PromptHeading + a;
	if a == 1 then
		Interface.CreateMessage(PromptHeading,body, a+1); --"Let's look in detail at the Strategic View. To do this, click on the 'Compass Button'.", a+1);
		Interface.EnableControl(TUT_TOGGLE_VIEW);
		Interface.AddArrow( 534, 460 );
	elseif a == 2 then
		Interface.CreatePrompt(PromptHeading,body, a+1); --"In the Strategic View you can see the whole city. There is a lot of information to be gleaned from this view.", a+1);
		Interface.DisableAllControls();
		Interface.EnableControl(TUT_PROMPT_1);
		Interface.PositionPrompt(0,150);
	elseif a == 3 then
		Interface.CreatePrompt(PromptHeading,body, a+1); --"First, notice the dots moving around the blocks? They are people. By tracking these you can easily see which areas of the city are busy. ", a+1);
	elseif a == 4 then
		Interface.CreatePrompt(PromptHeading,body, a+1); --"The default mode for this panel is 'City Info'. Here you can see a breakdown of the current population of Monopoly City.", a+1);
		Interface.AddArrow( 107, 154 );
	elseif a == 5 then
		Interface.CreatePrompt(PromptHeading,body, a+1); --"These green buttons give you access to other pieces of information; Block Prestige, Building Rights and Block Ownership. Click on them to have a look. ", a+1);
		Interface.AddArrow( 83, 50 );
		Interface.EnableControl(TUT_AERIAL_INFOBUTTON_1);
		Interface.EnableControl(TUT_AERIAL_INFOBUTTON_2);
		Interface.EnableControl(TUT_AERIAL_INFOBUTTON_3);
		Interface.EnableControl(TUT_AERIAL_INFOBUTTON_4);
	elseif a == 6 then
		Interface.CreateMessage(PromptHeading,body, a+1); --"Click on the Player Information button. ", a+1);
		Interface.DisableControl(TUT_AERIAL_INFOBUTTON_1);
		Interface.DisableControl(TUT_AERIAL_INFOBUTTON_2);
		Interface.DisableControl(TUT_AERIAL_INFOBUTTON_3);
		Interface.DisableControl(TUT_AERIAL_INFOBUTTON_4);
		Interface.EnableControl(TUT_AERIAL_BUTTON_2);
		Interface.AddArrow( 30, 92);
	elseif a == 7 then
		Interface.CreatePrompt(PromptHeading,body, a+1); --"The panel now displays your top line Financial Information. You can see the other player's finances by clicking on the tokens here. Try it now.", a+1);
		Interface.AddArrow( 81, 51);
		Interface.EnableControl(TUT_AERIAL_INFOBUTTON_1);
		Interface.EnableControl(TUT_AERIAL_INFOBUTTON_2);
		Interface.EnableControl(TUT_AERIAL_INFOBUTTON_3);
		Interface.EnableControl(TUT_AERIAL_INFOBUTTON_4);
		Interface.EnableControl(TUT_AERIAL_INFOBUTTON_5);
		Interface.EnableControl(TUT_AERIAL_INFOBUTTON_6);
	elseif a == 8 then
		Interface.CreateMessage(PromptHeading,body, a+1); --"Good. Now let's look the locator. Click the button...", a+1);
		Interface.EnableControl(TUT_AERIAL_BUTTON_3);
		Interface.DisableControl(TUT_AERIAL_INFOBUTTON_1);
		Interface.DisableControl(TUT_AERIAL_INFOBUTTON_2);
		Interface.DisableControl(TUT_AERIAL_INFOBUTTON_3);
		Interface.DisableControl(TUT_AERIAL_INFOBUTTON_4);
		Interface.AddArrow( 30, 115);
	elseif a == 9 then
		Interface.CreateMessage(PromptHeading,body, a+1); --"All of your businesses are listed here. If you click on one it will be selected and the camera will take you to it. Try it now. ", a+1);
		Interface.AddArrow( 98, 120 );
		Interface.DisableAllControls();
		Interface.EnableControlAndChildren(TUT_AERIAL_LOCATOR_LISTMYBUSINESS);
		Interface.EnableControl(TUT_PROMPT_1);
		Interface.DisableControl(TUT_AERIAL_INFOBUTTON_2);
		Interface.DisableControl(TUT_AERIAL_INFOBUTTON_3);
	elseif a == 10 then
		Interface.CreateMessage(PromptHeading,body, a+1); --"Cool. Let's go back to the Strategic view. Click the Compass Button.", a+1);
		Interface.EnableControl(TUT_TOGGLE_VIEW);
		Interface.AddArrow( 534, 460);
	elseif a == 11 then
		Interface.CreateMessage(PromptHeading,body, a+1); --"You can also locate certain business types. Click the Business Locator button. ", a+1);
		Interface.DisableAllControls();
		Interface.EnableControl(TUT_PROMPT_1);
		Interface.DisableControl(TUT_AERIAL_INFOBUTTON_1);
		Interface.EnableControl(TUT_AERIAL_INFOBUTTON_2);
		Interface.DisableControl(TUT_AERIAL_INFOBUTTON_3);
		Interface.AddArrow( 70, 52);
	elseif a == 12 then
		Interface.CreatePrompt(PromptHeading,body, a+1); --"Choose the business type that you want to see and click on it. All instances of the selected business type are show by a hi-light.", a+1);
		Interface.EnableControl(TUT_AERIAL_BUSINESS_LOCATOR);
		Interface.DisableControl(TUT_AERIAL_INFOBUTTON_2);
		Interface.AddArrow( 107, 154);
	elseif a == 13 then
		Interface.CreateMessage(PromptHeading,body, a+1); --"You can also locate where certain commodities are stocked using the Commodity Locator in the same way.", a+1);
		Interface.EnableControl(TUT_AERIAL_INFOBUTTON_3);
		Interface.DisableControl(TUT_AERIAL_INFOBUTTON_1);
		Interface.DisableControl(TUT_AERIAL_INFOBUTTON_2);
		Interface.AddArrow( 107, 52);
	elseif a == 14 then
		Interface.CreateMessage(PromptHeading,body, a+1); --"Finally, you can poll the citizens to find out what commodities they need. Select the Commission Poll button. ", a+1);
		Interface.EnableControl(TUT_AERIAL_BUTTON_4);
		Interface.AddArrow( 30, 145);
	elseif a == 15 then
		Interface.CreateMessage(PromptHeading,body, a+1); --"You will want to poll blocks where citizens are housed, as this is a door-to-door survey. Apartments are hi-lighted to make it easier to see housing locations. Select Illinois Avenue.", a+1);
		Interface.PositionPrompt(0, 150 );
		Interface.AddArrow( 323, 153 );
		Interface.EnableBlockPicking(ILLINOIS_AVENUE);
	elseif a == 16 then
		Interface.CreatePrompt(PromptHeading,body, a+1); --"You can use this data to help you decide which businesses to develop. You now know all you need to use the Strategic View. ", a+1);
		Interface.AddArrow( 107, 154 );
	elseif a == 17 then
		Game.End(true);
	end;
end;


