ConfigureVarSys()
{
	
	CreateInteger("mission.var1", 0);
	SetIntegerRange("mission.var1", 0, 45);

	CreateInteger("mission.var2", 0);
	SetIntegerRange("mission.var2", 0, 45);

	CreateInteger("mission.var3", 0);
	SetIntegerRange("mission.var3", 0, 45);

	CreateInteger("race.count",1);
	SetIntegerRange("race.count", 1, 4);
	
	CreateInteger("end.end",0);
	SetIntegerRange("end.end", 0,1);
	
	CreateInteger("pool.remove",0);
	SetIntegerRange("pool.remove", 0,1);
	
	CreateInteger("pool.own",0);
	SetIntegerRange("pool.own", 0,1);
	
	CreateInteger("start.force",0);
	SetIntegerRange("start.force", 0,2);

	CreateString("images.models", "fvscout_skel.xsi");
}

CreateControl("INFO", "STATIC")
{

	Geom("HCENTRE", "VCENTRE");


	Size(3024, 2900);


	BorderSize(0);
	BevelSize(0);


	TabSize(400, 30);

	Style("OUTLINE", "INERT");

	Title("Choose your race");
	ColorGroup("LISTBOX");
	TitleFont("MEDIUM");

	CreateControl("Image1", "Static")
	{
		ColorGroup("WHITE");
		Geom("Top", "Left");
//	Geom("HCENTRE", "VCENTRE");
		Size(1024, 900);
		Pos(2, 2);
		Image("3way.bmp",  0, 0, 512, 450);
//       Image("3way.bmp", 0, 0, "CENTRE");
	}


	CreateControl("Messages", "ListBox")
	{
		Geometry("Top", "Left");
		Pos(160, 360);
		Size(360, 260);
		CellSize(360, 20);
		BorderSize(0);
		BevelSize(0);
		ColorGroup("LISTBOX");
		Font("SMALL");
		Style("NOSELECTION", "Outline");
		ItemConfig()
		{
			Style("TRANSPARENT");
		}
		AddTextItem("Choose amount of scrap");
		AddTextItem("given to each team (incl.");
		AddTextItem("player!) each minute.");
		AddTextItem("Values from 0 to 45");
		AddTextItem("");
		AddTextItem("Cerberi:");
		AddTextItem("");
		AddTextItem("Scion:");
		AddTextItem("");
		AddTextItem("EDF:");
		AddTextItem("");
		AddTextItem("Hadean:");	
	}

	CreateControl("EditBox", "Edit")
	{
		Geometry("Top", "Left");
		Pos(320, 460);
		Size(100, 20);
		Font("SMALL");
		UseVar("mission.var1");
		Style("Rollover", "Outline");
		Cursor("Highlight");
	}

	CreateControl("EditBox", "Edit")
	{
		Geometry("Top", "Left");
		Pos(320, 500);
		Size(100, 20);
		Font("SMALL");
		UseVar("mission.var2");
		Style("Rollover", "Outline");
		Cursor("Highlight");
	}

	CreateControl("EditBox", "Edit")
	{
		Geometry("Top", "Left");
		Pos(320, 540);
		Size(100, 20);
		Font("SMALL");
		UseVar("mission.var3");
		Style("Rollover", "Outline");
		Cursor("Highlight");
	}

	CreateControl("EditBox", "Edit")
	{
		Geometry("Top", "Left");
		Pos(320, 580);
		Size(100, 20);
		Font("SMALL");
		UseVar("mission.var3");
		Style("Rollover", "Outline");
		Cursor("Highlight");
	}

	CreateControl("Pool", "ListBox")
	{
		Geometry("Top", "Left");
		Pos(160, 640);
		Size(360, 120);
		CellSize(360, 20);
		BorderSize(0);
		BevelSize(0);
		ColorGroup("LISTBOX");
		Font("SMALL");
		Style("NOSELECTION", "Outline");
		ItemConfig()
		{
			Style("TRANSPARENT");
		}		
		AddTextItem("Remove pools in");
		AddTextItem("base area?");
		AddTextItem("(overrides keep_your_own)");
	}
	
	CreateControl("poolyes", "BUTTON")
	{
			Pos(380, 720);
			Size(100, 20);
			BorderSize(6);
			BevelSize(6);
			Font("TINY");
			Text("YES");
			ColorGroup("LISTBOX");
			Style("ROLLOVER", "RADIO", "OUTLINE");
			UseVar("pool.remove");
			Value(1);
			NotifyParent("Button::Select", "PoolYes");
	}
	


	CreateControl("poolno", "BUTTON")
	{
			Pos(200, 720);
			Size(100, 20);
			BorderSize(6);
			BevelSize(6);
			Font("TINY");
			Text("NO");
			ColorGroup("LISTBOX");
			Style("ROLLOVER", "RADIO", "OUTLINE");
			UseVar("pool.remove");
			Value(0);
			NotifyParent("Button::Select", "PoolNo");
	}

		CreateControl("Starting", "ListBox")
	{
		Geometry("Top", "Left");
		Pos(560, 400);
		Size(360, 120);
		CellSize(360, 20);
		BorderSize(0);
		BevelSize(0);
		ColorGroup("LISTBOX");
		Font("SMALL");
		Style("NOSELECTION", "Outline");
		ItemConfig()
		{
			Style("TRANSPARENT");
		}
		AddTextItem("Choose players");
		AddTextItem("starting force");
		AddTextItem("");
	}

	CreateControl("startno", "BUTTON")
	{
			Pos(580, 480);
			Size(80, 20);
			BorderSize(6);
			BevelSize(6);
			Font("TINY");
			Text("NO");
			ColorGroup("LISTBOX");
			Style("ROLLOVER", "RADIO", "OUTLINE");
			UseVar("start.force");
			Value(0);
			NotifyParent("Button::Select", "StartNo");
	}

		CreateControl("startsmall", "BUTTON")
	{
			Pos(680, 480);
			Size(100, 20);
			BorderSize(6);
			BevelSize(6);
			Font("TINY");
			Text("SMALL");
			ColorGroup("LISTBOX");
			Style("ROLLOVER", "RADIO", "OUTLINE");
			UseVar("start.force");
			Value(1);
			NotifyParent("Button::Select", "StartNo");
	}

		CreateControl("startlarge", "BUTTON")
	{
			Pos(800, 480);
			Size(100, 20);
			BorderSize(6);
			BevelSize(6);
			Font("TINY");
			Text("LARGE");
			ColorGroup("LISTBOX");
			Style("ROLLOVER", "RADIO", "OUTLINE");
			UseVar("start.force");
			Value(2);
			NotifyParent("Button::Select", "StartNo");
	}

	CreateControl("ownPool", "ListBox")
	{
		Geometry("Top", "Left");
		Pos(560, 560);
		Size(360, 120);
		CellSize(360, 20);
		BorderSize(0);
		BevelSize(0);
		ColorGroup("LISTBOX");
		Font("SMALL");
		Style("NOSELECTION", "Outline");
		ItemConfig()
		{
			Style("TRANSPARENT");
		}
		AddTextItem("Keep your own base pool");
		AddTextItem("Very easy setting = yes");
		AddTextItem("");
	}
	
	CreateControl("ownpoolyes", "BUTTON")
	{
			Pos(600, 640);
			Size(100, 20);
			BorderSize(6);
			BevelSize(6);
			Font("TINY");
			Text("YES");
			ColorGroup("LISTBOX");
			Style("ROLLOVER", "RADIO", "OUTLINE");
			UseVar("pool.own");
			Value(1);
			NotifyParent("Button::Select", "PoolYes");
	}
	


	CreateControl("ownpoolno", "BUTTON")
	{
			Pos(780, 640);
			Size(100, 20);
			BorderSize(6);
			BevelSize(6);
			Font("TINY");
			Text("NO");
			ColorGroup("LISTBOX");
			Style("ROLLOVER", "RADIO", "OUTLINE");
			UseVar("pool.own");
			Value(0);
			NotifyParent("Button::Select", "PoolNo");
	}


	CreateControl("CerberiButt", "BUTTON")
	{
		Pos(192, 142);
		Size(150, 20);
		BorderSize(10);
		BevelSize(10);
		Font("TINY");
		Text("CERBERI");
		ColorGroup("LISTBOX");
		Style("ROLLOVER", "RADIO", "OUTLINE");
		UseVar("race.count");
		Value(1);
		NotifyParent("Button::Select", "Cerberi");
	}

	CreateControl("ScionButt", "BUTTON")
	{
		Pos(192, 192);
		Size(150, 20);
		BorderSize(10);
		BevelSize(10);
		Font("TINY");
		Text("SCION");
		ColorGroup("LISTBOX");
		Style("ROLLOVER", "RADIO", "OUTLINE");
		UseVar("race.count");
		Value(2);
		NotifyParent("Button::Select", "Scion");
	}

	CreateControl("EDFButt", "BUTTON")
	{
		Pos(192, 242);
		Size(150, 20);
		BorderSize(10);
		BevelSize(10);
		Font("TINY");
		ColorGroup("LISTBOX");
		Text("EDF");
		Style("ROLLOVER", "RADIO", "OUTLINE");
		Value(3);
		UseVar("race.count");

		NotifyParent("Button::Select", "EDF");
	}

	CreateControl("HadeanButt", "BUTTON")
	{
		Pos(192, 292);
		Size(150, 20);
		BorderSize(10);
		BevelSize(10);
		Font("TINY");
		ColorGroup("LISTBOX");
		Text("HADEAN");
		Style("ROLLOVER", "RADIO", "OUTLINE");
		Value(4);
		UseVar("race.count");

		NotifyParent("Button::Select", "Hadean");
	}

	CreateControl("ReturnButt", "BUTTON")
	{
		Pos(456, 182);
		Size(110, 30);
		BorderSize(10);
		BevelSize(10);
		ColorGroup("LISTBOX");
		Font("SMALL");
		Text("START");
		Style("ROLLOVER","RADIO","OUTLINE");
		NotifyParent("Button::Select", "Return");
	}


	OnEvent("Cerberi")
	{
//		Cmd("end.end 0");
		Deactivate("|Start");
		Deactivate("|Scion");
		Deactivate("|EDF");
		Deactivate("|Hadean");
		Cmd("race.count 1");
		Cmd("images.models cvscout00.xsi");	
		Activate("|Cerberi");
	}

	OnEvent("Scion")
	{
//		Cmd("end.end 0");
		Deactivate("|Start");
		Deactivate("|Cerberi");
		Deactivate("|EDF");
		Deactivate("|Hadean");
		Cmd("race.count 2");
		Cmd("images.models fvscout_skel.xsi");	
		Activate("|Scion");
	}

	OnEvent("EDF")
	{
//		Cmd("end.end 0");
		Deactivate("|Start");
		Deactivate("|Cerberi");
		Deactivate("|Scion");
		Deactivate("|Hadean");
		Cmd("race.count 3");
		Cmd("images.models ivscout00.xsi");	
		Activate("|EDF");
	}

	OnEvent("Hadean")
	{
//		Cmd("end.end 0");
		Deactivate("|Start");
		Deactivate("|Cerberi");
		Deactivate("|Scion");
		Deactivate("|EDF");
		Cmd("race.count 4");	
		Cmd("images.models evscout00.xsi");	
		Activate("|Hadean");
	}

	
	OnEvent("Return")
	{

		Cmd("end.end 1");	
	
	}

	
	OnEvent("Control::Activate")
	{
		Cmd("race.count 0");
		Cmd("end.end 0");
		Cmd("start.force 0");
		Cmd("pool.remove 0");
		Cmd("pool.own 0");
//		Activate("|INFO");
		Activate("|Start");
	}

		OnEvent("Control::Deactivate")
	{
		
		Deactivate("|Start");
		Deactivate("|Cerberi");
		Deactivate("|Scion");
		Deactivate("|EDF");
		Deactivate("|Hadean");
	}
}

CreateControl("Start", "STATIC")
{
	Geom("HCENTRE", "VCENTRE");
	Pos(0, 0);
	Size(1024, 900);
	Style("OUTLINE");
	BevelSize(0);




		CreateControl("List", "LISTBOX")
	{
		Style("INERT", "NOSELECTION", "VSLIDER");
		Geometry("LEFT", "TOP");
		Position(600, 20);
		Size(400, 340);
		CellSize(360, 20);
		SliderPadding(10);
		Font("SMALL");
		ColorGroup("LISTBOX");
		ItemConfig()
		{
			Style("TRANSPARENT");
		}
		FillFromFile("3way.txt");
	}



}

CreateControl("Cerberi", "STATIC")
{
	Geom("HCENTRE", "VCENTRE");
	Pos(0, 0);
	Size(1024, 900);
	Style("OUTLINE");
	BevelSize(6);

	

	CreateControl("XSIView", "VIEWER")
	{
		Geom("TOP", "LEFT");
		Position(600, 20);
		Size(400, 340);
		BorderSize(10);
		BevelSize(6);
		ColorGroup("LISTBOX");


		UseVar("images.models");


		SetAmbientColor(1.0, 1.0, 1.0);
		SetDiffuseColor(1.0, 1.0, 1.0);
		SetDiffuseDir(2.0, -5.0, 1.0);
		SetModelDistance(100.0);
		SetModelInclination(0.0);
		SetModelRotation(60.0);
	}

}

CreateControl("Scion", "STATIC")
{
	Geom("HCENTRE", "VCENTRE");
	Pos(0, 0);
	Size(1024, 900);
	Style("OUTLINE");
	BevelSize(6);

	

	CreateControl("XSIView", "VIEWER")
	{
		Geom("TOP", "LEFT");
		Position(600, 20);
		Size(400, 340);
		BorderSize(10);
		BevelSize(6);
		ColorGroup("LISTBOX");


		UseVar("images.models");


		SetAmbientColor(1.0, 1.0, 1.0);
		SetDiffuseColor(1.0, 1.0, 1.0);
		SetDiffuseDir(2.0, -5.0, 1.0);
		SetModelDistance(100.0);
		SetModelInclination(0.0);
		SetModelRotation(60.0);
	}

}

CreateControl("EDF", "STATIC")
{
	Geom("HCENTRE", "VCENTRE");
	Pos(0, 0);
	Size(1024, 900);
	Style("OUTLINE");
	BevelSize(6);




	CreateControl("XSIView", "VIEWER")
	{
		Geom("TOP", "LEFT");
		Position(600, 20);
		Size(400, 340);
		BorderSize(10);
		BevelSize(6);
		ColorGroup("LISTBOX");


		UseVar("images.models");


		SetAmbientColor(1.0, 1.0, 1.0);
		SetDiffuseColor(1.0, 1.0, 1.0);
		SetDiffuseDir(2.0, -5.0, 1.0);
		SetModelDistance(100.0);
		SetModelInclination(0.0);
		SetModelRotation(60.0);
	}


}

CreateControl("Hadean", "STATIC")
{
	Geom("HCENTRE", "VCENTRE");
	Pos(0, 0);
	Size(1024, 900);
	Style("OUTLINE");
	BevelSize(6);


	
	CreateControl("XSIView", "VIEWER")
	{
		Geom("TOP", "LEFT");
		Position(600, 20);
		Size(400, 340);
		BorderSize(10);
		BevelSize(6);
		ColorGroup("LISTBOX");

		UseVar("images.models");
		
		SetAmbientColor(1.0, 1.0, 1.0);
		SetDiffuseColor(1.0, 1.0, 1.0);
		SetDiffuseDir(2.0, -5.0, 1.0);
		SetModelDistance(100.0);
		SetModelInclination(0.0);
		SetModelRotation(60.0);
	}
}

CreateControl("INFO2", "STATIC")
{

	Geom("HCENTRE", "VCENTRE");


	Size(624, 472);


	BorderSize(0);
	BevelSize(0);


	TabSize(400, 30);

	Style("OUTLINE", "INERT");

	Title("Calculating");
	ColorGroup("LISTBOX");
	TitleFont("MEDIUM");

	CreateControl("Image1", "Static")
	{
		ColorGroup("WHITE");
		Geom("Top", "Left");
		Size(624, 472);
		Pos(0, 0);
		Image("3way2.bmp", 0, 0, 312, 236);
	}

	
}
