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


Exec("bzshell_multi_option_x2_5.cfg");
Exec("bzshell_multi_clientoption_x2_5.cfg");
Exec("bzshell_multi_vehicle_x2_5.cfg");
Exec("bzshell_multi_chat_x2_5.cfg");
Exec("bzshell_multi_join_x2_5.cfg");
Exec("bzshell_multi_name_x2_5.cfg");
Exec("bzshell_multi_team_x2_5.cfg");
Exec("bzshell_multi_teamnames_x2_5.cfg");
Exec("bzshell_multi_scanning_x2_5.cfg");
Exec("bzshell_multi_password_x2_5.cfg");
Exec("bzshell_multi_server_info_x2_5.cfg");
Exec("bzshell_multi_irc_x2_5.cfg");
//Exec("bzshell_multi_warn_player.cfg");
//Exec("bzshell_multi_warn_unit.cfg");
Exec("bzshell_multi_warn_badping_x2_5.cfg");
Exec("bzshell_multi_warn_wrongversion_x2_5.cfg");
Exec("bzshell_multi_warn_obsolete_x2_5.cfg");
Exec("bzshell_multi_warn_downloadmap_x2_5.cfg");
Exec("bzshell_multi_warn_lockdown_x2_5.cfg");
Exec("bzshell_multi_warn_mods_x2_5.cfg");
Exec("bzshell_multi_end_x2_5.cfg");
Exec("bzshell_multi_joinip_x2_5.cfg");

//
// CREATE SHELL MULTIPLAYER CONNECTION PAGE
//
CreateControl("ShellMulti", "WINDOW")
{
	// inherit root window's dimensions
	Geometry("PARENTWIDTH", "PARENTHEIGHT");

	// set window style
	Style("TRANSPARENT", "INERT");
	//
	// CREATE THE BUTTON WINDOW
	//
	CreateControl("BUTTONS", "WINDOW")
	{
	
		Geom("PARENTWIDTH", "PARENTHEIGHT");
		Style("TRANSPARENT", "INERT");

		//
		// create the "back" button
		//
		CreateControl("Back", "BUTTON")
		{
			ColorGroup("MAGENTA");
			Position(50, 50);
			Size(238, 0);
			BorderSize(25);
			BevelSize(13);
			Style("ROLLOVER", "OUTLINE");
			Text("Main");
			Font("MEDIUM");
			Cursor("Highlight");
			NotifyParent("Button::Press", "Back");
		//	UseVar("shell.page");
		//	Value(0);
		}

		//
		// handle the "back" event
		//
		OnEvent("Back")
		{
			FadeOut("|Communications");
			FadeOut("|ShellMultiVehicle");
			FadeOut("|ShellMultiJoin");
			FadeOut("|ShellMulti");
			cmd("shell.stopSound mire22_4.wav");
			Cmd("network.quittomainmenu");
			FadeIn("|ShellMain");
		}

	}

	OnEvent("Control::Activate")
	{
		FadeIn("|ShellMultiJoin");
		FadeIn("|ShellMulti");
		FadeIn("|ShellMultiServerInfo");
		FadeOut("|NetworkScanning");
		cmd("shell.backgroundSound mire22_4.wav");
		cmd("shell.background multip_1a.tga");
		Cmd("network.session.ivar9 0");
		Cmd("network.seton");
	}

	OnEvent("Control::StartFadeIn")
	{
		FadeIn("|ShellMultiJoin");
	}

	OnEvent("Control::StartFadeOut")
	{
		FadeOut("|ShellMultiOption");
		FadeOut("|ShellMultiClientOption");
		FadeOut("|ShellMultiVehicle");
		FadeOut("|ShellMultiJoin");
		FadeOut("|ShellMultiTeam");
		FadeOut("|ShellMultiServerInfo");
	}


	//
	// handle the "signup" event
	//
	OnEvent("ChatEnter")
	{
		Cmd("network.chatline.entered");
	}

	//
	// handle the "connect" event
	//
	OnEvent("Connect")
	{
		FadeOut("|ShellMultiOption");
		FadeOut("|ShellMultiClientOption");
		FadeOut("|ShellMultiVehicle");
		FadeOut("|ShellMultiServerInfo");
		FadeOut("|ShellMultiJoin");
	}

	//
	// handle the join event
	//
	OnEvent("Join")
	{
		FadeOut("|ShellMultiOption");
		FadeOut("|ShellMultiClientOption");
		FadeOut("|ShellMultiServerInfo");
		FadeIn("|ShellMultiJoin");
		FadeIn("|ShellMultiVehicle");
	}

	//
	// handle the "vehicle" event
	//
	OnEvent("Vehicle")
	{
		FadeOut("|ShellMultiOption");
		FadeOut("|ShellMultiClientOption");
		FadeOut("|ShellMultiJoin");
		FadeOut("|ShellMultiServerInfo");
		FadeIn("|ShellMultiVehicle");
	}
}

