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

//
// CREATE SHELL MULTIPLAYER G66 3.1 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(60, 60);
		Size(285, 0);
		BorderSize(30);
		BevelSize(15);
		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(435, 60);
		Size(285, 0);
		BorderSize(30);
		BevelSize(15);
		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(-60, 690);
		Size(810, 15);
		BorderSize(30);
		BevelSize(15);
		TabSize(330, 30);
		Title("Options");
		TitleFont("MEDIUM");
		Style("RIGHTTAB", "INERT", "OUTLINE");

		CreateControl("GameOptions", "BUTTON")
		{
			ColorGroup("BLACKBLUE");
			Geometry("LEFT", "TOP");
			Position(9, 0);
			Size(330, 27);
			BorderSize(9);
			BevelSize(9);
			Style("ROLLOVER", "OUTLINE");
			Cursor("Highlight");
			Font("SMALL");
			Text("Game Options");
			NotifyParent("Button::Press", "DoGameOpts");
		}

		OnEvent("DoGameOpts")
		{
			FadeOut("ShellMultiTeam");
			Cmd("network.session.opengameopts");
		}

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

		OnEvent("DoExtra")
		{
			FadeOut("ShellMultiTeam");
			Cmd("network.session.openextras");
			Cmd("network.session.ivar101 2"); 
		}
	}

	//
	// create the teams window
	//
	CreateControl("Players", "WINDOW")
	{
		ColorGroup("MAGENTA");
		Geometry("RIGHT", "BOTTOM");
		Position(-60, -60);
		Size(810, 564);
		BorderSize(30);
		BevelSize(15);
		TabSize(450, 30);
		Title("Player List");
		TitleFont("MEDIUM");
		Style("RIGHTTAB", "OUTLINE");

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

			Geometry("LEFT", "TOP");
			Position(0, 0);
			Size(810, 321);
			CellSize(780, 30);
			BorderSize(15);
			BevelSize(9);
			Font("TINY");
			Style("VSLIDER");
			UseVar("network.session.playerlist");
		}

		CreateControl("VoiceChatTitle", "STATIC")
		{
			Geometry("LEFT", "BOTTOM");
			Position(0, -51);
			Size(150, 30);
			Font("TINY");
			Text("Voice chat:");
			JustifyText("LEFT");
			Style("TRANSPARENT");
		}

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

			Geometry("LEFT", "BOTTOM");
			Position(180, -51);
			Size(90, 30);
			BorderSize(9);
			BevelSize(6);
			Style("ROLLOVER", "RADIO", "OUTLINE");
			Cursor("Highlight");
			Font("TINY");
			Text("All");
			UseVar("network.session.voicechattype");
			Value(0);
		}

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

			Geometry("LEFT", "BOTTOM");
			Position(315, -51);
			Size(90, 30);
			BorderSize(9);
			BevelSize(6);
			Style("ROLLOVER", "RADIO", "OUTLINE");
			Cursor("Highlight");
			Font("TINY");
			Text("One");
			UseVar("network.session.voicechattype");
			Value(2);
		}


		CreateControl("ChatTitle", "STATIC")
		{
			Geometry("LEFT", "BOTTOM");
			Position(0, 6);
			Size(150, 30);
			Font("TINY");
			Text("Text chat:");
			JustifyText("LEFT");
			Style("TRANSPARENT");
		}

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

			Geometry("LEFT", "BOTTOM");
			Position(180, 6);
			Size(90, 30);
			BorderSize(9);
			BevelSize(6);
			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(315, 6);
			Size(90, 30);
			BorderSize(9);
			BevelSize(6);
			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(1560, 60);
		Size(285, 0);
		BorderSize(30);
		BevelSize(15);
		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(60, 180);
		Size(900, 360);
		BorderSize(30);
		BevelSize(15);
		TabSize(330, 30);
		Title("Map Info");
		TitleFont("SMALL");
		Style("LEFTTAB", "OUTLINE");

		CreateControl("Map", "STATIC")
		{
			ColorGroup("WHITE");
			Geometry("LEFT", "TOP");
			Position(30, 0);
			Size(390, 345);
		}

		CreateControl("MapSpecs", "LISTBOX")
  		{
  			ColorGroup("LISTBOX");
  			Geometry("TOP", "RIGHT");
  			Position(-30, 0);
  			Size(390, 360);
  			CellSize(360, 30);
  			BorderSize(15);
  			BevelSize(9);
			Style("INERT", "VSLIDER");
  			Font("TINY");
  		}

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

	
	//
	// create the "VehicleSelect" button
	//
	CreateControl("VehicleSelect", "BUTTON")
	{
		Geometry("LEFT", "TOP");
		ColorGroup("MAGENTA");
		Position(810, 60);
		Size(300, 0);
		BorderSize(30);
		BevelSize(15);
		Font("SMALL");
		JustifyText("CENTER");
		Text("My 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(60, 180);
		Size(1260, 360);
		BorderSize(30);
		BevelSize(15);
		TabSize(330, 30);
		Title("Map Info");
		TitleFont("SMALL");
		Style("LEFTTAB", "OUTLINE");

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

			Geometry("TOP", "LEFT");
			Position(0, 0);
			Size(360, 75);
			CellSize(360, 30);
			BorderSize(15);
			BevelSize(9);
			Font("TINY");
			UseVar("network.session.svar0");
		}

		CreateControl("Map", "STATIC")
		{
			ColorGroup("WHITE");
			Geometry("LEFT", "TOP");
			Position(420, 0);
			Size(390, 345);
		}

		CreateControl("MapSpecs", "LISTBOX")
  		{
  			ColorGroup("LISTBOX");
  			Geometry("TOP", "RIGHT");
  			Position(0, 0);
  			Size(390, 360);
  			CellSize(360, 30);
  			BorderSize(15);
  			BevelSize(9);
			Style("INERT", "VSLIDER");
  			Font("TINY");
  		}

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

	
	//
	// create the "VehicleSelect" button
	//
	CreateControl("VehicleSelect", "BUTTON")
	{
		Geometry("LEFT", "TOP");
		ColorGroup("MAGENTA");
		Position(810, 60);
		Size(300, 0);
		BorderSize(30);
		BevelSize(15);
		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(810, 60);
		Size(300, 0);
		BorderSize(30);
		BevelSize(15);
		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(810, 60);
		Size(300, 0);
		BorderSize(30);
		BevelSize(15);
		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");
	}
}
