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

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

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

		Geometry("LEFT", "BOTTOM");
		Position(20, -30);
		Size(600, 190);
		BorderSize(10);
		BevelSize(5);
		TabSize(150, 10);
		Title("Game Servers");
		TitleFont("MEDIUM");
		Style("LEFTTAB", "OUTLINE");

		//
		// create the "all" filter button
		//
		Createcontrol("All", "BUTTON")
		{
			ColorGroup("LISTBOX");

			Geometry("LEFT", "TOP");
			Position(0, 0);
			Size(90, 10);
			BorderSize(5);
			BevelSize(3);
			Style("ROLLOVER", "RADIO", "OUTLINE");
			Cursor("Highlight");
			Font("SMALL");
			Text("All Games");
			Value(0);
			UseVar("network.session.filter");
		}

		//
		// create the "deathmatch" filter button
		//
		CreateControl("Deathmatch", "BUTTON")
		{
			ColorGroup("BLACKBLUE");

			Geometry("LEFT", "TOP");
			Position(105, 0);
			Size(90, 10);
			BorderSize(5);
			BevelSize(3);
			Style("ROLLOVER", "RADIO", "OUTLINE");
			Cursor("Highlight");
			Font("SMALL");
			Text("Deathmatch");
			Value(1);
			UseVar("network.session.filter");
		}

		//
		// create the "strategy" filter button
		//
		CreateControl("Strategy", "BUTTON")
		{
			ColorGroup("BLACKBLUE");

			Geometry("LEFT", "TOP");
			Position(210, 0);
			Size(90, 10);
			BorderSize(5);
			BevelSize(3);
			Style("ROLLOVER", "RADIO", "OUTLINE");
			Cursor("Highlight");
			Font("SMALL");
			Text("Strategy");
			Value(2);
			UseVar("network.session.filter");
		}

		//
		// create the refresh button for the impatient
		//
		CreateControl("Refresh", "BUTTON")
		{
			ColorGroup("MAGENTA");

			Geometry("LEFT", "TOP");
			Position(325, 0);
			Size(90, 10);
			BorderSize(5);
			BevelSize(3);
			Style("ROLLOVER", "OUTLINE");
			Cursor("Highlight");
			Font("SMALL");
			Text("Refresh");
			NotifyParent("Button::Press", "Refresh");
		}
	
		CreateControl("ConnectTitle", "STATIC")
		{
			Geometry("LEFT", "TOP");
			Position(440, 0);
			Size(80, 10);
			Font("TINY");
			Text("Type:");
			JustifyText("LEFT");
			Style("TRANSPARENT");
		}

		CreateControl("LanOnly", "BUTTON")
		{
			ColorGroup("MAGENTA");
			Position(500, 0);
			Size(100, 10);
			BorderSize(5);
			BevelSize(3);
			Font("TINY");
			Style("ROLLOVER", "Toggle", "OUTLINE");
			Text("Lan Only"); // Text changed by code to stuff from Localize.odf
			Cursor("Highlight");
			UseVar("network.lanonly");
		}

		// These static controls are the column titles for the columns of
		// player info
		CreateControl("ColumnTitle1", "BUTTON")
		{
			ColorGroup("LISTBOX");
			Geometry("LEFT", "TOP");
			JustifyText("LEFT");
			Position(10, 20);
			Size(150, 15);
			Font("SMALL");
			Text("Game Name");
			Style("TRANSPARENT", "ROLLOVER");
			Cursor("Highlight");
			NotifyParent("Button::Press", "SortName");
		}
		CreateControl("ColumnTitle2", "BUTTON")
		{
			ColorGroup("LISTBOX");
			Geometry("LEFT", "TOP");
			JustifyText("LEFT");
			Position(200, 20);
			Size(30, 15);
			Font("SMALL");
			Text("Pwd");
			Style("TRANSPARENT", "ROLLOVER");
			Cursor("Highlight");
			NotifyParent("Button::Press", "SortPwd");
		}
		CreateControl("ColumnTitle3", "BUTTON")
		{
			ColorGroup("LISTBOX");
			Geometry("LEFT", "TOP");
			JustifyText("LEFT");
			Position(230, 20);
			Size(60, 15);
			Font("SMALL");
			Text("Ping");
			Style("TRANSPARENT", "ROLLOVER");
			Cursor("Highlight");
			NotifyParent("Button::Press", "SortPing");
		}
		CreateControl("ColumnTitle4", "BUTTON")
		{
			ColorGroup("LISTBOX");
			Geometry("LEFT", "TOP");
			JustifyText("LEFT");
			Position(290, 20);
			Size(60, 15);
			Font("SMALL");
			Text("Players");
			Style("TRANSPARENT", "ROLLOVER");
			Cursor("Highlight");
			NotifyParent("Button::Press", "SortPlayers");
		}
		CreateControl("ColumnTitle5", "BUTTON")
		{
			ColorGroup("LISTBOX");
			Geometry("LEFT", "TOP");
			JustifyText("LEFT");
			Position(350, 20);
			Size(150, 15);
			Font("SMALL");
			Text("Map Name");
			Style("TRANSPARENT", "ROLLOVER");
			Cursor("Highlight");
			NotifyParent("Button::Press", "SortMap");
		}
		CreateControl("ColumnTitle6", "BUTTON")
		{
			ColorGroup("LISTBOX");
			Geometry("LEFT", "TOP");
			JustifyText("LEFT");
			Position(500, 20);
			Size(100, 15);
			Font("SMALL");
			Text("Game Type");
			Style("TRANSPARENT", "ROLLOVER");
			Cursor("Highlight");
			NotifyParent("Button::Press", "SortType");
		}

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

		//
		// create the server list column listboxen
		//
		CreateControl("SessionList1", "LISTBOX")
		{
			ColorGroup("LISTBOX");
			Geometry("LEFT", "TOP");
			Position(0, 35);
			Size(210, 160);
			CellSize(210, 10);
			Font("Tiny");
			UseVar("network.session.namecrc");
			UseSlider("<SelectionSlider");
		}
		CreateControl("SessionList2", "LISTBOX")
		{
			ColorGroup("LISTBOX");
			Geometry("LEFT", "TOP");
			Position(210, 35);
			Size(20, 160);
			CellSize(20, 10);
			Font("Tiny");
			UseVar("network.session.namecrc");
			UseSlider("<SelectionSlider");
		}
		CreateControl("SessionList3", "LISTBOX")
		{
			ColorGroup("LISTBOX");
			Geometry("LEFT", "TOP");
			Position(230, 35);
			Size(60, 160);
			CellSize(60, 10);
			Font("Tiny");
			UseVar("network.session.namecrc");
			UseSlider("<SelectionSlider");
		}
		CreateControl("SessionList4", "LISTBOX")
		{
			ColorGroup("LISTBOX");
			Geometry("LEFT", "TOP");
			Position(290, 35);
			Size(60, 160);
			CellSize(60, 10);
			Font("Tiny");
			UseVar("network.session.namecrc");
			UseSlider("<SelectionSlider");
		}
		CreateControl("SessionList5", "LISTBOX")
		{
			ColorGroup("LISTBOX");
			Geometry("LEFT", "TOP");
			Position(350, 35);
			Size(150, 160);
			CellSize(150, 10);
			Font("Tiny");
			UseVar("network.session.namecrc");
			UseSlider("<SelectionSlider");
		}
		CreateControl("SessionList6", "LISTBOX")
		{
			ColorGroup("LISTBOX");
			Geometry("LEFT", "TOP");
			Position(500, 35);
			Size(90, 160);
			CellSize(90, 10);
			Font("Tiny");
			UseVar("network.session.namecrc");
			UseSlider("<SelectionSlider");
		}

		OnEvent("Refresh")
		{
			Cmd("network.enumsessions");
		}

		OnEvent("SortName")
		{
			Cmd("network.sortname");
		}
		OnEvent("SortPwd")
		{
			Cmd("network.sortpwd");
		}
		OnEvent("SortPing")
		{
			Cmd("network.sortping");
		}
		OnEvent("SortPlayers")
		{
			Cmd("network.sortplayers");
		}
		OnEvent("SortMap")
		{
			Cmd("network.sortmap");
		}
		OnEvent("SortType")
		{
			Cmd("network.sorttype");
		}

		OnEvent("Control::Activate")
		{
			cmd("shell.background multip_1.tga");
			Cmd("network.session.autorefreshon");
		}

		OnEvent("Control::Deactivate")
		{
			Cmd("network.session.autorefreshoff");
		}
	}

	//
	// create the "join" button
	//
	CreateControl("Join", "BUTTON")
	{
		ColorGroup("MAGENTA");
		Position(521, 19); // 270, 19
		Size(95, 0);
		BorderSize(10);
		BevelSize(5);
		Font("MEDIUM");
		Style("ROLLOVER", "OUTLINE");
		Text("Join Game");
		Cursor("Highlight");
		NotifyParent("Button::Press", "Join");
	}

	//
	// create the "create" button
	//
	CreateControl("Create", "BUTTON")
	{
		ColorGroup("MAGENTA");
		Position(145, 19); // 145, 19 
		Size(95, 0);
		BorderSize(10);
		BevelSize(5);
		Font("MEDIUM");
		Style("ROLLOVER", "OUTLINE");
		Text("New Game");
		Cursor("Highlight");
		NotifyParent("Button::Press", "Create");
	}

	//
	// create the "join ip" button
	//
	CreateControl("JoinIP", "BUTTON")
	{
		ColorGroup("MAGENTA");
		Position(270, 19);
		Size(95, 0);
		BorderSize(10);
		BevelSize(5);
		Font("MEDIUM");
		Style("ROLLOVER", "OUTLINE");
		Text("Join IP");
		Cursor("Highlight");
		NotifyParent("Button::Press", "JoinIP");
	}

	//
	// create the "chat" button
	//
	CreateControl("ChatToggle", "BUTTON")
	{
		ColorGroup("MAGENTA");
		Position(396, 19); // 521, 19
		Size(95, 0);
		BorderSize(10);
		BevelSize(5);
		Font("MEDIUM");
		Style("ROLLOVER", "OUTLINE");
		Text("Chat");
		Cursor("Highlight");
		NotifyParent("Button::Press", "DoChatToggle");
	}

	// handle the create event
	OnEvent("Create")
	{
		FadeOut("|NetworkScanning");
		FadeIn("|GameName");
	}

	// handle the launch event
	OnEvent("Join")
	{
		FadeOut("|NetworkScanning");
		Cmd("network.session.join");
	}

	// handle the launch event
	OnEvent("JoinIP")
	{
		FadeOut("|NetworkScanning");
		FadeIn("|JoinIPDialog");
	}

	// handle the launch event
	OnEvent("DoChatToggle")
	{
		Cmd("network.chattoggle");
	}
}

