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

//
// CREATE SHELL MULTIPLAYER GAME OPTIONS PAGE
//
CreateControl("ShellMultiClientOption", "WINDOW")
{
	Style("TRANSPARENT", "INERT");
	Geom("PARENTWIDTH", "PARENTHEIGHT");

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

	//
	//
	// create the "back" button
	//
	CreateControl("Back", "BUTTON")
	{
		ColorGroup("MAGENTA");
		Position(20, 20);
		Size(95, 0);
		BorderSize(10);
		BevelSize(5);
		Style("ROLLOVER", "OUTLINE");
		Text("Main");
		Font("MEDIUM");
		Cursor("Highlight");
		NotifyParent("Button::Press", "Back");
	}

	//
	// create the "leave" button
	//
	CreateControl("Leave", "BUTTON")
	{
		Geometry("LEFT", "TOP");
		ColorGroup("MAGENTA");
		Position(145, 20);
		Size(95, 0);
		BorderSize(10);
		BevelSize(5);
		Font("SMALL");
		JustifyText("CENTER");
		Text("Leave Game");
		Style("ROLLOVER", "OUTLINE");
		Cursor("Highlight");
		NotifyParent("Button::Press", "Leave");
	}

	//
	// create the options window
	//
	CreateControl("Option", "WINDOW")
	{
		ColorGroup("MAGENTA");

		Geometry("RIGHT", "TOP");
		Position(-20, 230);
		Size(270, 90);
		BorderSize(10);
		BevelSize(5);
		TabSize(110, 10);
		Title("Game Info");
		TitleFont("MEDIUM");
		Style("RIGHTTAB", "INERT", "OUTLINE");

		CreateControl("PlayerLimitTitle", "STATIC")
		{
			Geometry("LEFT", "TOP");
			Position(0, 0);
			Size(95, 9);
			Font("SMALL");
			Text("Player Limit:");
			JustifyText("RIGHT");
			Style("TRANSPARENT");
		}

		CreateControl("PlayerLimitEdit", "STATIC")
		{
			ColorGroup("BLACKBLUE");
			Geometry("LEFT", "TOP");
			Position(98, 0);
			Size(19, 9);
			BorderSize(3);
			BevelSize(3);
			JustifyText("LEFT", "OUTLINE");
			Font("TINY");
			Cursor("Highlight");
			UseVar("network.session.ivar2");
			//			SetIntegerRange("network.session.ivar2", 0, 8);
		}

		CreateControl("ExtraOptions", "BUTTON")
		{
			ColorGroup("BLACKBLUE");
			Geometry("RIGHT", "TOP");
			Position(0, 0);
			Size(140, 9);
			BorderSize(3);
			BevelSize(3);
			Style("ROLLOVER", "OUTLINE");
			Cursor("Highlight");
			Font("SMALL");
			Text("Extra Options");
			NotifyParent("Button::Press", "DoExtra");
		}

		CreateControl("TeamsTitle", "STATIC")
		{
			Geometry("LEFT", "TOP");
			Position(0, 20);
			Size(60, 9);
			Font("SMALL");
			Text("Teams:");
			JustifyText("LEFT");
			Style("TRANSPARENT");
		}

		CreateControl("TeamsOff", "BUTTON")
		{
			ColorGroup("BLACKBLUE");
			Geometry("LEFT", "TOP");
			Position(68, 20);
			Size(19, 9);
			BorderSize(3);
			BevelSize(3);
			Style("INERT", "RADIO", "OUTLINE");
			Cursor("Highlight");
			Font("TINY");
			Text("N");
			UseVar("network.session.ivar3");
			Value(0);
		}

		CreateControl("TeamsOn", "BUTTON")
		{
			ColorGroup("BLACKBLUE");
			Geometry("LEFT", "TOP");
			Position(98, 20);
			Size(19, 9);
			BorderSize(3);
			BevelSize(3);
			Style("INERT", "RADIO", "OUTLINE");
			Cursor("Highlight");
			Font("TINY");
			Text("Y");
			UseVar("network.session.ivar3");
			Value(1);
		}

		CreateControl("SyncTitle", "STATIC")
		{
			Geometry("LEFT", "TOP");
			Position(125, 40);
			Size(85, 9);
			Font("SMALL");
			Text("Sync Join:");
			JustifyText("RIGHT");
			Style("TRANSPARENT");
		}

		CreateControl("SyncOff", "BUTTON")
		{
			ColorGroup("BLACKBLUE");
			Geometry("LEFT", "TOP");
			Position(218, 40);
			Size(19, 9);
			BorderSize(3);
			BevelSize(3);
			Style("INERT", "RADIO", "OUTLINE");
			Cursor("Highlight");
			Font("TINY");
			Text("N");
			UseVar("network.session.ivar8");
			Value(0);
		}

		CreateControl("SyncOn", "BUTTON")
		{
			ColorGroup("BLACKBLUE");
			Geometry("LEFT", "TOP");
			Position(248, 40);
			Size(19, 9);
			BorderSize(3);
			BevelSize(3);
			Style("INERT", "RADIO", "OUTLINE");
			Cursor("Highlight");
			Font("TINY");
			Text("Y");
			UseVar("network.session.ivar8");
			Value(1);
		}

		CreateControl("PausingTitle", "STATIC")
		{
			Geometry("LEFT", "TOP");
			Position(125, 60);
			Size(85, 9);
			Font("SMALL");
			Text("Pause Join:");
			JustifyText("RIGHT");
			Style("TRANSPARENT");
		}

		CreateControl("PausingOff", "BUTTON")
		{
			ColorGroup("BLACKBLUE");
			Geometry("LEFT", "TOP");
			Position(218, 60);
			Size(19, 9);
			BorderSize(3);
			BevelSize(3);
			Style("INERT", "RADIO", "OUTLINE");
			Cursor("Highlight");
			Font("TINY");
			Text("N");
			UseVar("network.session.ivar10");
			Value(1);
		}

		CreateControl("PausingOn", "BUTTON")
		{
			ColorGroup("BLACKBLUE");
			Geometry("LEFT", "TOP");
			Position(248, 60);
			Size(19, 9);
			BorderSize(3);
			BevelSize(3);
			Style("INERT", "RADIO", "OUTLINE");
			Cursor("Highlight");
			Font("TINY");
			Text("Y");
			UseVar("network.session.ivar10");
			Value(0);
		}

		OnEvent("DoExtra")
		{
			Cmd("network.session.openextras");
		}

		CreateControl("ShowTeamNames", "BUTTON")
		{
			ColorGroup("BLACKBLUE");
			Geometry("LEFT", "TOP");
			Position(0, 40);
			Size(110, 9);
			BorderSize(3);
			BevelSize(3);
			Style("Rollover", "OUTLINE");
			Cursor("Highlight");
			Font("TINY");
			Text("Team Names");
			NotifyParent("Button::Press","DoShowNames");
		}

		OnEvent("DoShowNames")
		{
			Cmd("network.session.showteamnames");
		}

		CreateControl("MWFTitle", "STATIC")
		{
			Geometry("LEFT", "TOP");
			Position(45, 80);
			Size(165, 9);
			Font("SMALL");
			Text("Multiworld Frequency:");
			JustifyText("LEFT");
			Style("TRANSPARENT");
		}

		CreateControl("MWFEdit", "STATIC")
		{
			ColorGroup("BLACKBLUE");
			Geometry("LEFT", "TOP");
			Position(218, 80);
			Size(49, 9);
			BorderSize(3);
			BevelSize(3);
			JustifyText("LEFT");
			Font("TINY");
			Style("ROLLOVER", "OUTLINE");
			Cursor("Highlight");
			UseVar("network.session.ivar20");
			SetIntegerRange("network.session.ivar20", 1, 20);
		}

	}

	//
	// create the teams window
	//
	CreateControl("Players", "WINDOW")
	{
		ColorGroup("MAGENTA");
		Geometry("RIGHT", "BOTTOM");
		Position(-20, -20);
		Size(270, 100);
		BorderSize(10);
		BevelSize(5);
		TabSize(150, 10);
		Title("Player List");
		TitleFont("MEDIUM");
		Style("RIGHTTAB", "OUTLINE");

		CreateControl("PlayerList", "LISTBOX")
		{
			ColorGroup("BLACKBLUE");

			Geometry("LEFT", "TOP");
			Position(0, 0);
			Size(270, 77);
			CellSize(260, 10);
			BorderSize(5);
			BevelSize(3);
			Font("TINY");
			Style("VSLIDER");
			UseVar("network.session.playerlist");
		}

		CreateControl("ChatTitle", "STATIC")
		{
			Geometry("LEFT", "BOTTOM");
			Position(0, 2);
			Size(50, 10);
			Font("TINY");
			Text("Chat with:");
			JustifyText("LEFT");
			Style("TRANSPARENT");
		}

		CreateControl("ChatAll", "BUTTON")
		{
			ColorGroup("MAGENTA");

			Geometry("LEFT", "BOTTOM");
			Position(60, 2);
			Size(30, 10);
			BorderSize(3);
			BevelSize(2);
			Style("ROLLOVER", "RADIO", "OUTLINE");
			Cursor("Highlight");
			Font("TINY");
			Text("All");
			UseVar("network.session.chattype");
			Value(0);
		}

		CreateControl("ChatOne", "BUTTON")
		{
			ColorGroup("MAGENTA");

			Geometry("LEFT", "BOTTOM");
			Position(105, 2);
			Size(30, 10);
			BorderSize(3);
			BevelSize(2);
			Style("ROLLOVER", "RADIO", "OUTLINE");
			Cursor("Highlight");
			Font("TINY");
			Text("One");
			UseVar("network.session.chattype");
			Value(2);
		}
	}

	//
	// create the "launch" button
	//
	CreateControl("Launch", "BUTTON")
	{
		Geometry("LEFT", "TOP");
		ColorGroup("MAGENTA");
		Position(520, 20);
		Size(95, 0);
		BorderSize(10);
		BevelSize(5);
		Font("SMALL");
		JustifyText("CENTER");
		Text("ENTER GAME");
		Style("ROLLOVER", "OUTLINE", "BLINK");
		Cursor("Highlight");
		NotifyParent("Button::Press", "Launch");
	}

	// handle the launch event
	OnEvent("Launch")
	{
		cmd("shell.stopSound mire22_4.wav");
		Cmd("shell.multi.launch");
		Cmd("network.launch");
	}


	OnEvent("Leave")
	{
		Cmd("network.session.leave");
		// FadeIn/Outs done from NetCommands::DoIfaceLeaveSession() now
	}

	//
	// handle the "back" event
	//
	OnEvent("Back")
	{
		cmd("shell.stopSound mire22_4.wav");
		Cmd("network.session.leave");
		Cmd("network.setoff");
		// FadeIn/Outs done from NetCommands::DoIfaceQuitToMainMenu() now
	}
}



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

	CreateControl("Map", "WINDOW")
	{
		ColorGroup("MAGENTA");

		Geometry("LEFT", "TOP");
		Position(20, 60);
		Size(300, 120);
		BorderSize(10);
		BevelSize(5);
		TabSize(110, 10);
		Title("Map Info");
		TitleFont("SMALL");
		Style("LEFTTAB", "OUTLINE");

		CreateControl("Map", "STATIC")
		{
			ColorGroup("WHITE");
			Geometry("LEFT", "TOP");
			Position(10, 0);
			Size(130, 115);
		}

		CreateControl("MapSpecs", "LISTBOX")
  		{
  			ColorGroup("LISTBOX");
  			Geometry("TOP", "RIGHT");
  			Position(-10, 0);
  			Size(135, 115);
  			CellSize(140, 10);
  			BorderSize(5);
  			BevelSize(3);
  			Font("TINY");
  		}

		OnEvent("FillData")
		{
			Cmd("shell.multi.missionInfo");
		}
	}

	
	//
	// create the "VehicleSelect" button
	//
	CreateControl("VehicleSelect", "BUTTON")
	{
		Geometry("LEFT", "TOP");
		ColorGroup("MAGENTA");
		Position(270, 20);
		Size(100, 0);
		BorderSize(10);
		BevelSize(5);
		Font("SMALL");
		JustifyText("CENTER");
		Text("Choose Vehicle");
		Style("ROLLOVER", "RIGHTTAB", "OUTLINE");
		Cursor("Highlight");
		NotifyParent("Button::Press", "vehSel");
	}
	
	//
	// handle the vehicle selection event
	//
	OnEvent("vehSel")
	{
		FadeOut("|MapInfo_Small");
		FadeIn("|MapButt_Small");
		FadeIn("|ShellMultiVehicle_Small");
	}
}


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

	CreateControl("Map", "WINDOW")
	{
		ColorGroup("MAGENTA");

		Geometry("LEFT", "TOP");
		Position(20, 60);
		Size(420, 120);
		BorderSize(10);
		BevelSize(5);
		TabSize(110, 10);
		Title("Map Info");
		TitleFont("SMALL");
		Style("LEFTTAB", "OUTLINE");

		CreateControl("MapList", "STATIC")
		{
			ColorGroup("LISTBOX");
			Style("VSLIDER");

			Geometry("TOP", "LEFT");
			Position(0, 0);
			Size(120, 25);
			CellSize(120, 10);
			BorderSize(5);
			BevelSize(3);
			Font("TINY");
			UseVar("network.session.svar0");
		}

		CreateControl("Map", "STATIC")
		{
			ColorGroup("WHITE");
			Geometry("LEFT", "TOP");
			Position(140, 0);
			Size(130, 115);
		}

		CreateControl("MapSpecs", "LISTBOX")
  		{
  			ColorGroup("LISTBOX");
  			Geometry("TOP", "RIGHT");
  			Position(0, 0);
  			Size(130, 115);
  			CellSize(140, 10);
  			BorderSize(5);
  			BevelSize(3);
  			Font("TINY");
  		}

		OnEvent("FillData")
		{
			Cmd("shell.multi.missionInfo");
		}
	}

	
	//
	// create the "VehicleSelect" button
	//
	CreateControl("VehicleSelect", "BUTTON")
	{
		Geometry("LEFT", "TOP");
		ColorGroup("MAGENTA");
		Position(270, 20);
		Size(100, 0);
		BorderSize(10);
		BevelSize(5);
		Font("SMALL");
		JustifyText("CENTER");
		Text("Choose Vehicle");
		Style("ROLLOVER", "RIGHTTAB", "OUTLINE");
		Cursor("Highlight");
		NotifyParent("Button::Press", "vehSel");
	}
	
	//
	// handle the vehicle selection event
	//
	OnEvent("vehSel")
	{
		FadeOut("|MapInfo");
		FadeIn("|MapButt");
		FadeIn("|ShellMultiVehicle");
	}
}

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

	//
	// create the "MapButt" button
	//
	CreateControl("MapButton", "BUTTON")
	{
		Geometry("LEFT", "TOP");
		ColorGroup("MAGENTA");
		Position(270, 20);
		Size(100, 0);
		BorderSize(10);
		BevelSize(5);
		Font("SMALL");
		JustifyText("CENTER");
		Text("Map Info");
		Style("ROLLOVER", "RIGHTTAB", "OUTLINE");
		Cursor("Highlight");
		NotifyParent("Button::Press", "mapSel");
	}
	
	//
	// handle the vehicle selection event
	//
	OnEvent("mapSel")
	{
		FadeOut("|MapButt_Small");
		FadeOut("|ShellMultiVehicle_Small");
		FadeIn("|MapInfo_Small");
	}
}

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

	//
	// create the "MapButt" button
	//
	CreateControl("MapButton", "BUTTON")
	{
		Geometry("LEFT", "TOP");
		ColorGroup("MAGENTA");
		Position(270, 20);
		Size(100, 0);
		BorderSize(10);
		BevelSize(5);
		Font("SMALL");
		JustifyText("CENTER");
		Text("Map Info");
		Style("ROLLOVER", "RIGHTTAB", "OUTLINE");
		Cursor("Highlight");
		NotifyParent("Button::Press", "mapSel");
	}
	
	//
	// handle the vehicle selection event
	//
	OnEvent("mapSel")
	{
		FadeOut("|MapButt");
		FadeOut("|ShellMultiVehicle");
		FadeIn("|MapInfo");
	}
}
