// ================
// BATTLEZONE SHELL
// ================
//
// Edited by General BlackDragon, added a "main" button in instant
// debriefing to go back to main shell. This is more convenient.

//
// Debriefing after a SP game. Shows first page, then results
//
CreateControl("SingleDeBrief", "WINDOW")
{

	// inherit root window's dimensions
	Geometry("PARENTWIDTH", "PARENTHEIGHT");

	// set window style
	Style("TRANSPARENT");
	CreateControl("BriefingWindow", "WINDOW")
	{
		Geometry("HCENTRE", "VCENTRE");
		ColorGroup("MAGENTA");
		Position(0, 30);
		Size(720, 604);
		BorderSize(20);
		BevelSize(10);
		TabSize(300, 20);
		Style("LEFTTAB", "OUTLINE");
		Title("Debriefing");
		TitleFont("MEDIUM");

		CreateControl("List", "LISTBOX")
		{
			ColorGroup("LISTBOX");
			Style("VSLIDER");
			Geometry("LEFT", "TOP");
			Position(0, 0);
			Size(720, 594);
			CellSize(680, 22);
			SliderPadding(10);
			Font("SMALL");
			Style("INERT", "NOSELECTION", "TRANSPARENT");
			ItemConfig()
			{
				Style("TRANSPARENT");
			}
		}
	}

	//
	// create the Cancel button
	//
	CreateControl("Okay", "BUTTON")
	{
		ColorGroup("MAGENTA");
		Position(1040, 40);
		Size(190, 0);
		BorderSize(20);
		BevelSize(10);
		Font("SMALL");
		JustifyText("CENTER");
		Text("Continue");
		Style("ROLLOVER", "OUTLINE");
		Cursor("Highlight");
		NotifyParent("Button::Press", "Continue");

	}

	CreateControl("Main", "BUTTON")
	{
		ColorGroup("MAGENTA");
		Position(40, 40);
		Size(190, 0);
		BorderSize(20);
		BevelSize(10);
		Style("ROLLOVER", "RADIO", "OUTLINE");
		Text("Main");
		Font("MEDIUM");
		Cursor("DARK");
		NotifyParent("Button::Select", "Back");
		UseVar("shell.page");
		Value(-1);
	}	

	OnEvent("Back")
	{
		cmd("shell.stopSound mire22_6.wav");
		FadeOut();
		FadeIn("|ShellMain");
	}	


	//
	// handle the Continue event
	//
	OnEvent("Continue")
	{
		FadeOut();
		FadeIn("|SingleDeBrief2");
	}	

	OnEvent("Control::Activate")
	{
		//Cmd("shell.single.loaddebrief");
		cmd("shell.background singlep_briefing.tga");
		cmd("shell.backgroundSound mire22_6.wav");
	}
}

//
// End of a BZ2 game. Shows gameover reason, results.
//
CreateControl("SingleDeBrief2", "WINDOW")
{
	Style("TRANSPARENT", "INERT");
	Geom("PARENTWIDTH", "PARENTHEIGHT");

	OnEvent("Control::Activate")
	{
		cmd("shell.background multip_end.tga");
	}

	//
	// create the "Continue" button
	//
	CreateControl("Continue", "BUTTON")
	{
		ColorGroup("MAGENTA");
		Position(1050, 40);
		Size(190, 0);
		BorderSize(20);
		BevelSize(10);
		Style("ROLLOVER", "OUTLINE", "BLINK");
		Text("Continue");
		Font("MEDIUM");
		Cursor("Highlight");
		NotifyParent("Button::Press", "Next");
	}

	CreateControl("Main", "BUTTON")
	{
		ColorGroup("MAGENTA");
		Position(40, 40);
		Size(190, 0);
		BorderSize(20);
		BevelSize(10);
		Style("ROLLOVER", "RADIO", "OUTLINE");
		Text("Main");
		Font("MEDIUM");
		Cursor("DARK");
		NotifyParent("Button::Select", "Back");
		UseVar("shell.page");
		Value(-1);
	}

	OnEvent("Next")
	{
		FadeOut();
		FadeIn("|ShellSingle");
		cmd("shell.stopSound mire22_6.wav");
		Cmd("shell.single.enter");
	}

	OnEvent("Back")
	{
		cmd("shell.stopSound mire22_6.wav");
		FadeOut();
		FadeIn("|ShellMain");
	}

	CreateControl("ShellMultiEnd", "WINDOW")
	{
		ColorGroup("MAGENTA");
		Geometry("LEFT", "TOP");
		Position(40, 120);
		Size(1200, 500);
		BorderSize(20);
		BevelSize(10);
		TabSize(300, 20);
		Title("Game Results");
		TitleFont("MEDIUM");
		Style("LEFTTAB", "OUTLINE");

		//
		// create the scroll bar
		//
		CreateControl("SelectionSlider", "LISTSLIDER")
		{
			Orientation("VERTICAL");
			Geometry("LEFT", "TOP");
			Position(1160, 80);
			Size(20, 420);
			Style("BUTTONS", "ROLLOVER");
			Cursor("Highlight");
			// Do NOT use a var for this slider!
			// It's controlled automagically by association
		}

		CreateControl("ScoreColumn1", "LISTBOX")
		{
			ColorGroup("LISTBOX");	
			Geometry("LEFT", "TOP");
			Position(100, 80);
			Size(800, 420);
			CellSize(780, 30);
			Font("Small");
			UseVar("network.scoredisplay");
			Style("NOSELECTION", "TRANSPARENT");
			ItemConfig()
			{
				Style("TRANSPARENT");
			}
			UseSlider("<SelectionSlider");
		}

		CreateControl("ScoreColumn2", "LISTBOX")
		{
			ColorGroup("LISTBOX");	
			Geometry("LEFT", "TOP");
			Position(900, 80);
			Size(140, 420);
			CellSize(120, 30);
			Font("Small");
			UseVar("network.scoredisplay");
			Style("NOSELECTION", "TRANSPARENT");
			ItemConfig()
  			{
  				Style("TRANSPARENT");
  			}
			UseSlider("<SelectionSlider");
		}
	}
}


//
// Shows the results after an IA game
//
CreateControl("InstantDeBrief", "WINDOW")
{

	// inherit root window's dimensions
	Geometry("PARENTWIDTH", "PARENTHEIGHT");

	// set window style
	Style("TRANSPARENT");
	CreateControl("BriefingWindow", "WINDOW")
	{

		Geometry("HCENTRE", "VCENTRE");
		ColorGroup("MAGENTA");
		Position(0, 30);
		Size(720, 604);
		BorderSize(20);
		BevelSize(10);
		TabSize(300, 20);
		Style("LEFTTAB", "OUTLINE");
		Title("Debriefing");
		TitleFont("SMALL");

		CreateControl("List", "LISTBOX")
		{
			ColorGroup("LISTBOX");
			Style("VSLIDER");
			Geometry("LEFT", "TOP");
			Position(0, 0);
			Size(720, 600);
			CellSize(670, 20);
			SliderPadding(10);
			Style("NOSELECTION", "TRANSPARENT");
			Font("SMALL");
			ItemConfig()
			{
				Style("TRANSPARENT");
			}
		}
	}

	//
	// create the Cancel button
	//
	CreateControl("Okay", "BUTTON")
	{
		ColorGroup("MAGENTA");
		Position(1040, 40);
		Size(190, 0);
		BorderSize(20);
		BevelSize(10);
		Font("SMALL");
		JustifyText("CENTER");
		Text("Continue");
		Style("ROLLOVER", "OUTLINE");
		Cursor("Highlight");
		NotifyParent("Button::Press", "Continue");

	}	

	CreateControl("Main", "BUTTON")
	{
		ColorGroup("MAGENTA");
		Position(40, 40);
		Size(190, 0);
		BorderSize(20);
		BevelSize(10);
		Style("ROLLOVER", "RADIO", "OUTLINE");
		Text("Main");
		Font("MEDIUM");
		Cursor("DARK");
		NotifyParent("Button::Select", "Back");
		UseVar("shell.page");
		Value(-1);
	}

	//
	// handle the Continue event
	//
	OnEvent("Continue")
	{
		FadeOut();
		FadeIn("|InstantDeBrief2");
	}	

	OnEvent("Back")
	{
		cmd("shell.stopSound mire22_6.wav");
		FadeOut();
		FadeIn("|ShellMain");
	}

	OnEvent("Control::Activate")
	{
		//Cmd("shell.single.loaddebrief");
		cmd("shell.background singlep_briefing.tga");
		cmd("shell.backgroundSound mire22_6.wav");
	}

}


//
// End of a BZ2 game. Shows gameover reason, results.
//
CreateControl("InstantDeBrief2", "WINDOW")
{
	Style("TRANSPARENT", "INERT");
	Geom("PARENTWIDTH", "PARENTHEIGHT");

	OnEvent("Control::Activate")
	{
		cmd("shell.background multip_end.tga");
	}

	//
	// create the "Continue" button
	//
	CreateControl("Continue", "BUTTON")
	{
		ColorGroup("MAGENTA");
		Position(1050, 40);
		Size(190, 0);
		BorderSize(20);
		BevelSize(10);
		Style("ROLLOVER", "OUTLINE", "BLINK");
		Text("Continue");
		Font("MEDIUM");
		Cursor("Highlight");
		NotifyParent("Button::Press", "Next");
	}

	CreateControl("Main", "BUTTON")
	{
		ColorGroup("MAGENTA");
		Position(40, 40);
		Size(190, 0);
		BorderSize(20);
		BevelSize(10);
		Style("ROLLOVER", "RADIO", "OUTLINE");
		Text("Main");
		Font("MEDIUM");
		Cursor("DARK");
		NotifyParent("Button::Select", "Back");
		UseVar("shell.page");
		Value(-1);
	}

	OnEvent("Next")
	{
		FadeOut();
		cmd("shell.stopSound mire22_6.wav");
		FadeIn("|ShellInstant");
		Cmd("shell.instant.load");
	}

	OnEvent("Back")
	{
		cmd("shell.stopSound mire22_6.wav");
		FadeOut();
		FadeIn("|ShellMain");
	}

	CreateControl("ShellMultiEnd", "WINDOW")
	{
		ColorGroup("MAGENTA");
		Geometry("LEFT", "TOP");
		Position(40, 120);
		Size(1200, 500);
		BorderSize(20);
		BevelSize(10);
		TabSize(300, 20);
		Title("Game Results");
		TitleFont("MEDIUM");
		Style("LEFTTAB", "OUTLINE");

		//
		// create the scroll bar
		//
		CreateControl("SelectionSlider", "LISTSLIDER")
		{
			Orientation("VERTICAL");
			Geometry("LEFT", "TOP");
			Position(1160, 80);
			Size(20, 420);
			Style("BUTTONS", "ROLLOVER");
			Cursor("Highlight");
			// Do NOT use a var for this slider!
			// It's controlled automagically by association
		}

		CreateControl("ScoreColumn1", "LISTBOX")
		{
			ColorGroup("LISTBOX");	
			Geometry("LEFT", "TOP");
			Position(100, 80);
			Size(800, 420);
			CellSize(780, 30);
			Font("Small");
			UseVar("network.scoredisplay");
			Style("NOSELECTION", "TRANSPARENT");
			ItemConfig()
			{
				Style("TRANSPARENT");
			}
			UseSlider("<SelectionSlider");
		}

		CreateControl("ScoreColumn2", "LISTBOX")
		{
			ColorGroup("LISTBOX");	
			Geometry("LEFT", "TOP");
			Position(900, 80);
			Size(140, 420);
			CellSize(120, 30);
			Font("Small");
			UseVar("network.scoredisplay");
			Style("NOSELECTION", "TRANSPARENT");
			ItemConfig()
  			{
  				Style("TRANSPARENT");
  			}
			UseSlider("<SelectionSlider");
		}
	}
}
