// ================
// BATTLEZONE SHELL
// ================

//
// CREATE SHELL INSTANT ACTION Extra Options page. 
//
// Tip: store variables in any of the following:
//
// options.instant.bool0 .. options.instant.bool31
// options.instant.int0 .. options.instant.int31
// options.instant.float0 .. options.instant.float31
// options.instant.string .. options.instant.string31
//
// Multi-page ExtraOptions are possible. Name them ExtraOptions,
// ExtraOptions2 .. ExtraOptions8, and they'll all be closed (no
// matter which is open) when the shell.instant.closeextras command is
// sent.
//
CreateControl("ExtraOptions", "WINDOW")
{
	// inherit root window's dimensions
	Geometry("PARENTWIDTH", "PARENTHEIGHT");

	// set window style
	Style("TRANSPARENT", "INERT");

	CreateControl("Instant", "WINDOW")
	{
		Geometry("HCENTRE", "VCENTRE");
		ColorGroup("MAGENTA");
		Position(0, 0);
		Size(1500, 750);
		BorderSize(30);
		BevelSize(15);
		TabSize(450, 30);
		Style("RIGHTTAB", "OUTLINE");
		Projector(1);
		Title("Extra Options");
		TitleFont("MEDIUM");

		// AIPListWindow can be located on
		// ExtraOptions.Instant.AIPListWindow.AIPList , or
		// ExtraOptions2.Instant.AIPListWindow.AIPList thru
		//   ExtraOptions4.Instant.AIPListWindow.AIPList
		CreateControl("AIPListWindow", "WINDOW")
		{
			ColorGroup("MAGENTA");
			Position(780, 75); // (5, 25)
			Size(690, 294);
			Style("INERT"); //  "TRANSPARENT"
			Geometry("LEFT", "TOP"); //("Left, "TOP")
			BorderSize(30);
			BevelSize(15);
			TabSize(420, 30);
			Title("AIP set (CPU's plans)");
			TitleFont("SMALL");
			Style("RIGHTTAB", "OUTLINE");

			CreateControl("AIPList", "LISTBOX")
			{
				ColorGroup("LISTBOX");
				Geometry("TOP", "LEFT");
				Position(0, 0);
				Size(690, 300);
				CellSize(660, 30);
				BorderSize(15);
				BevelSize(9);
				Style("VSLIDER");
				Font("TINY");
				Cursor("Highlight");
				UseVar("options.instant.string0");
				// Contents of this list filled in automatically from code [ShellHandler.cpp]
			}
		}

		CreateControl("HumanRecyListWindow", "WINDOW")
		{
			ColorGroup("MAGENTA");
			Position(15, 75);  // (250, 25)
			Size(690, 174);
			Style("INERT"); //  "TRANSPARENT"
			Geometry("LEFT", "TOP");
			BorderSize(30);
			BevelSize(15);
			TabSize(420, 30);
			Title("Human Recycler");
			TitleFont("SMALL");
			Style("RIGHTTAB", "OUTLINE");

			CreateControl("RecyList", "LISTBOX")
			{
				ColorGroup("LISTBOX");
				Geometry("TOP", "LEFT");
				Position(0, 0);
				Size(690, 180);
				CellSize(660, 30);
				BorderSize(15);
				BevelSize(9);
				Style("VSLIDER");
				Font("TINY");
				Cursor("Highlight");
				UseVar("options.instant.string1");
				// Contents of this list filled in automatically from code [NetCommands.cpp]
			}
		}

		CreateControl("CPURecyListWindow", "WINDOW")
		{
			ColorGroup("MAGENTA");
			Position(15, 360); // (250, 120)
			Size(690, 174);
			Style("INERT"); //  "TRANSPARENT"
			Geometry("LEFT", "TOP");
			BorderSize(30);
			BevelSize(15);
			TabSize(420, 30);
			Title("CPU Recycler");
			TitleFont("SMALL");
			Style("RIGHTTAB", "OUTLINE");

			CreateControl("RecyList", "LISTBOX")
			{
				ColorGroup("LISTBOX");
				Geometry("TOP", "LEFT");
				Position(0, 0);
				Size(690, 180);
				CellSize(660, 30);
				BorderSize(15);
				BevelSize(9);
				Style("VSLIDER");
				Font("TINY");
				Cursor("Highlight");
				UseVar("options.instant.string2");
				// Contents of this list filled in automatically from code [NetCommands.cpp]
			}
		}


		CreateControl("PlayerRespawn", "STATIC")
			{
				Geometry("LEFT", "TOP");
				Position(780, 459);
				Size(450, 30);
				Style("TRANSPARENT");
				Font("MEDIUM");
				JustifyText("LEFT");
				Text("Player Respawn:");
			}

		CreateControl("RespawnOff", "BUTTON")
			{
				ColorGroup("LISTBOX");

				Geometry("LEFT", "TOP");
				Position(780, 519); // (260, 160)
				Size(195, 30);
				BorderSize(15);
				BevelSize(9);
				Style("ROLLOVER", "RADIO", "OUTLINE");
				Font("SMALL");
				Text("Off");
				Cursor("Highlight");
				UseVar("options.instant.bool0");
				Value(0); 
			}

			CreateControl("RespawnOn", "BUTTON")
			{
				ColorGroup("LISTBOX");

				Geometry("LEFT", "TOP");
				Position(1020, 519);
				Size(195, 30);
				BorderSize(15);
				BevelSize(9);
				Style("ROLLOVER", "RADIO", "OUTLINE");
				Font("SMALL");
				Text("On");
				Cursor("Highlight");
				UseVar("options.instant.bool0");
				Value(1); 
			}
		

		CreateControl("CloseExtraOptions", "BUTTON")
		{
			ColorGroup("BlackBlue");

			Geometry("Left", "Bottom");
			Position(0, 0);
			Size(390, 30);
			BorderSize(15);
			BevelSize(9);
			Style("ROLLOVER", "OUTLINE");
			Font("SMALL");
			Text("<- Map Options");
			Cursor("Highlight");
			NotifyParent("Button::Press", "CloseExtras");
		}

		//
		// handle the "launch" event
		//
		OnEvent("CloseExtras")
		{
			cmd("shell.instant.closeextras");
		}

	} // end of Instant window



	//
	// create the "launch" button
	//
	CreateControl("Launch", "BUTTON")
	{
		ColorGroup("MAGENTA");

		Geometry("RIGHT", "TOP");
		Position(-60, 60);
		Size(285, 0);
		BorderSize(30);
		BevelSize(15);
		Text("Launch");
		Font("MEDIUM");
		Style("ROLLOVER", "OUTLINE");
		Projector(4);
		Cursor("Highlight");
		NotifyParent("Button::Press", "Launch");
	}

	//
	// create the "Back" button
	//
	CreateControl("Back", "BUTTON")
	{
		ColorGroup("MAGENTA");

		Geometry("LEFT", "TOP");
		Position(60, 60);
		Size(285, 0);
		BorderSize(30);
		BevelSize(15);
		Text("Main");
		Font("MEDIUM");
		Style("ROLLOVER", "OUTLINE");
		Projector(4);
		Cursor("Highlight");
		NotifyParent("Button::Press", "Back");
	}

	//
	// handle activation
	//
	//OnEvent("Control::StartFadeIn")
	//{
		//Cmd("shell.instant.load");
	//}

	//
	// handle the "launch" event
	//
	OnEvent("Launch")
	{
		cmd("shell.stopSound mire22_4.wav");
		Cmd("shell.instant.launch");
	}

	//
	// handle the back event
	//
	OnEvent("Back")
	{
		cmd("shell.instant.closeextras_2main");
		cmd("shell.stopSound mire22_4.wav");
		FadeOut("|ShellInstant");
		FadeIn("|ShellMain");
	}

	OnEvent("Control::Activate")
	{
		cmd("shell.backgroundSound mire22_4.wav");
		cmd("shell.background instant.tga");
		Cmd("shell.instant.load");
	}
}
