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("mission.var4", 0);
	SetIntegerRange("mission.var4", 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(512,450);

	BorderSize(0);
	BevelSize(0);

	TabSize(200, 15);

	Style("OUTLINE", "INERT");

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

	CreateControl("Image1", "Static")
	{
		ColorGroup("WHITE");
		Geom("Top", "Left");
		Size(512,450);
		Pos(1,1);
		Image("3way.bmp", 0,0,512,450);
	}

	CreateControl("Start", "LISTBOX")
	{
		Style("INERT", "NOSELECTION", "VSLIDER");
		Geometry("Top", "Left");
		Position(300,10);
		Size(200, 170);
		CellSize(180, 10);
		SliderPadding(10);
		Font("Tiny");
		ColorGroup("LISTBOX");
		ItemConfig()
		{
			Style("TRANSPARENT");
		}
		FillFromFile("3way.txt");
	}

	CreateControl("Messages", "ListBox")
	{
		Geometry("Top", "Left");
		Pos(80, 180);
		Size(180, 130);
		CellSize(180, 10);
		BorderSize(0);
		BevelSize(0);
		ColorGroup("LISTBOX");
		Font("Tiny");
		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("Scion:");
		AddTextItem("");
		AddTextItem("EDF:");
		AddTextItem("");
		AddTextItem("Hadean:");	
		AddTextItem("");
		AddTextItem("Cerberi:");
	}

	CreateControl("EditBox", "Edit")
	{
		Geometry("Top", "Left");
		Pos(160,230);
		Size(50,10);
		Font("TINY");
		UseVar("mission.var1");
		Style("Rollover", "Outline");
		Cursor("Highlight");
	}

	CreateControl("EditBox", "Edit")
	{
		Geometry("Top", "Left");
		Pos(160,250);
		Size(50,10);
		Font("TINY");
		UseVar("mission.var2");
		Style("Rollover", "Outline");
		Cursor("Highlight");
	}

	CreateControl("EditBox", "Edit")
	{
		Geometry("Top", "Left");
		Pos(160,270);
		Size(50,10);
		Font("TINY");
		UseVar("mission.var3");
		Style("Rollover", "Outline");
		Cursor("Highlight");
	}

	CreateControl("EditBox", "Edit")
	{
		Geometry("Top", "Left");
		Pos(160,290);
		Size(50,10);
		Font("TINY");
		UseVar("mission.var4");
		Style("Rollover", "Outline");
		Cursor("Highlight");
	}

	CreateControl("Pool", "ListBox")
	{
		Geometry("Top", "Left");
		Pos(80, 320);
		Size(180, 60);
		CellSize(180, 10);
		BorderSize(0);
		BevelSize(0);
		ColorGroup("LISTBOX");
		Font("Tiny");
		Style("NOSELECTION", "Outline");
		ItemConfig()
		{
			Style("TRANSPARENT");
		}		
		AddTextItem("Remove pools in");
		AddTextItem("base area?");
		AddTextItem("(overrides keep_your_own)");
	}
	
	CreateControl("poolyes", "BUTTON")
	{
			Pos(190, 360);
			Size(50, 10);
			BorderSize(3);
			BevelSize(3);
			Font("TINY");
			Text("YES");
			ColorGroup("LISTBOX");
			Style("ROLLOVER", "RADIO", "OUTLINE");
			UseVar("pool.remove");
			Value(1);
			NotifyParent("Button::Select", "PoolYes");
	}
	


	CreateControl("poolno", "BUTTON")
	{
			Pos(100, 360);
			Size(50, 10);
			BorderSize(3);
			BevelSize(3);
			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(280, 200);
		Size(180, 60);
		CellSize(180, 10);
		BorderSize(0);
		BevelSize(0);
		ColorGroup("LISTBOX");
		Font("TINY");
		Style("NOSELECTION", "Outline");
		ItemConfig()
		{
			Style("TRANSPARENT");
		}
		AddTextItem("Choose players");
		AddTextItem("starting force");
		AddTextItem("");
	}

	CreateControl("startno", "BUTTON")
	{
			Pos(290, 240);
			Size(40, 10);
			BorderSize(3);
			BevelSize(3);
			Font("TINY");
			Text("NO");
			ColorGroup("LISTBOX");
			Style("ROLLOVER", "RADIO", "OUTLINE");
			UseVar("start.force");
			Value(0);
			NotifyParent("Button::Select", "StartNo");
	}

		CreateControl("startsmall", "BUTTON")
	{
			Pos(340, 240);
			Size(50, 10);
			BorderSize(3);
			BevelSize(3);
			Font("TINY");
			Text("Start");
			ColorGroup("LISTBOX");
			Style("ROLLOVER", "RADIO", "OUTLINE");
			UseVar("start.force");
			Value(1);
			NotifyParent("Button::Select", "StartNo");
	}

		CreateControl("startlarge", "BUTTON")
	{
			Pos(400, 240);
			Size(50, 10);
			BorderSize(3);
			BevelSize(3);
			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(280, 280);
		Size(180, 60);
		CellSize(180, 10);
		BorderSize(0);
		BevelSize(0);
		ColorGroup("LISTBOX");
		Font("TINY");
		Style("NOSELECTION", "Outline");
		ItemConfig()
		{
			Style("TRANSPARENT");
		}
		AddTextItem("Keep your own base pool");
		AddTextItem("Very easy setting = yes");
		AddTextItem("");
	}
	
	CreateControl("ownpoolyes", "BUTTON")
	{
			Pos(300, 320);
			Size(50, 10);
			BorderSize(3);
			BevelSize(3);
			Font("TINY");
			Text("NO");
			ColorGroup("LISTBOX");
			Style("ROLLOVER", "RADIO", "OUTLINE");
			UseVar("pool.own");
			Value(0);
			NotifyParent("Button::Select", "PoolYes");
	}
	


	CreateControl("ownpoolno", "BUTTON")
	{
			Pos(390, 320);
			Size(50, 10);
			BorderSize(3);
			BevelSize(3);
			Font("TINY");
			Text("YES");
			ColorGroup("LISTBOX");
			Style("ROLLOVER", "RADIO", "OUTLINE");
			UseVar("pool.own");
			Value(1);
			NotifyParent("Button::Select", "PoolNo");
	}


	CreateControl("InstructionsButt", "BUTTON")
	{
		Pos(96, 46);
		Size(75, 10);
		BorderSize(3);
		BevelSize(2);
		Font("TINY");
		Text("INSTRUCTIONS");
		ColorGroup("LISTBOX");
		Style("ROLLOVER", "RADIO", "OUTLINE");
		UseVar("race.count");
		Value(0);
		NotifyParent("Button::Select", "Instructions");
	}

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

	CreateControl("EDFButt", "BUTTON")
	{
		Pos(96, 96);
		Size(75, 10);
		BorderSize(3);
		BevelSize(2);
		Font("TINY");
		ColorGroup("LISTBOX");
		Text("EDF");
		Style("ROLLOVER", "RADIO", "OUTLINE");
		UseVar("race.count");
		Value(2);
		NotifyParent("Button::Select", "EDF");
	}

	CreateControl("HadeanButt", "BUTTON")
	{
		Pos(96, 121);
		Size(75, 10);
		BorderSize(3);
		BevelSize(2);
		Font("TINY");
		ColorGroup("LISTBOX");
		Text("HADEAN");
		Style("ROLLOVER", "RADIO", "OUTLINE");
		UseVar("race.count");
		Value(3);
		NotifyParent("Button::Select", "Hadean");
	}

	CreateControl("CerberiButt", "BUTTON")
	{
		Pos(96, 146);
		Size(75, 10);
		BorderSize(3);
		BevelSize(2);
		Font("TINY");
		Text("CERBERI");
		ColorGroup("LISTBOX");
		Style("ROLLOVER", "RADIO", "OUTLINE");
		UseVar("race.count");
		Value(4);
		NotifyParent("Button::Select", "Cerberi");
	}

	CreateControl("ReturnButt", "BUTTON")
	{
		Pos(228, 91);
		Size(55, 15);
		BorderSize(5);
		BevelSize(5);
		ColorGroup("LISTBOX");
		Font("Tiny");
		Text("Start");
//		Style("ROLLOVER","RADIO","OUTLINE");
		Style("ROLLOVER","RADIO", "OUTLINE", "BLINK");
		NotifyParent("Button::Select", "Return");
	}

	OnEvent("Instructions")
	{
//		Cmd("end.end 0");
		Deactivate("|Scion");
		Deactivate("|EDF");
		Deactivate("|Hadean");
		Deactivate("|Cerberi");
		Cmd("race.count 0");
//		Activate("|Start");
	}

	OnEvent("Scion")
	{
//		Cmd("end.end 0");
//		Deactivate("|Start");
		Deactivate("|Cerberi");
		Deactivate("|EDF");
		Deactivate("|Hadean");
		Cmd("race.count 1");
		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 2");
		Cmd("images.models ivscout00.xsi");	
		Activate("|EDF");
	}

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

	OnEvent("Cerberi")
	{
//		Cmd("end.end 0");
//		Deactivate("|Start");
		Deactivate("|Scion");
		Deactivate("|EDF");
		Deactivate("|Hadean");
		Cmd("race.count 4");
		Cmd("images.models cvscout00.xsi");	
		Activate("|Cerberi");
	}
	
	OnEvent("Return")
	{
		Cmd("end.end 1");		
	}
	
	OnEvent("Control::Activate")
	{
		Cmd("race.count 0");
		Cmd("end.end 0");
		Cmd("start.force 2");
		Cmd("pool.remove 0");
		Cmd("pool.own 1");
//		Activate("|Start");
	}

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

CreateControl("Scion", "STATIC")
{
	Geom("HCENTRE", "VCENTRE");
	Position(142,-130);
	Size(200, 170);
	Style("OUTLINE");
	BevelSize(2);

	CreateControl("XSIView", "VIEWER")
	{
		Geom("HCENTRE", "VCENTRE");
		Position(1,1);
		Size(200, 170);
		BorderSize(3);
		BevelSize(2);
		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");
	Position(142,-130);
	Size(200, 170);
	Style("OUTLINE");
	BevelSize(2);

	CreateControl("XSIView", "VIEWER")
	{
		Geom("HCENTRE", "VCENTRE");
		Position(1,1);
		Size(200, 170);
		BorderSize(3);
		BevelSize(2);
		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");
	Position(142,-130);
	Size(200, 170);
	Style("OUTLINE");
	BevelSize(2);

	CreateControl("XSIView", "VIEWER")
	{
		Geom("HCENTRE", "VCENTRE");
		Position(1,1);
		Size(200, 170);
		BorderSize(3);
		BevelSize(2);
		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("Cerberi", "STATIC")
{
	Geom("HCENTRE", "VCENTRE");
	Position(142,-130);
	Size(200, 170);
	Style("OUTLINE");
	BevelSize(2);

	CreateControl("XSIView", "VIEWER")
	{
		Geom("HCENTRE", "VCENTRE");
		Position(1,1);
		Size(200, 170);
		BorderSize(3);
		BevelSize(2);
		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(312,236);

	BorderSize(0);
	BevelSize(0);

	TabSize(200, 15);

	Style("OUTLINE", "INERT");

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

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

	
}