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

Exec("bzshell_single_archive.cfg");
Exec("bzshell_single_briefing.cfg");

//
// CREATE SHELL SINGLE PLAYER PAGE
//
CreateControl("ShellSingle", "STATIC")
{
	// inherit root window's dimensions
	Geometry("PARENTWIDTH", "PARENTHEIGHT");

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

	//
	// CREATE THE MAIN SHELL PANEL
	//
	CreateControl("SinglePanel", "WINDOW")
	{
		Geom("PARENTWIDTH", "PARENTHEIGHT");
		Style("TRANSPARENT", "INERT");

		//
		// create the Main button
		//
		CreateControl("Main", "BUTTON")
		{
			ColorGroup("MAGENTA");
			Position(20, 20);
			Size(95, 0);
			BorderSize(10);
			BevelSize(5);
			Style("ROLLOVER", "RADIO", "OUTLINE");
			Text("Main");
			Font("MEDIUM");
			Cursor("Highlight");
			NotifyParent("Button::Select", "Back");
			UseVar("shell.page");
			Value(-1);
		}


		//
		// create the archive button
		//
		CreateControl("Archive", "BUTTON")
		{
			ColorGroup("MAGENTA");
			Position(145, 20);
			Size(95, 0);
			BorderSize(10);
			BevelSize(5);
			Style("ROLLOVER", "RADIO", "OUTLINE");
			Text("Archive");
			Font("MEDIUM");
			Cursor("Highlight");
			NotifyParent("Button::Select", "Archive");
			UseVar("shell.page");
			Value(2);
		}

		//
		// create full briefing button
		//
		CreateControl("Briefing", "BUTTON")
		{
			ColorGroup("MAGENTA");
			Position(270, 20);
			Size(95, 0);
			BorderSize(10);
			BevelSize(5);
			Style("ROLLOVER", "RADIO", "OUTLINE");
			Text("Full Brief");
			Font("MEDIUM");
			Cursor("Highlight");
			NotifyParent("Button::Select", "Briefing");
			UseVar("shell.page");
			Value(3);
		}
		
		//
		// create the Cancel button
		//
		CreateControl("Launch", "BUTTON")
		{
			ColorGroup("MAGENTA");
			Position(520, 20);
			Size(95, 0);
			BorderSize(10);
			BevelSize(5);
			Style("ROLLOVER", "RADIO", "OUTLINE");
			Text("Launch");
			Font("MEDIUM");
			Cursor("Highlight");
			NotifyParent("Button::Select", "Launch");
			UseVar("shell.page");
			Value(4);
		}

		//
		// handle the back event
		//
		OnEvent("Back")
		{
			cmd("shell.stopSound mire22_3.wav");
			FadeOut("|ShellSingle");
			FadeOut("|Data");
			FadeOut("|Technology");
			FadeIn("|ShellMain");
		}


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

		//
		// handle the "Archive" event
		//
		OnEvent("Archive")
		{
			Cmd("shell.single.archenter");
			FadeOut("|ShellSingle");
			FadeOut("|Data");
			FadeOut("|Technology");
			FadeIn("|SingleArchive");
		}

		//
		// handle the "Briefing" event
		//
		OnEvent("Briefing")
		{
			FadeOut("|ShellSingle");
			FadeOut("|Data");
			FadeOut("|Technology");
			FadeIn("|SingleBriefing");
		}

		//
		// handle the "options" event
		//
		OnEvent("Options")
		{
			FadeOut("|ShellSingle");
			FadeOut("|Technology");
			FadeOut("|Data");
			FadeIn("|EscapePanel");
		}

		OnEvent("Control::Activate")
		{
			cmd("shell.background singlep_main.tga");
			Cmd("shell.page 5");
			FadeIn("|Data");
			cmd("shell.backgroundSound mire22_3.wav");
		}
		
		OnEvent("Control::Deactivate")
		{
			cmd("shell.single.stopMail");
		}

	
	}


	//
	// create the mission display
	//
	CreateControl("Mission", "STATIC")
	{
		ColorGroup("BRIGHTMAGENTA");
		Position(43, 68);
		Size(256, 206);
		BorderSize(10);
		BevelSize(5);
		//TabSize(110, 10);
		Style("OUTLINE");
		//Style("TRANSPARENT");
		Title("Mission");
		//TitleFont("SMALL");

		CreateControl("Title", "STATIC")
		{
			Position(0, 0);
			Size(240, 10);
			Style("TRANSPARENT");
			UseVar("shell.single.title");
			Font("MEDIUM");
			JustifyText("LEFT");
		}

 		CreateControl("List", "LISTBOX")
 		{
 			Position(0, 15);
 			Size(240, 120);
			CellSize(240, 10);
			Style("NOSELECTION", "TRANSPARENT");
 			Font("SMALL");
			ItemConfig()
			{
				Style("TRANSPARENT");
			}
 		}			
	}

	//
	// create the messages display
	//
	CreateControl("Messages", "STATIC")
	{
		Geometry("LEFT", "BOTTOM");
		Style("TRANSPARENT", "INERT");
		Position(40, -40);
		Size(250, 130);
		BorderSize(10);
		BevelSize(5);
		//TabSize(110, 10);
		//Style("OUTLINE");
		Style("TRANSPARENT");
		Title("Messages");
		//TitleFont("SMALL");


		CreateControl("Title", "STATIC")
		{
			Position(5, 0);
			Size(220, 0);
			Style("TRANSPARENT");
			UseVar("shell.single.mailname");
			Font("MEDIUM");
			JustifyText("LEFT");
		}

 		CreateControl("List", "LISTBOX")
 		{
 			Position(5, 15);
 			Size(220, 100);
			CellSize(240, 10);
			Style("NOSELECTION", "TRANSPARENT");
 			Font("SMALL");
			ItemConfig()
			{
				Style("TRANSPARENT");
			}
 		}			

		CreateControl("View", "VIEWER")
		{
			Position(110, 100);
			Size(130, 140);
			Style("TRANSPARENT");

			SetAmbientColor(1.0, 1.0, 1.0);
			SetDiffuseColor(1.0, 1.0, 1.0);
			SetDiffuseDir(2.0, -5.0, 1.0);
			SetModelDistance(50.0);
			SetModelInclination(-30.0);
			SetModelRotation(60.0);
		}
	}

	CreateControl("Previous", "BUTTON")
	{
		Geometry("LEFT", "BOTTOM");
		Style("ROLLOVER", "OUTLINE");
		ColorGroup("MAGENTA");
		Position(40, -40);
		Size(75, 10);
		BorderSize(3);
		BevelSize(2);
		Text("Prev");
 		Font("SMALL");
		NotifyParent("Button::Press", "Previous");
	}

	CreateControl("Replay", "BUTTON")
	{
		Geometry("LEFT", "BOTTOM");
		Style("ROLLOVER", "OUTLINE");
		ColorGroup("MAGENTA");
		Position(135, -40);
		Size(75, 10);
		BorderSize(3);
		BevelSize(2);
		Text("Replay");
 		Font("SMALL");
		NotifyParent("Button::Press", "Replay");
	}

	CreateControl("Next", "BUTTON")
	{
		Geometry("LEFT", "BOTTOM");
		Style("ROLLOVER", "OUTLINE");
		ColorGroup("MAGENTA");
		Position(230, -40);
		Size(75, 10);
		BorderSize(3);
		BevelSize(2);
		Text("Next");
 		Font("SMALL");
		NotifyParent("Button::Press", "Next");
	}


	OnEvent("Next")
	{
		cmd("shell.single.next");
	}

	OnEvent("Replay")
	{
		cmd("shell.single.same");
	}

	OnEvent("Previous")
	{
		cmd("shell.single.previous");
	}

	OnEvent("Control::Activate")
	{
		cmd("shell.single.same");
	}
}

//
// create the technology and planet info window.
//
CreateControl("Data", "WINDOW")
{
	Geom("PARENTWIDTH", "PARENTHEIGHT");
	Style("TRANSPARENT", "INERT");

	//
	// create the planet display
	//
	CreateControl("Planet", "WINDOW")
	{
		ColorGroup("BRIGHTMAGENTA");
		Geometry("LEFT", "TOP");
 		Position(336, 311);
		Size(263, 129);
		BorderSize(10);
		BevelSize(5);
		//TabSize(110, 10);
		Style("OUTLINE", "INERT");
		Title("Planet Data");
		//TitleFont("SMALL");

		CreateControl("Title", "STATIC")
		{
			Position(0, 0);
			Size(200, 10);
			Style("TRANSPARENT");
			UseVar("shell.single.planetname");
			Font("MEDIUM");
			JustifyText("LEFT");
		}

		CreateControl("List", "LISTBOX")
		{
			Position(0, 15);
			Size(240, 180);
			CellSize(240, 10);
			Style("NOSELECTION", "TRANSPARENT");
			Font("SMALL");
			ItemConfig()
			{
				Style("TRANSPARENT");
			}
		}

		//
		// create the tech update button
		//
		CreateControl("Technology", "BUTTON")
		{
			Geometry("RIGHT", "TOP");
			ColorGroup("MAGENTA");
			Position(0, 0);
			Size(95, 10);
			BorderSize(3);
			BevelSize(2);
			Style("ROLLOVER", "OUTLINE");
			Text("Tech. Info.");
			Font("SMALL");
			Cursor("Highlight");
			NotifyParent("Button::Press", "Tech");
		}

		OnEvent("Tech")
		{
			FadeOut("|Data");
			FadeIn("|Technology");
			cmd("shell.single.activateTech");
		}
	}
	
	CreateControl("View", "VIEWER")
	{
		Geometry("RIGHT", "TOP");
 		Position(-50, 50);
		Size(220, 220);
		Style("TRANSPARENT");

		SetAmbientColor(1.0, 1.0, 1.0);
		SetDiffuseColor(1.0, 1.0, 1.0);
		SetDiffuseDir(2.0, -5.0, 1.0);
		SetModelDistance(50.0);
		SetModelInclination(-30.0);
		SetModelRotation(-2.0);
	}
}

//
// create the research display
//

CreateControl("Technology", "WINDOW")
{
	Geom("PARENTWIDTH", "PARENTHEIGHT");
	Style("TRANSPARENT", "INERT");

	CreateControl("Research", "WINDOW")
	{
		ColorGroup("BRIGHTMAGENTA");
		Geometry("LEFT", "TOP");
 		Position(336, 311);
		Size(263, 129);
		BorderSize(10);
		BevelSize(5);
		//TabSize(110, 10);
		Style("OUTLINE", "INERT");
		Title("Technology");
		//TitleFont("SMALL");

		CreateControl("Title", "STATIC")
		{
			Geometry("RIGHT", "TOP");
			Position(0, 0);
			Size(180, 10);
			Style("TRANSPARENT");
			UseVar("shell.single.techname");
			Font("MEDIUM");
			JustifyText("RIGHT");
		}

		CreateControl("List", "LISTBOX")
		{
			Position(20, 15);
			Size(240, 180);
			CellSize(260, 10);
			Style("NOSELECTION", "TRANSPARENT");
			Font("SMALL");
			ItemConfig()
			{
				Style("TRANSPARENT");
			}
		}

		//
		// create the Data update button
		//
		CreateControl("Data", "BUTTON")
		{
			Geometry("LEFT", "TOP");
			ColorGroup("MAGENTA");
			Position(0, 0);
			Size(95, 10);
			BorderSize(3);
			BevelSize(2);
			Style("ROLLOVER", "OUTLINE");
			Text("Planet Data");
			Font("SMALL");
			Cursor("Highlight");
			NotifyParent("Button::Press", "Data");
		}
		
		
		OnEvent("Data")
		{
			FadeOut("|Technology");
			FadeIn("|Data");
		}
	}

	CreateControl("View", "VIEWER")
	{
		Geometry("RIGHT", "TOP");
 		Position(-50, 50);
		Size(240, 170);
		Style("TRANSPARENT");

		SetAmbientColor(1.0, 1.0, 1.0);
		SetDiffuseColor(1.0, 1.0, 1.0);
		SetDiffuseDir(2.0, -5.0, 1.0);
		SetModelDistance(50.0);
		SetModelInclination(-30.0);
		SetModelRotation(60.0);
	}

	CreateControl("Previous", "BUTTON")
	{
		Geometry("RIGHT", "BOTTOM");
		Style("ROLLOVER", "OUTLINE");
		ColorGroup("MAGENTA");
		Position(-230, -40);
		Size(75, 10);
		BorderSize(3);
		BevelSize(2);
		Text("Prev");
 		Font("SMALL");
		NotifyParent("Button::Press", "Previous");
	}

	CreateControl("Next", "BUTTON")
	{
		Geometry("RIGHT", "BOTTOM");
		Style("ROLLOVER", "OUTLINE");
		ColorGroup("MAGENTA");
		Position(-40, -40);
		Size(75, 10);
		BorderSize(3);
		BevelSize(2);
		Text("Next");
 		Font("SMALL");
		NotifyParent("Button::Press", "Next");
	}

	OnEvent("Next")
	{
		cmd("shell.single.nextTech");
	}

	OnEvent("Previous")
	{
		cmd("shell.single.previousTech");
	}
}
