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

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

end;

-------------------------------------------------------------------------------------------------
-- Level. Standard level event.
-------------------------------------------------------------------------------------------------
function EVENT_Level()
	-- create an initial prompt
	C_TriggerEvent("BlockCam", 1, PACIFIC_AVENUE);

	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 a == TUT_GAME_AUCTION_STARTTIMER and g_currentprompt == 17 then
		Interface.DismissPrompt();
		Interface.DisableControl(TUT_MPP_BLOCK_BUYBLOCK);
		Game.Pause();
	end;

	if g_currentprompt == 16 then
		Interface.DismissPrompt();
		Interface.DisableControl(TUT_MPP_GREENBUTTON_2);
	end;


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

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

	if g_currentprompt == 9 then
		Interface.DismissPrompt();
		Interface.DisableControl(TUT_MPP_BLOCK_LEFT_TOGGLE);
		Interface.DisableControl(TUT_MPP_BLOCK_RIGHT_TOGGLE);
	end;

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

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

	if g_currentprompt == 5 then
		Interface.DismissPrompt();
		Interface.DisableControl(TUT_MPP_BLOCK_LEFT_TOGGLE);
		Interface.DisableControl(TUT_MPP_BLOCK_RIGHT_TOGGLE);
		Interface.DisableControl(TUT_MPP_GREENBUTTON_6);
	end;

	if g_currentprompt == 4 then
		Interface.DismissPrompt();
		Interface.DisableControl(TUT_MPP_BLOCK_LANDRENT);
	end;

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

end;

-- prompt manager
function CreatePrompt(a)
	g_currentprompt = a;
	body = a+PromptHeading;
	if a == 1 then
		Interface.CreatePrompt(PromptHeading,body, a+1); --"Let's have a look at what you can do when you have a City Block selected. ", a+1);
	elseif a == 2 then
		Interface.CreatePrompt(PromptHeading,body, a+1); --"The default mode for this panel is Information. Here you can see some very top-line details regarding the block. ", a+1);
		Interface.AddArrow( 46, 55 );
	elseif a == 3 then
		Interface.CreateMessage(PromptHeading,body, a+1); --"You can find out how much Land Rent is paid by each business by clicking on the Land Rent button. Try it now...", a+1);
		Interface.AddArrow( 73, 54 );
		Interface.EnableControl(TUT_MPP_INFOBUTTON_2);
	elseif a == 4 then
		Interface.CreateMessage(PromptHeading,body, a+1); --"All of the businesses are now listed, along with the amount of rent that they pay each day. Move the cursor over one of the stores and click. This will select the business. ", a+1);
		Interface.EnableControlAndChildren(TUT_MPP_BLOCK_LANDRENT);
		Interface.DisableControl(TUT_MPP_BUILDING_LEFT_TOGGLE);
		Interface.DisableControl(TUT_MPP_BUILDING_RIGHT_TOGGLE);
		Interface.AddArrow( 153, 156 );
	elseif a == 5 then
		Interface.CreateMessage(PromptHeading,body, a+1); --"This is a great way to select the business you want. Click on the Go To Block Button to return to Block Mode. ", a+1);
		Interface.EnableControl(TUT_MPP_GREENBUTTON_6);
		Interface.AddArrow( 29, 285 );
	elseif a == 6 then
		Interface.CreateMessage(PromptHeading,body, a+1); --"Now lets have a look at Profit. Click the button.", a+1);
		Interface.DisableAllControls();
		Interface.EnableControl(TUT_PROMPT_1);
		Interface.EnableControl(TUT_MPP_INFOBUTTON_3);
		Interface.AddArrow( 104, 54);
	elseif a == 7 then
		Interface.CreatePrompt(PromptHeading,body, a+1); --"The list of businesses is now accompanied by the amount of profit they are making. You are currently looking at today's numbers.", a+1);
		Interface.DisableAllControls();
		Interface.EnableControl(TUT_PROMPT_1);
		Interface.AddArrow( 153, 156);
	elseif a == 8 then
		Interface.CreateMessage(PromptHeading,body, a+1); --"If it is early in the day, today's information may not be that helpful. If you need to check on yesterday's final numbers click here. ", a+1);
		Interface.DisableAllControls();
		Interface.EnableControl(TUT_PROMPT_1);
		Interface.EnableControl(TUT_MPP_BLOCK_LEFT_TOGGLE);
		Interface.EnableControl(TUT_MPP_BLOCK_RIGHT_TOGGLE);
		Interface.AddArrow( 155, 87 );
	elseif a == 9 then
		Interface.CreateMessage(PromptHeading,body, a+1); --"Great. Now you can check to make sure all of your businesses made money yesterday. Click the button again to get back to today's list. ", a+1);
		Interface.DisableAllControls();
		Interface.EnableControl(TUT_PROMPT_1);
		Interface.EnableControl(TUT_MPP_BLOCK_LEFT_TOGGLE);
		Interface.EnableControl(TUT_MPP_BLOCK_RIGHT_TOGGLE);
	elseif a == 10 then
		Interface.CreateMessage(PromptHeading,body, a+1); --"Okay. Now click on the Efficiency Button.", a+1);
		Interface.DisableAllControls();
		Interface.EnableControl(TUT_PROMPT_1);
		Interface.EnableControl(TUT_MPP_INFOBUTTON_4);
		Interface.AddArrow( 128, 52 );
	elseif a == 11 then
		Interface.CreatePrompt(PromptHeading,body, a+1); --"Efficiency is very useful. The first number tells you how many units you have sold today, the second is how many items the store can hold. As the day progresses you can see sales being made. When the two numbers match it means that the store has sold out. ", a+1);
		Interface.DisableAllControls();
		Interface.EnableControl(TUT_PROMPT_1);
		Interface.AddArrow( 153, 156);
	elseif a == 12 then
		Interface.CreatePrompt(PromptHeading,body, a+1); --"You can view yesterday's sales here as well, which is useful when checking if you have overstocked any of your stores. ", a+1);
		Interface.DisableAllControls();
		Interface.EnableControl(TUT_PROMPT_1);
		Interface.AddArrow(131, 87 );
	elseif a == 13 then
		Interface.CreateMessage(PromptHeading,body, a+1); --"Click on the Buy Out / Sell Value button. ", a+1);
		Interface.DisableAllControls();
		Interface.EnableControl(TUT_PROMPT_1);
		Interface.EnableControl(TUT_MPP_INFOBUTTON_5);
		Interface.AddArrow( 159, 52);
	elseif a == 14 then
		Interface.CreatePrompt(PromptHeading,body, a+1); --"Values quoted beside businesses that you own are how much the city will give you if you were to sell them. ", a+1);
		Interface.DisableAllControls();
		Interface.EnableControl(TUT_PROMPT_1);
		Interface.AddArrow( 153, 93);
	elseif a == 15 then
		Interface.CreatePrompt(PromptHeading,body, a+1); --"The values shown next to other businesses are how much it would cost you to buy them out if you were to become their Landlord. ", a+1);
		Interface.DisableAllControls();
		Interface.EnableControl(TUT_PROMPT_1);
		Interface.AddArrow( 153, 140);
	elseif a == 16 then
		Interface.CreateMessage(PromptHeading,body, a+1); --"Speaking of being a Landlord, let's see how you get to be one. Click on the Lease Block button. ", a+1);
		Interface.DisableAllControls();
		Interface.EnableControl(TUT_PROMPT_1);
		Interface.EnableControl(TUT_MPP_GREENBUTTON_2);
		Interface.AddArrow( 30,  97);
	elseif a == 17 then
		Interface.CreateMessage(PromptHeading,body, a+1); --"There is a minimum offer price, but if you want you can increase this value. When you click the Lease Block button an auction will be triggered. The offer price that you set will be the opening bid. Click Lease Block now. ", a+1);
		Interface.EnableControl(TUT_MPP_BLOCK_BUYBLOCK);
		Interface.AddArrow( 140, 131);
	elseif a == 18 then
		Interface.CreatePrompt(PromptHeading,body, a+1); --"The auction has now been registered and will take place when the timer reaches zero. If the auction timer is running no one else is able to put in an offer for a block until after the auction. We will look at auctions in more detail in another tutorial. ", a+1);
		Interface.AddArrow( 619, 104);
	elseif a == 19 then
		Interface.CreatePrompt(PromptHeading,body, a+1); --"Finally, there's the Build button. We have a special tutorial dedicated to this one. ", a+1);
		Interface.AddArrow( 27, 118 );
	elseif a == 20 then
		Game.End(true);
	end;
end;


