// ================
// 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("ExtraOptions", "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(1500, 750);
		BorderSize(30);
		BevelSize(15);
		TabSize(450, 30);
		Style("RIGHTTAB", "OUTLINE");
		Projector(1);
		Title("G66 3.1 Options");
		TitleFont("MEDIUM");

		CreateControl("HumanRecyListWindow", "WINDOW")
		{
			ColorGroup("BLUEGRAY");
			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("BLUEGRAY");
				Geometry("TOP", "LEFT");
				Position(0, 0);
				Size(690, 165);
				CellSize(660, 33);
				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("BLUEGRAY");
			Position(15, 360); // (250, 120)
			Size(690, 174);
			Style("INERT"); //  "TRANSPARENT"
			Geometry("LEFT", "TOP");
			BorderSize(30);
			BevelSize(15);
			TabSize(420, 30);
			Title("Enemy Recycler");
			TitleFont("SMALL");
			Style("RIGHTTAB", "OUTLINE");

			CreateControl("RecyList", "LISTBOX")
			{
				ColorGroup("BLUEGRAY");
				Geometry("TOP", "LEFT");
				Position(0, 0);
				Size(690, 165);
				CellSize(660, 33);
				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]
			}
		}

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

			CreateControl("AIPList", "LISTBOX")
			{
				ColorGroup("BLUEGRAY");
				Geometry("TOP", "LEFT");
				Position(0, 0);
				Size(690, 165);
				CellSize(660, 33);
				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("AIPDescButton", "BUTTON")
		{
			ColorGroup("BLUEGRAY");
			Geometry("LEFT", "TOP");
			JustifyText("CENTER");
			Position(1410, 27);
			Size(15, 15);
			BorderSize(6);
			BevelSize(6);
			Font("TINY");
			Text("?");
			Style("ROLLOVER", "OUTLINE");
			Cursor("Highlight");
			NotifyParent("Button::Press", "AIPDescButton");
		}

		OnEvent("AIPDescButton")
		{
			Exec("AIPDesc_x3_0.cfg");
			FadeIn("|AIPDescPage");
		}

		// G66 Tech Path (ivar114)
		 CreateControl("G66TechStg1", "STATIC")
		{
			Geometry("LEFT", "TOP");
			Position(750, 375);
			Size(240, 27);
			Font("SMALL");
			Text("Tech Path:");
			JustifyText("right");
			Style("TRANSPARENT");
		}

		CreateControl("G66TechStage10", "BUTTON")
		{
			ColorGroup("BLUEGRAY");
			Geometry("LEFT", "TOP");
			Position(1005, 375);
			Size(39, 27);
			BorderSize(9);
			BevelSize(9);
			Style("ROLLOVER", "RADIO", "OUTLINE");
			Cursor("Highlight");
			Font("TINY");
			Text("0");
			UseVar("options.instant.int15");
			Value(0);
			NotifyParent("Button::Select", "TechStg10");
		}

		CreateControl("G66TechStage11", "BUTTON")
		{
			ColorGroup("BLUEGRAY");
			Geometry("LEFT", "TOP");
			Position(1080, 375);
			Size(39, 27);
			BorderSize(9);
			BevelSize(9);
			Style("ROLLOVER", "RADIO", "OUTLINE");
			Cursor("Highlight");
			Font("TINY");
			Text("1");
			UseVar("options.instant.int15");
			Value(1);
			NotifyParent("Button::Select", "TechStg11");
		}

		CreateControl("G66TechStage12", "BUTTON")
		{
			ColorGroup("BLUEGRAY");
			Geometry("LEFT", "TOP");
			Position(1155, 375);
			Size(39, 27);
			BorderSize(9);
			BevelSize(9);
			Style("ROLLOVER", "RADIO", "OUTLINE");
			Cursor("Highlight");
			Font("TINY");
			Text("2");
			UseVar("options.instant.int15");
			Value(2);
		 	NotifyParent("Button::Select", "TechStg12");
		}

		CreateControl("G66TechStage13", "BUTTON")
		{
			ColorGroup("BLUEGRAY");
			Geometry("LEFT", "TOP");
			Position(1230, 375);
			Size(39, 27);
			BorderSize(9);
			BevelSize(9);
			Style("ROLLOVER", "RADIO", "OUTLINE");
			Cursor("Highlight");
			Font("TINY");
			Text("3");
			UseVar("options.instant.int15");
			Value(4);
			NotifyParent("Button::Select", "TechStg13");
		}

		CreateControl("G66TechStage14", "BUTTON")
		{
			ColorGroup("BLUEGRAY");
			Geometry("LEFT", "TOP");
			Position(1305, 375);
			Size(39, 27);
			BorderSize(9);
			BevelSize(9);
			Style("ROLLOVER", "RADIO", "OUTLINE");
			Cursor("Highlight");
			Font("TINY");
			Text("4");
			UseVar("options.instant.int15");
			Value(8);
			NotifyParent("Button::Select", "TechStg14");
		}

		
		CreateControl("TechPathDescButton", "BUTTON")
		{
			ColorGroup("BLUEGRAY");
			Geometry("LEFT", "TOP");
			JustifyText("CENTER");
			Position(1380, 375);
			Size(15, 15);
			BorderSize(6);
			BevelSize(6);
			Font("TINY");
			Text("?");
			Style("ROLLOVER", "OUTLINE");
			Cursor("Highlight");
			NotifyParent("Button::Press", "TechPathDescButton");
		}

		OnEvent("TechPathDescButton")
		{
			Exec("TechPathDesc_x3_0.cfg");
			FadeIn("|TechPathDescPage");
		}

	//		CreateControl("G66TechStgX", "STATIC")
	//		{
	//			ColorGroup("BLUEGRAY");
	//			Geometry("LEFT", "TOP");
	//			Position(250, 160);
	//			Size(45, 9);
	//			BorderSize(3);
	//			BevelSize(3);
	//			JustifyText("LEFT"); //Right if the Custom button is enabled
	//			Font("TINY");
	//			Style("TRANSPARENT");
	//			Cursor("Highlight");
	//			UseVar("options.instant.string33");
	//		}


		OnEvent("TechStg10")
		{
			Cmd("options.instant.int15 0");
//			Cmd("options.instant.string33 Any");
		}

		OnEvent("TechStg11")
		{
			Cmd("options.instant.int15 1");
//			Cmd("options.instant.string33 '1'");
		}

		OnEvent("TechStg12")
		{
			Cmd("options.instant.int2 2");
//			Cmd("options.instant.string33 '2'");
		}

		OnEvent("TechStg13")
		{
			Cmd("options.instant.int15 4");
//			Cmd("options.instant.string33 '3'");
		}

		OnEvent("TechStg14")
		{
			Cmd("options.instant.int15 8");
//			Cmd("options.instant.string33 '4'");
		}

		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("BLUEGRAY");

				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("BLUEGRAY");

				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("BLUEGRAY");

			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 "CloseExtras" event
		//
		OnEvent("CloseExtras")
		{
			cmd("shell.instant.closeextras");
		}

		CreateControl("PagesLabel", "STATIC")
		{
			Geometry("LEFT", "BOTTOM");
			Position(1170, 0);
			Size(90, 27);
			Font("TINY");
			Text("Page:");
			JustifyText("left");
			Style("TRANSPARENT");
		}

		CreateControl("OpenExtraOptions1", "BUTTON")
		{
			ColorGroup("BLUEGRAY");
			Geometry("BOTTOM", "LEFT");
			Position(1275, 0);
			Size(30, 27);
			BorderSize(9);
			BevelSize(9);
			Style("INERT", "OUTLINE");
			Cursor("Highlight");
			Font("SMALL");
			Text("1");
			UseVar("options.instant.int23");
			Value(1);
			}

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

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

		CreateControl("OpenExtraOptions4", "BUTTON")
		{
			ColorGroup("BLUEGRAY");
			Geometry("BOTTOM", "LEFT");
			Position(1455, 0);
			Size(30, 27);
			BorderSize(9);
			BevelSize(9);
			Style("ROLLOVER", "OUTLINE");
			Cursor("Highlight");
			Font("SMALL");
			Text("4");
			NotifyParent("Button::Press", "OpenExtraOptions4");			
		}
	
		OnEvent("OpenExtraOptions4")
		{
			FadeOut("|ExtraOptions");
			FadeIn("|ExtraOptions4");
			Cmd("options.instant.int23 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("|ExtraOptions");
			// 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("|ExtraOptions");
      		// FadeIn("|ExtraOptions6");
			// Cmd("options.instant.int23 32"); 
      	// }

	} // end of Instant window



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

		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 "Main" button
	//
	CreateControl("Main", "BUTTON")
	{
		ColorGroup("BLUEGRAY");

		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", "Main");
	}

	//
	// 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 Main event
	//
	OnEvent("Main")
	{
		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");
	}
}
