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

//
// CREATE SHELL INSTANT ACTION PAGE
//
CreateControl("ShellInstant", "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(750, 375);
		BorderSize(15);
		BevelSize(8);
		TabSize(225, 15);
		Style("RIGHTTAB", "OUTLINE");
		Projector(1);
		Title("Instant Action");
		TitleFont("MEDIUM");

		CreateControl("List", "LISTBOX")
		{
			ColorGroup("LISTBOX");
			Geometry("LEFT", "TOP");
			Position(0, 0);
			Size(233, 192);
			CellSize(218, 15);
			BorderSize(8);
			BevelSize(5);
			Font("SMALL");
			NotifyParent("Listbox::DblClick", "Launch");
			UseVar("shell.instant.name");
			NotifyParent("ListBox::SelChange", "FillData");
			Style("VSLIDER");
			Cursor("Highlight");
		}

		OnEvent("FillData")
		{
			cmd("shell.instant.loadData");
		}

		CreateControl("Map", "STATIC")
		{
			ColorGroup("WHITE");
			Geometry("RIGHT", "TOP");
			Position(0, 0);
			Size(192, 192);
		}

		CreateControl("MapSpecs", "LISTBOX")
  	{
			Geometry("LEFT", "TOP");
			ColorGroup("BACKGROUND");
			Size(285, 192);
			CellSize(270, 15);
			Position(255, 0);
			BorderSize(8);
			BevelSize(5);
			Font("SMALL");
			Style("NOSELECTION");
			Style("VSLIDER");
			ItemConfig()
			{
				Style("TRANSPARENT");
			}
		}


		//
		// create the difficulty title
		//
		CreateControl("Difficulty", "STATIC")
		{
			Geometry("LEFT", "TOP");
			Position(0, 203);
			Size(150, 15);
			Style("TRANSPARENT");
			Font("MEDIUM");
			JustifyText("LEFT");
			Text("Difficulty");
		}

		//
		// create easy difficulty button
		//
		CreateControl("Easy", "BUTTON")
		{
			ColorGroup("LISTBOX");

			Geometry("LEFT", "TOP");
			Position(8, 233);
			Size(98, 15);
			BorderSize(8);
			BevelSize(5);
			Style("ROLLOVER", "RADIO", "OUTLINE");
			Font("SMALL");
			Text("Easy");
			Cursor("Highlight");
			UseVar("shell.instant.difficulty");
			Value(0);
		}

		//
		// create the medium difficulty button
		//
		CreateControl("Medium", "BUTTON")
		{
			ColorGroup("LISTBOX");

			Geometry("LEFT", "TOP");
			Position(128, 233);
			Size(98, 15);
			BorderSize(8);
			BevelSize(5);
			Style("ROLLOVER", "RADIO");
			Font("SMALL");
			Text("Medium");
			Cursor("Highlight");
			UseVar("shell.instant.difficulty", "OUTLINE");
			Value(1);
		}

		//
		// create the hard difficulty button
		//
		CreateControl("Hard", "BUTTON")
		{
			ColorGroup("LISTBOX");

			Geometry("LEFT", "TOP");
			Position(248, 233);
			Size(98, 15);
			BorderSize(8);
			BevelSize(5);
			Style("ROLLOVER", "RADIO");
			Font("SMALL");
			Text("Hard");
			Cursor("Highlight");
			UseVar("shell.instant.difficulty", "OUTLINE");
			Value(2);
		}

		//
		// create the computer force title
		//
		CreateControl("Computer", "STATIC")
		{
			Geometry("LEFT", "TOP");
			Position(0, 263);
			Size(225, 15);
			Style("TRANSPARENT");
			Font("MEDIUM");
			JustifyText("LEFT");
			Text("Computer Force");
		}

		//
		// create the small force button
		//
		CreateControl("Small", "BUTTON")
		{
			ColorGroup("LISTBOX");

			Geometry("LEFT", "TOP");
			Position(8, 293);
			Size(98, 15);
			BorderSize(8);
			BevelSize(5);
			Style("ROLLOVER", "RADIO", "OUTLINE");
			Font("SMALL");
			Text("Small");
			Cursor("Highlight");
			UseVar("shell.instant.computerforce");
			Value(0);
		}

		//
		// create the medium force button
		//
		CreateControl("Medium", "BUTTON")
		{
			ColorGroup("LISTBOX");

			Geometry("LEFT", "TOP");
			Position(128, 293);
			Size(98, 15);
			BorderSize(8);
			BevelSize(5);
			Style("ROLLOVER", "RADIO", "OUTLINE");
			Font("SMALL");
			Text("Medium");
			Cursor("Highlight");
			UseVar("shell.instant.computerforce");
			Value(1);
		}

		//
		// create the large force button
		//
		CreateControl("Large", "BUTTON")
		{
			ColorGroup("LISTBOX");

			Geometry("LEFT", "TOP");
			Position(248, 293);
			Size(98, 15);
			BorderSize(8);
			BevelSize(5);
			Style("ROLLOVER", "RADIO", "OUTLINE");
			Font("SMALL");
			Text("Large");
			Cursor("Highlight");
			UseVar("shell.instant.computerforce");
			Value(2);
		}

		//
		// create player force title
		//
		CreateControl("Player", "STATIC")
		{
			Geometry("LEFT", "TOP");
			Position(0, 323);
			Size(180, 15);
			Style("TRANSPARENT");
			Font("MEDIUM");
			JustifyText("LEFT");
			Text("Player Force");
		}

		//
		// create the small force button
		//
		CreateControl("Small", "BUTTON")
		{
			ColorGroup("LISTBOX");

			Geometry("LEFT", "TOP");
			Position(8, 353);
			Size(98, 15);
			BorderSize(8);
			BevelSize(5);
			Style("ROLLOVER", "RADIO", "OUTLINE");
			Font("SMALL");
			Text("Small");
			Cursor("Highlight");
			UseVar("shell.instant.playerforce");
			Value(0);
		}

		//
		// create the medium force button
		//
		CreateControl("Medium", "BUTTON")
		{
			ColorGroup("LISTBOX");

			Geometry("LEFT", "TOP");
			Position(128, 353);
			Size(98, 15);
			BorderSize(8);
			BevelSize(5);
			Style("ROLLOVER", "RADIO", "OUTLINE");
			Font("SMALL");
			Text("Medium");
			Cursor("Highlight");
			UseVar("shell.instant.playerforce");
			Value(1);
		}

		//
		// create the large force button
		//
		CreateControl("Large", "BUTTON")
		{
			ColorGroup("LISTBOX");

			Geometry("LEFT", "TOP");
			Position(248, 353);
			Size(98, 15);
			BorderSize(8);
			BevelSize(5);
			Style("ROLLOVER", "RADIO", "OUTLINE");
			Font("SMALL");
			Text("Large");
			Cursor("Highlight");
			UseVar("shell.instant.playerforce");
			Value(2);
		}

		// This window (Aware13Items) is enabled if the Instant INF doesn't
		// have 'Aware_v13 = 1' in it.
		CreateControl("Aware12Items", "STATIC")
		{
			Geometry("Right", "TOP");
			Position(0, 203);
			Size(375, 180);
			Style("TRANSPARENT");

			//
			// create the mission mode title
			//
			CreateControl("Mode", "STATIC")
			{
				Geometry("LEFT", "TOP");
				Position(0, 0);
				Size(225, 15);
				Style("TRANSPARENT");
				Font("MEDIUM");
				JustifyText("LEFT");
				Text("Game Mode");
			}

			//
			// create the thug button
			//
			CreateControl("Thug", "BUTTON")
			{
				ColorGroup("LISTBOX");

				Geometry("LEFT", "TOP");
				Position(8, 30);
				Size(158, 15);
				BorderSize(8);
				BevelSize(5);
				Style("ROLLOVER", "RADIO", "OUTLINE");
				Font("SMALL");
				Text("Pilot");
				Cursor("Highlight");
				UseVar("shell.instant.goaltype");
				Value(0);
			}

			//
			// create the commander button
			//
			CreateControl("Commander", "BUTTON")
			{
				ColorGroup("LISTBOX");

				Geometry("LEFT", "TOP");
				Position(188, 30);
				Size(158, 15);
				BorderSize(8);
				BevelSize(5);
				Style("ROLLOVER", "RADIO", "OUTLINE");
				Font("SMALL");
				Text("Commander");
				Cursor("Highlight");
				UseVar("shell.instant.goaltype");
				Value(1);
			}

		} // End of Aware12Items

		// This window (Aware13Items) is disabled if the Instant INF doesn't
		// have 'Aware_v13 = 1' in it.
		CreateControl("Aware13Items", "STATIC")
		{
			Geometry("Right", "TOP");
			Position(0, 203);
			Size(375, 180);
			Style("TRANSPARENT");

			CreateControl("MyRaceTitle", "STATIC")
			{
				Geometry("LEFT", "TOP");
				Position(0, 0);
				Size(225, 15);
				Style("TRANSPARENT");
				Font("MEDIUM");
				JustifyText("LEFT");
				Text("Human's Race:");
			}

			CreateControl("MyRaceFixed", "STATIC")
			{
				Geometry("LEFT", "TOP");
				Position(0, 30);
				Size(225, 15);
				Style("TRANSPARENT");
				Font("MEDIUM");
				JustifyText("LEFT");
				Text("");
			}

			CreateControl("MyRaceList", "LISTBOX")
			{
				ColorGroup("LISTBOX");	
				//				ColorGroup("BLACKBLUE");
				Geometry("LEFT", "TOP");
				Position(0, 30); // (0, 0)
				Size(165, 83); // (125, 60) // (120, 55)
				CellSize(150, 17); // (115, 10) //(115, 11)
				BorderSize(8); // Was nonexistent
				BevelSize(3); // Was nonexistent
				Style("OUTLINE");
				Cursor("Highlight");
				Font("TINY");
				Style("VSLIDER");
				UseVar("options.instant.myraceidx");
			}

			CreateControl("CPURaceTitle", "STATIC")
			{
				Geometry("LEFT", "TOP");
				Position(188, 0);
				Size(225, 15);
				Style("TRANSPARENT");
				Font("MEDIUM");
				JustifyText("LEFT");
				Text("CPU's Race:");
			}

			CreateControl("CPURaceFixed", "STATIC")
			{
				Geometry("LEFT", "TOP");
				Position(188, 30);
				Size(225, 15);
				Style("TRANSPARENT");
				Font("MEDIUM");
				JustifyText("LEFT");
				Text("");
			}

			CreateControl("CPURaceList", "LISTBOX")
			{
				ColorGroup("LISTBOX");
				//				ColorGroup("BLACKBLUE");
				Geometry("LEFT", "TOP");
				Position(188, 30); // (0, 0)
				Size(165, 83); // (125, 60) // (120, 55)
				CellSize(150, 17); // (115, 10) //(115, 11)
				BorderSize(8); // Was nonexistent
				BevelSize(3); // Was nonexistent
				Style("OUTLINE");
				Cursor("Highlight");
				Font("TINY");
				Style("VSLIDER");
				UseVar("options.instant.hisraceidx");
			}

			CreateControl("ExtraOptions", "BUTTON")
			{
				ColorGroup("BlackBlue");
				//				ColorGroup("MAGENTA");
				//				ColorGroup("LISTBOX");

				Geometry("RIGHT", "TOP");
				Position(0, 150);
				Size(195, 15);
				BorderSize(8);
				BevelSize(5);
				Style("ROLLOVER", "OUTLINE");
				Font("SMALL");
				Text("Extra Options");
				Cursor("Highlight");
				NotifyParent("Button::Press", "OpenExtras");
			}

			//
			// handle the "open extras" event
			//
			OnEvent("OpenExtras")
			{
				cmd("shell.instant.openextras");
			}
		} // end of Aware13Items

	} // Instant window


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

		Geometry("RIGHT", "TOP");
		Position(-30, 30);
		Size(143, 0);
		BorderSize(15);
		BevelSize(8);
		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(30, 30);
		Size(143, 0);
		BorderSize(15);
		BevelSize(8);
		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.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");
	}


}
