// ================
// 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.string0 .. 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("ExtraOptions4", "WINDOW")
{
	// inherit root window's dimensions
	Geometry("PARENTWIDTH", "PARENTHEIGHT");

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

	CreateControl("Instant", "WINDOW")
	{
		Geometry("HCENTRE", "VCENTRE");
		ColorGroup("BLUEGRAY");
		Position(0, 0);
		Size(1250, 625);
		BorderSize(25);
		BevelSize(13);
		TabSize(375, 25);
		Style("RIGHTTAB", "OUTLINE");
		Projector(1);
		Title("Extra Options");
		TitleFont("MEDIUM");


		// G66 Starting Ships Options
		CreateControl("G66StartingShips", "STATIC")
		{
			Geometry("LEFT", "TOP");
			Position(88, 25);
			Size(388, 23);
			Font("SMALL");
			Text("Starting Ships");
			JustifyText("right");
			Style("OUTLINE");
		}

		// AllowedVehicle Toggle 
		CreateControl("StartingUnitsStaticLight", "STATIC")
		{
			Geometry("LEFT", "TOP");
			Position(0, 100);
			Size(175, 23);
			Font("SMALL");
			Text("Light:");
			JustifyText("right");
		Style("TRANSPARENT");
		}

		CreateControl("LISDF", "BUTTON")
		{
			ColorGroup("BLUEGRAY");
			Geometry("LEFT", "TOP");
			Position(188, 100); // (145, 40)
			Size(125, 23);
			BorderSize(8);
			BevelSize(8);
			Style("ROLLOVER", "RADIO", "OUTLINE");
			Cursor("Highlight");
			Font("TINY");
			Text("ISDF");
			UseVar("options.instant.int24");
			Value(1);
			NotifyParent("Button::Select", "LISDF");   
			   	
		}

		OnEvent("LISDF")
		{
			Cmd("options.instant.string4 MPVehicles66il.odf"); 
//			UseVar("G66.mpvehicle.button");
			Cmd("options.instant.int25 262143");
			Cmd("options.instant.int24 1");
		}

		CreateControl("LSCION", "BUTTON")
		{
			ColorGroup("BLUEGRAY");
			Geometry("LEFT", "TOP");
			Position(338, 100); // (145, 40)
			Size(125, 23);
			BorderSize(8);
			BevelSize(8);
			Style("ROLLOVER", "RADIO", "OUTLINE");
			Cursor("Highlight");
			Font("TINY");
			Text("Scion");
			UseVar("options.instant.int24");
			Value(2);
			NotifyParent("Button::Select", "LSCION");     
		}

		OnEvent("LSCION")
		{
			Cmd("options.instant.string4 MPVehicles66fl.odf"); 
//			Cmd("options.instant.int25 4194303");
			Cmd("options.instant.int25 1048575");
			Cmd("options.instant.int24 2");
		}

		// AllowedVehicle Toggle 
		CreateControl("StartingUnitsStaticHeavy", "STATIC")
		{
			Geometry("LEFT", "TOP");
			Position(0, 150);
			Size(175, 23);
			Font("SMALL");
			Text("Heavy:");
			JustifyText("right");
			Style("TRANSPARENT");
		}

		CreateControl("HISDF", "BUTTON")
		{
			ColorGroup("BLUEGRAY");
			Geometry("LEFT", "TOP");
			Position(188, 150); // (145, 60)
			Size(125, 23);
			BorderSize(8);
			BevelSize(8);
			Style("ROLLOVER", "RADIO", "OUTLINE");
			Cursor("Highlight");
			Font("TINY");
			Text("ISDF");
			UseVar("options.instant.int24");
			Value(4);
			NotifyParent("Button::Select", "HISDF"); 
		}

		OnEvent("HISDF")
		{
			Cmd("options.instant.string4 MPVehicles66ih.odf"); 
			Cmd("options.instant.int25 63");
			Cmd("options.instant.int24 4");
		}

		CreateControl("HSCION", "BUTTON")
		{
			ColorGroup("BLUEGRAY");
			Geometry("LEFT", "TOP");
			Position(338, 150); // (145, 60)
			Size(125, 23);
			BorderSize(8);
			BevelSize(8);
			Style("ROLLOVER", "RADIO", "OUTLINE");
			Cursor("Highlight");
			Font("TINY");
			Text("Scion");
			UseVar("options.instant.int24");
			Value(8);
			NotifyParent("Button::Select", "HSCION");     
		}

		OnEvent("HSCION")
		{
			Cmd("options.instant.string4 MPVehicles66fh.odf"); 
			Cmd("options.instant.int25 15");
			Cmd("options.instant.int24 8");
		}

		// AllowedVehicle Toggle 
		CreateControl("StartingUnitsStaticAdvanced", "STATIC")
		{
			Geometry("LEFT", "TOP");
			Position(0, 200);
			Size(175, 23);
			Font("SMALL");
			Text("Advanced:");
			JustifyText("right");
			Style("TRANSPARENT");
		}
		CreateControl("AISDF", "BUTTON")
		{
			ColorGroup("BLUEGRAY");
			Geometry("LEFT", "TOP");
			Position(188, 200); // (145, 60)
			Size(125, 23);
			BorderSize(8);
			BevelSize(8);
			Style("ROLLOVER", "RADIO", "OUTLINE");
			Cursor("Highlight");
			Font("TINY");
			Text("ISDF");
			UseVar("options.instant.int24");
			Value(16);
			NotifyParent("Button::Select", "AISDF"); 
		}

		OnEvent("AISDF")
		{
			Cmd("options.instant.string4 MPVehicles66ia.odf");
//			Cmd("options.instant.int25 4194303");
			Cmd("options.instant.int25 131071");
			Cmd("options.instant.int24 16");
		}

		CreateControl("ASCION", "BUTTON")
		{
			ColorGroup("BLUEGRAY");
			Geometry("LEFT", "TOP");
			Position(338, 200); // (145, 60)
			Size(125, 23);
			BorderSize(8);
			BevelSize(8);
			Style("ROLLOVER", "RADIO", "OUTLINE");
			Cursor("Highlight");
			Font("TINY");
			Text("Scion");
			UseVar("options.instant.int24");
			Value(32);
			NotifyParent("Button::Select", "ASCION");     
		}

		OnEvent("ASCION")
		{
			Cmd("options.instant.string4 MPVehicles66fa.odf"); 
			Cmd("options.instant.int25 255");
			Cmd("options.instant.int24 32");
		}

		// AllowedVehicle Toggle 
		CreateControl("StartingUnitsStaticInsane", "STATIC")
		{
			Geometry("LEFT", "TOP");
			Position(0, 250);
			Size(175, 23);
			Font("SMALL");
			Text("Insane:");
			JustifyText("right");
			Style("TRANSPARENT");
		}

		CreateControl("IISDF", "BUTTON")
		{
			ColorGroup("BLUEGRAY");
			Geometry("LEFT", "TOP");
			Position(188, 250); // (145, 60)
			Size(125, 23);
			BorderSize(8);
			BevelSize(8);
			Style("ROLLOVER", "RADIO", "OUTLINE");
			Cursor("Highlight");
			Font("TINY");
			Text("ISDF");
			UseVar("options.instant.int24");
			Value(64);
			NotifyParent("Button::Select", "IISDF"); 
		}

		OnEvent("IISDF")
		{
			Cmd("options.instant.string4 MPVehicles66ii.odf"); 
			Cmd("options.instant.int25 511");
			Cmd("options.instant.int24 64");
		}

		CreateControl("ISCION", "BUTTON")
		{
			ColorGroup("BLUEGRAY");
			Geometry("LEFT", "TOP");
			Position(338, 250); // (145, 60)
			Size(125, 23);
			BorderSize(8);
			BevelSize(8);
			Style("ROLLOVER", "RADIO", "OUTLINE");
			Cursor("Highlight");
			Font("TINY");
			Text("Scion");
			UseVar("options.instant.int24");
			Value(128);
			NotifyParent("Button::Select", "ISCION");     
		}

		OnEvent("ISCION")
		{
			Cmd("options.instant.string4 MPVehicles66fi.odf"); 
			Cmd("options.instant.int25 31");
			Cmd("options.instant.int24 128");
		}

		CreateControl("Default13", "BUTTON")
		{
			ColorGroup("BLUEGRAY");
			Geometry("LEFT", "TOP");
			Position(188, 300); // (145, 60)
			Size(275, 23);
			BorderSize(8);
			BevelSize(8);
			Style("ROLLOVER", "RADIO", "OUTLINE");
			Cursor("Highlight");
			Font("TINY");
			Text("Default BzII");
			UseVar("options.instant.int24");
			Value(256);
			NotifyParent("Button::Select", "Default13");     
		}

		OnEvent("Default13")
		{
			Cmd("options.instant.string4 mpvehicles66.odf"); 
			Cmd("options.instant.int25 255");
			//Cmd("options.instant.int25 131327");
			Cmd("options.instant.int24 256");
		}

		CreateControl("Default13c", "BUTTON")
		{
			ColorGroup("BLUEGRAY");
			Geometry("LEFT", "TOP");
			Position(188, 350); // (145, 60)
			Size(275, 23);
			BorderSize(8);
			BevelSize(8);
			Style("ROLLOVER", "RADIO", "OUTLINE");
			Cursor("Highlight");
			Font("TINY");
			Text("Default BzII + Interceptor");
			UseVar("options.instant.int24");
			Value(512);
			NotifyParent("Button::Select", "Default13c");     
		}

		OnEvent("Default13c")
		{
			Cmd("options.instant.string4 mpvehicles66.odf"); 
			//Cmd("options.instant.int25 255");
			Cmd("options.instant.int25 131327");
			Cmd("options.instant.int24 512");
		}


		CreateControl("Default", "BUTTON")
		{
			ColorGroup("BLUEGRAY");
			Geometry("LEFT", "TOP");
			Position(188, 400); // (145, 60)
			Size(275, 23);
			BorderSize(8);
			BevelSize(8);
			Style("ROLLOVER", "RADIO", "OUTLINE");
			Cursor("Highlight");
			Font("TINY");
			Text("Default G66");
			UseVar("options.instant.int24");
			Value(1024);
			NotifyParent("Button::Select", "Default"); 
		}

		OnEvent("Default")
		{
			Cmd("options.instant.string4 MPVehicles66.odf"); 
			Cmd("options.instant.int25 1023");
			Cmd("options.instant.int24 1024");
		}		

		CreateControl("Scouts", "BUTTON")
		{
			ColorGroup("BLUEGRAY");
			Geometry("LEFT", "TOP");
			Position(188, 450); // (145, 60)
			Size(275, 23);
			BorderSize(8);
			BevelSize(8);
			Style("ROLLOVER", "RADIO", "OUTLINE");
			Cursor("Highlight");
			Font("TINY");
			Text("Default Scouts");
			UseVar("options.instant.int24");
			Value(2048);
			NotifyParent("Button::Select", "Scouts");     
		}

		OnEvent("Scouts")
		{
			Cmd("options.instant.string4 MPVehicles66so.odf"); 
			Cmd("options.instant.int25 3");
			Cmd("options.instant.int24 2048");
		}

		CreateControl("Pilots", "BUTTON")
		{
			ColorGroup("BLUEGRAY");
			Geometry("LEFT", "TOP");
			Position(188, 500); // (145, 60)
			Size(275, 23);
			BorderSize(8);
			BevelSize(8);
			Style("ROLLOVER", "RADIO", "OUTLINE");
			Cursor("Highlight");
			Font("TINY");
			Text("Pilots Only");
			UseVar("options.instant.int24");
			Value(4096);
			NotifyParent("Button::Select", "Pilots");     
		}

		OnEvent("Pilots")
		{
			Cmd("options.instant.string4 MPVehicles66ap.odf"); 
			Cmd("options.instant.int25 15");
			Cmd("options.instant.int24 4096");
		}

	
	CreateControl("StartingForce", "STATIC")
	{
		Geometry("LEFT", "TOP");
		Position(538, 25);
		Size(288, 23);
		Font("SMALL");
		Text("Starting Force:");
		JustifyText("right");
//		Style("TRANSPARENT");
	}

	CreateControl("StartForce0", "BUTTON")
	{
		ColorGroup("BLUEGRAY");
		Geometry("LEFT", "TOP");
		Position(850, 25);
		Size(75, 23);
		BorderSize(8);
		BevelSize(8);
		Style("ROLLOVER", "RADIO", "OUTLINE");
//		Style("ROLLOVER", "OUTLINE");
		Cursor("Highlight");
		Font("TINY");
		Text("None");
		UseVar("options.instant.int26");
		Value(0);
		NotifyParent("Button::Select", "SetStartForce0");
	}

	CreateControl("StartForce1", "BUTTON")
	{
		ColorGroup("BLUEGRAY");
		Geometry("LEFT", "TOP");
		Position(950, 25);
		Size(75, 23);
		BorderSize(8);
		BevelSize(8);
		Style("ROLLOVER", "RADIO", "OUTLINE");
//		Style("ROLLOVER", "OUTLINE");
		Cursor("Highlight");
		Font("TINY");
		Text("Small");
		UseVar("options.instant.int26");
		Value(1);
		NotifyParent("Button::Select", "SetStartForce1");
	}

	CreateControl("StartForce2", "BUTTON")
	{
		ColorGroup("BLUEGRAY");
		Geometry("LEFT", "TOP");
		Position(1050, 25);
		Size(75, 23);
		BorderSize(8);
		BevelSize(8);
		Style("ROLLOVER", "RADIO", "OUTLINE");
//		Style("ROLLOVER", "OUTLINE");
		Cursor("Highlight");
		Font("TINY");
		Text("Large");
		UseVar("options.instant.int26");
		Value(2);
		NotifyParent("Button::Select", "SetStartForce2");
	}

	CreateControl("StartForce3", "BUTTON")
	{
		ColorGroup("BLUEGRAY");
		Geometry("LEFT", "TOP");
		Position(1150, 25);
		Size(75, 23);
		BorderSize(8);
		BevelSize(8);
		Style("ROLLOVER", "RADIO", "OUTLINE");
//		Style("ROLLOVER", "OUTLINE");
		Cursor("Highlight");
		Font("TINY");
		Text("Huge");
		UseVar("options.instant.int26");
		Value(4);
		NotifyParent("Button::Select", "SetStartForce3");
	}
	
	CreateControl("VehicleListWindow", "WINDOW")
	{
		ColorGroup("BLUEGRAY");
		Geometry("LEFT", "TOP");
		Position(563, 138);
		Size(650, 398);
		Style("INERT"); //  "TRANSPARENT"
		BorderSize(25);
		BevelSize(13);
		TabSize(350, 25);
		Title("Starting Forces");
		TitleFont("SMALL");
		Style("RIGHTTAB", "OUTLINE");	
	}
	
	CreateControl("VehicleList", "CHECKLIST")
	{
		Geom("LEFT", "TOP");
		ColorGroup("LISTBOX");
		Position(563, 138);
		Size(650, 398);
		CellSize(625, 25);
		BorderSize(13);
		BevelSize(8);
		Font("SMALL");
		Style(, "VSLIDER");
		UseVar("options.instant.string6");
//		UseVar("options.instant.string3");
//			NotifyParent("LISTBOX::DblClick", "Launch");
//			UseVar("shell.instant.name");
//			NotifyParent("LISTBOX::SelChange", "FillData");
		// Contents filled in from code now (MPVehicle.cpp thru NetCommands)
	}

	OnEvent("SetStartForce0")
	{
		Cmd("options.instant.int7 0");
		Cmd("options.instant.int26 0");
	}

	OnEvent("SetStartForce1")
	{
		Cmd("options.instant.int7 3");
		Cmd("options.instant.int26 1");
	}

	OnEvent("SetStartForce2")
	{
		Cmd("options.instant.int7 3355443");
		Cmd("options.instant.int26 2");
	}

	OnEvent("SetStartForce3")
	{
		Cmd("options.instant.int7 -1");
		Cmd("options.instant.int26 4");
	}


		CreateControl("ExtraOptions", "BUTTON")
		{
			ColorGroup("BLUEGRAY");

			Geometry("Left", "Bottom");
			Position(0, 0);
			Size(325, 25);
			BorderSize(13);
			BevelSize(8);
			Style("ROLLOVER", "OUTLINE");
			Font("SMALL");
			Text("<- Map Options");
			Cursor("Highlight");
			NotifyParent("Button::Press", "CloseExtras");
		}

		//
		// handle the "CloseExtras" event
		//
		OnEvent("CloseExtras")
		{
			cmd("shell.instant.closeextras");
		}
		CreateControl("PagesLabel", "STATIC")
		{
			Geometry("LEFT", "BOTTOM");
			Position(975, 0);
			Size(75, 23);
			Font("TINY");
			Text("Page:");
			JustifyText("left");
			Style("TRANSPARENT");
		}

		CreateControl("OpenExtraOptions1", "BUTTON")
		{
			ColorGroup("BLUEGRAY");
			Geometry("BOTTOM", "LEFT");
			Position(1063, 0);
			Size(25, 23);
			BorderSize(8);
			BevelSize(8);
			Style("ROLLOVER", "OUTLINE");
			Cursor("Highlight");
			Font("SMALL");
			Text("1");
			NotifyParent("Button::Press", "OpenExtraOptions1");
		}

		OnEvent("OpenExtraOptions1")
		{
			FadeOut("|ExtraOptions4");
			FadeIn("|ExtraOptions");
			Cmd("options.instant.int23 1"); 
		}

		CreateControl("OpenExtraOptions2", "BUTTON")
		{
			ColorGroup("BLUEGRAY");
			Geometry("BOTTOM", "LEFT");
			Position(1113, 0);
			Size(25, 23);
			BorderSize(8);
			BevelSize(8);
			Style("ROLLOVER", "OUTLINE");
			Cursor("Highlight");
			Font("SMALL");
			Text("2");
			NotifyParent("Button::Press", "OpenExtraOptions2");
		}
	
		OnEvent("OpenExtraOptions2")
		{
			FadeOut("|ExtraOptions4");
			FadeIn("|ExtraOptions2");
			Cmd("options.instant.int23 2"); 
		}

		CreateControl("OpenExtraOptions3", "BUTTON")
		{
			ColorGroup("BLUEGRAY");
			Geometry("BOTTOM", "LEFT");
			Position(1163, 0);
			Size(25, 23);
			BorderSize(8);
			BevelSize(8);
			Style("ROLLOVER", "OUTLINE");
			Cursor("Highlight");
			Font("SMALL");
			Text("3");
			NotifyParent("Button::Press", "OpenExtraOptions3");			
		}
	
		OnEvent("OpenExtraOptions3")
		{
			FadeOut("|ExtraOptions4");
			FadeIn("|ExtraOptions3");
			Cmd("options.instant.int23 4"); 
		}

		CreateControl("OpenExtraOptions4", "BUTTON")
		{
			ColorGroup("BLUEGRAY");
			Geometry("BOTTOM", "LEFT");
			Position(1213, 0);
			Size(25, 23);
			BorderSize(8);
			BevelSize(8);
			Style("INERT", "OUTLINE");
			Cursor("Highlight");
			Font("SMALL");
			Text("4");
			UseVar("options.instant.int23");
			Value(8);
		}
	
		// CreateControl("OpenExtraOptions5", "BUTTON")
		// {
			// ColorGroup("BLUEGRAY");
			// Geometry("BOTTOM", "LEFT");
			// Position(470, 0);
			// Size(10, 9);
			// BorderSize(3);
			// BevelSize(3);
			// Style("ROLLOVER", "OUTLINE");
			// Cursor("Highlight");
			// Font("SMALL");
			// Text("5");
			// NotifyParent("Button::Press", "OpenExtraOptions5");			
		// }
	
		// OnEvent("OpenExtraOptions5")
		// {
			// FadeOut("|ExtraOptions4");
			// FadeIn("|ExtraOptions5");
			// Cmd("options.instant.int23 16"); 
		// }

	// CreateControl("OpenExtraOptions6", "BUTTON")
		// {
			// ColorGroup("BLUEGRAY");
			// Geometry("BOTTOM", "LEFT");
			// Position(490, 0);
			// Size(10, 9);
			// BorderSize(3);
			// BevelSize(3);
			// Style("ROLLOVER", "OUTLINE");
			// Cursor("Highlight");
			// Font("SMALL");
			// Text("6");
			// NotifyParent("Button::Press", "OpenExtraOptions6");			
		// }
	  
		// OnEvent("OpenExtraOptions6")
		// {
			// FadeOut("|ExtraOptions4");
			// FadeIn("|ExtraOptions6");
			// Cmd("options.instant.int23 32"); 
		// }

	} // end of Instant window



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

		Geometry("RIGHT", "TOP");
		Position(-50, 50);
		Size(238, 0);
		BorderSize(25);
		BevelSize(13);
		Text("Launch");
		Font("MEDIUM");
		Style("ROLLOVER", "OUTLINE");
		Projector(4);
		Cursor("Highlight");
		NotifyParent("Button::Press", "Launch");
	}

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

		Geometry("LEFT", "TOP");
		Position(50, 50);
		Size(238, 0);
		BorderSize(25);
		BevelSize(13);
		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");
	}


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