// =========================
// BATTLEZONE TEXTURE EDITOR
// =========================

//TWEAKED BY THE BLACK ROOKS APRIL 2000
//
// CREATE TEXTURE EDITOR VARIABLES
//
ConfigureVarSys()
{
	CreateInteger("editor.texture.shape.value", 0);
	SetIntegerRange("editor.texture.shape.value", 0, 3);
	CreateInteger("editor.texture.mode.value", 4);
	SetIntegerRange("editor.texture.mode.value", 0, 8);  //Changed to 5 to add Fill Button Value
}

ConfigureInterface()
{
	DefineColorGroup("TILE")
	{

		Foreground(0, 255, 255, 255, 255);
		Background(0, 255, 255, 255, 225);
		Gradient(0, 255, 255, 255, 225);
		Foreground(1, 255, 255, 255, 255);
		Background(1, 255, 255, 255, 235);
		Gradient(1, 255, 255, 255, 235);
		Foreground(2, 255, 255, 255, 255);
		Background(2, 255, 255, 255, 255);
		Gradient(2, 255, 255, 255, 255);
		Foreground(3, 255, 255, 255, 255);
		Background(3, 255, 255, 255, 255);
		Gradient(3, 255, 255, 255, 255);
	}
}

//
// CREATE TEXTURE EDITOR PALETTE
//
CreateControl("EditTextureList", "WINDOW")
{

	Geometry("RIGHT", "TOP");
	Pos(0, 10);
	Size(145, 160);

	ColorGroup("BACKGROUND");

	CreateControl("TileTitle", "STATIC")
	{
		ColorGroup("TVBACK1");
		Pos(0, 3);
		Size(80, 10);
		Font("Small");
		JustifyText("HCENTRE");
		Text("Texture");
		Style("TRANSPARENT");
	}

	CreateControl("Tile0", "BUTTON")
	{
		ColorGroup("TILE");

		Pos(3, 20);
		Size(32, 32);
		Font("TINY");
		Text("0");
		Cursor("Highlight");
		Style("ROLLOVER", "RADIO");
		UseVar("editor.texture.index");
		Value(0);
	}

	CreateControl("Tile1", "BUTTON")
	{
		ColorGroup("TILE");

		Pos(38, 20);
		Size(32, 32);
		Font("TINY");
		Text("1");
		Cursor("Highlight");
		Style("ROLLOVER", "RADIO");
		UseVar("editor.texture.index");
		Value(1);
	}

	CreateControl("Tile2", "BUTTON")
	{
		ColorGroup("TILE");

		Pos(3, 55);
		Size(32, 32);
		Font("TINY");
		Text("2");
		Cursor("Highlight");
		Style("ROLLOVER", "RADIO");
		UseVar("editor.texture.index");
		Value(2);
	}

	CreateControl("Tile3", "BUTTON")
	{
		ColorGroup("TILE");

		Pos(38, 55);
		Size(32, 32);
		Font("TINY");
		Text("3");
		Cursor("Highlight");
		Style("ROLLOVER", "RADIO");
		UseVar("editor.texture.index");
		Value(3);
	}

	CreateControl("Tile4", "BUTTON")
	{
		ColorGroup("TILE");

		Pos(3, 90);
		Size(32, 32);
		Font("TINY");
		Text("4");
		Cursor("Highlight");
		Style("ROLLOVER", "RADIO");
		UseVar("editor.texture.index");
		Value(4);
	}

	CreateControl("Tile5", "BUTTON")
	{
		ColorGroup("TILE");

		Pos(38, 90);
		Size(32, 32);
		Font("TINY");
		Text("5");
		Cursor("Highlight");
		Style("ROLLOVER", "RADIO");
		UseVar("editor.texture.index");
		Value(5);
	}

	CreateControl("Tile6", "BUTTON")
	{
		ColorGroup("TILE");

		Pos(3, 125);
		Size(32, 32);
		Font("TINY");
		Text("6");
		Cursor("Highlight");
		Style("ROLLOVER", "RADIO");
		UseVar("editor.texture.index");
		Value(6);
	}

	CreateControl("Tile7", "BUTTON")
	{
		ColorGroup("TILE");

		Pos(38, 125);
		Size(32, 32);
		Font("TINY");
		Text("7");
		Cursor("Highlight");
		Style("ROLLOVER", "RADIO");
		UseVar("editor.texture.index");
		Value(7);
	}

	CreateControl("Tile8", "BUTTON")
	{
		ColorGroup("TILE");

		Pos(73, 20);
		Size(32, 32);
		Font("TINY");
		Text("8");
		Cursor("Highlight");
		Style("ROLLOVER", "RADIO");
		UseVar("editor.texture.index");
		Value(8);
	}

	CreateControl("Tile9", "BUTTON")
	{
		ColorGroup("TILE");

		Pos(108, 20);
		Size(32, 32);
		Font("TINY");
		Text("9");
		Cursor("Highlight");
		Style("ROLLOVER", "RADIO");
		UseVar("editor.texture.index");
		Value(9);
	}

	CreateControl("Tile10", "BUTTON")
	{
		ColorGroup("TILE");

		Pos(73, 55);
		Size(32, 32);
		Font("TINY");
		Text("10");
		Cursor("Highlight");
		Style("ROLLOVER", "RADIO");
		UseVar("editor.texture.index");
		Value(10);
	}

	CreateControl("Tile11", "BUTTON")
	{
		ColorGroup("TILE");

		Pos(108, 55);
		Size(32, 32);
		Font("TINY");
		Text("11");
		Cursor("Highlight");
		Style("ROLLOVER", "RADIO");
		UseVar("editor.texture.index");
		Value(11);
	}

	CreateControl("Tile12", "BUTTON")
	{
		ColorGroup("TILE");

		Pos(73, 90);
		Size(32, 32);
		Font("TINY");
		Text("12");
		Cursor("Highlight");
		Style("ROLLOVER", "RADIO");
		UseVar("editor.texture.index");
		Value(12);
	}

	CreateControl("Tile13", "BUTTON")
	{
		ColorGroup("TILE");

		Pos(108, 90);
		Size(32, 32);
		Font("TINY");
		Text("13");
		Cursor("Highlight");
		Style("ROLLOVER", "RADIO");
		UseVar("editor.texture.index");
		Value(13);
	}

	CreateControl("Tile14", "BUTTON")
	{
		ColorGroup("TILE");

		Pos(73, 125);
		Size(32, 32);
		Font("TINY");
		Text("14");
		Cursor("Highlight");
		Style("ROLLOVER", "RADIO");
		UseVar("editor.texture.index");
		Value(14);
	}

	CreateControl("Tile15", "BUTTON")
	{
		ColorGroup("TILE");

		Pos(107, 125);
		Size(32, 32);
		Font("TINY");
		Text("15");
		Cursor("Highlight");
		Style("ROLLOVER", "RADIO");
		UseVar("editor.texture.index");
		Value(15);
	}
}

//
// CREATE THE TEXTURE EDITOR WINDOW
//
CreateControl("EditTexture", "WINDOW")
{
	Pos(2, 10);
	Size(105, 475);
	BevelSize(2);
	ColorGroup("BACKGROUND");

		CreateControl("BoxTitle", "STATIC")
			{
			ColorGroup("TVBACK1");
			Geometry("LEFT", "BOTTOM");
			Pos(0, 27);
			Size(105, 23);
			BevelSize(4);
			Font("LARGE");
			JustifyText("HCENTRE");
			Text("Texture");
			}

	CreateControl("WidthTitle", "STATIC")
	{
		Pos(5, 7);
		Size(80, 10);
		Font("TINY");
		JustifyText("LEFT");
		Text("Width");
		Style("TRANSPARENT");
	}

	CreateControl("Width", "EDIT")
	{
		ColorGroup("TVBACK1");
		Pos(70,8);
		Size(27, 11);
		BorderSize(1);
		BevelSize(3);
		Font("BRUSH");
		Style("ROLLOVER", "OUTLINE");
		Cursor("Highlight");
		UseVar("editor.texture.size.width");
	}

	CreateControl("Width", "SLIDER")
	{
		ColorGroup("TVBUTTON1");
		Pos(8, 25);
		Size(89, 7);
		BorderSize(2);
		BevelSize(3);
		Cursor("Highlight");
		Font("TINY");
		UseVar("editor.texture.size.width");
		Style("ROLLOVER", "OUTLINE");
	}

	CreateControl("DepthTitle", "STATIC")
	{
		Pos(5, 42);
		Size(80, 10);
		Font("TINY");
		JustifyText("LEFT");
		Text("Depth");
		Style("TRANSPARENT");
	}

	CreateControl("Depth", "EDIT")
	{
		ColorGroup("TVBACK1");
		Pos(70, 43);
		Size(27, 11);
		BorderSize(1);
		BevelSize(3);
		Font("BRUSH");
		Style("ROLLOVER", "OUTLINE");
		Cursor("Highlight");
		UseVar("editor.texture.size.depth");
	}

	CreateControl("Depth", "SLIDER")
	{
		ColorGroup("TVBUTTON1");
		Pos(8, 60);
		Size(89, 7);
		BorderSize(2);
		BevelSize(3);
		Cursor("Highlight");
		Font("TINY");
		UseVar("editor.texture.size.depth");
		Style("ROLLOVER", "OUTLINE");
	}

	CreateControl("ShapeTitle", "STATIC")
	{
		Pos(5, 75);
		Size(80, 10);
		Font("TINY");
		JustifyText("LEFT");
		Text("Shape");
		Style("TRANSPARENT");
	}

	CreateControl("ShapeSquare", "BUTTON")
	{
		Pos(8, 90);
		Size(39, 9);
		BorderSize(3);
		BevelSize(3);
		Font("TINY");
		Text("Square");
		Cursor("Highlight");
		Style("ROLLOVER", "RADIO", "OUTLINE");
		UseVar("editor.texture.shape.value");
		Value(0);
		NotifyParent("Button::Select", "Square");
	}

	CreateControl("ShapeCircle", "BUTTON")
	{
		Pos(58, 90);
		Size(39, 9);
		BorderSize(3);
		BevelSize(3);
		Font("TINY");
		Text("Circle");
		Cursor("Highlight");
		Style("ROLLOVER", "RADIO", "OUTLINE");
		UseVar("editor.texture.shape.value");
		Value(1);
		NotifyParent("Button::Select", "Circle");
	}

	CreateControl("ShapeCone", "BUTTON")
	{
		Pos(8, 110);
		Size(39, 9);
		BorderSize(3);
		BevelSize(3);
		Font("TINY");
		Text("Cone");
		Cursor("Highlight");
		Style("ROLLOVER", "RADIO", "OUTLINE");
		UseVar("editor.texture.shape.value");
		Value(2);
		NotifyParent("Button::Select", "Cone");
	}

	CreateControl("ShapeBell", "BUTTON")
	{
		Pos(58, 110);
		Size(39, 9);
		BorderSize(3);
		BevelSize(3);
		Font("TINY");
		Text("Bell");
		Cursor("Highlight");
		Style("ROLLOVER", "RADIO", "OUTLINE");
		UseVar("editor.texture.shape.value");
		Value(3);
		NotifyParent("Button::Select", "Bell");
	}

	CreateControl("ModeTitle", "STATIC")
	{
		Pos(5, 130);
		Size(80, 10);
		Font("TINY");
		JustifyText("LEFT");
		Text("Mode");
		Style("TRANSPARENT");
	}

	CreateControl("ModePaint", "BUTTON")
	{
		Pos(8, 145);
		Size(39, 9);
		BorderSize(3);
		BevelSize(3);
		Font("TINY");
		Text("Paint");
		Cursor("Highlight");
		Style("ROLLOVER", "RADIO", "OUTLINE");
		UseVar("editor.texture.mode.value");
		Value(0);
		NotifyParent("Button::Select", "Paint");
	}

	CreateControl("ModeSpray", "BUTTON")
	{
		Pos(58, 145);
		Size(39, 9);
		BorderSize(3);
		BevelSize(3);
		Font("TINY");
		Text("Spray");
		Cursor("Highlight");
		Style("ROLLOVER", "RADIO", "OUTLINE");
		UseVar("editor.texture.mode.value");
		Value(1);
		NotifyParent("Button::Select", "Spray");
	}

	CreateControl("ModeRaise", "BUTTON")
	{
		Pos(8, 165);
		Size(39, 9);
		BorderSize(3);
		BevelSize(3);
		Font("TINY");
		Text("Raise");
		Cursor("Highlight");
		Style("ROLLOVER", "RADIO", "OUTLINE");
		UseVar("editor.texture.mode.value");
		Value(2);
		NotifyParent("Button::Select", "Raise");
	}

	CreateControl("ModeBlend", "BUTTON")
	{
		Pos(58, 165);
		Size(39, 9);
		BorderSize(3);
		BevelSize(3);
		Font("TINY");
		Text("Blend");
		Cursor("Highlight");
		Style("ROLLOVER", "RADIO", "OUTLINE");
		UseVar("editor.texture.mode.value");
		Value(3);
		NotifyParent("Button::Select", "Blend");
	}

	CreateControl("ModeEyedrop", "BUTTON")
	{
		Pos(8, 185);
		Size(39, 9);
		BorderSize(3);
		BevelSize(3);
		Font("TINY");
		Text("Eyedrop");
		Cursor("Highlight");
		Style("ROLLOVER", "RADIO", "OUTLINE");
		UseVar("editor.texture.mode.value");
		Value(4);
		NotifyParent("Button::Select", "Eyedrop");
	}

	CreateControl("LayerTitle", "STATIC")
	{
		Pos(8, 205);
		Size(80, 10);
		Font("TINY");
		JustifyText("LEFT");
		Text("Layer");
		Style("Transparent");
	}

	CreateControl("Layer0", "BUTTON")
	{
		Pos(8, 220);
		Size(9, 9);
		BorderSize(3);
		BevelSize(3);
		Font("TINY");
		Style("ROLLOVER", "RADIO", "OUTLINE");
		Cursor("Highlight");
		Text("0");
		UseVar("editor.texture.layer");
		Value(0);
	}

	CreateControl("Layer1", "BUTTON")
	{
		Pos(28, 220);
		Size(9, 9);
		BorderSize(3);
		BevelSize(3);
		Font("TINY");
		Style("ROLLOVER", "RADIO", "OUTLINE");
		Cursor("Highlight");
		Text("1");
		UseVar("editor.texture.layer");
		Value(1);
	}

	CreateControl("Layer2", "BUTTON")
	{
		Pos(48, 220);
		Size(9, 9);
		BorderSize(3);
		BevelSize(3);
		Font("TINY");
		Style("ROLLOVER", "RADIO", "OUTLINE");
		Cursor("Highlight");
		Text("2");
		UseVar("editor.texture.layer");
		Value(2);
	}

	CreateControl("Layer3", "BUTTON")
	{
		Pos(68, 220);
		Size(9, 9);
		BorderSize(3);
		BevelSize(3);
		Font("TINY");
		Style("ROLLOVER", "RADIO", "OUTLINE");
		Cursor("Highlight");
		Text("3");
		UseVar("editor.texture.layer");
		Value(3);
	}

	CreateControl("LayerSolo", "BUTTON")
	{
		Pos(88, 220);
		Size(9, 9);
		BorderSize(3);
		BevelSize(3);
		Font("TINY");
		Style("ROLLOVER", "TOGGLE", "OUTLINE");
		Cursor("Highlight");
		Text("S");
		UseVar("editor.texture.solo");
	}
	
	CreateControl("PressureTitle", "STATIC")
	{
		Pos(5, 240);
		Size(80, 10);
		Font("TINY");
		JustifyText("LEFT");
		Text("Pressure");
		Style("Transparent");
	}

	CreateControl("Pressure", "EDIT")
	{
		Pos(8, 255);
		Size(89, 9);
		BorderSize(3);
		BevelSize(3);
		Font("TINY");
		Style("ROLLOVER", "OUTLINE");
		Cursor("Highlight");
		UseVar("editor.texture.pressure");
	}

	CreateControl("ForegroundTitle", "STATIC")
	{
		Pos(5, 275);
		Size(80, 10);
		Font("TINY");
		JustifyText("LEFT");
		Text("Foreground");
		Style("Transparent");
	}

	CreateControl("Foreground", "EDIT")
	{
		Pos(8, 290);
		Size(89, 9);
		BorderSize(3);
		BevelSize(3);
		Font("TINY");
		Style("ROLLOVER", "OUTLINE");
		Cursor("Highlight");
		UseVar("editor.texture.foreground");
	}

	CreateControl("BackgroundTitle", "STATIC")
	{
		Pos(5, 310);
		Size(80, 10);
		Font("TINY");
		JustifyText("LEFT");
		Text("Background");
		Style("Transparent");
	}

	CreateControl("Background", "EDIT")
	{
		Pos(8, 325);
		Size(89, 9);
		BorderSize(3);
		BevelSize(3);
		Font("TINY");
		Style("ROLLOVER", "OUTLINE");
		Cursor("Highlight");
		UseVar("editor.texture.background");
	}

	CreateControl("IndexTitle", "STATIC")
	{
		Pos(8, 345);
		Size(80, 10);
		Font("TINY");
		JustifyText("LEFT");
		Text("Texture");
		Style("Transparent");
	}

	CreateControl("Index", "EDIT")
	{
		Pos(8, 360);
		Size(89, 9);
		BorderSize(3);
		BevelSize(3);
		Font("TINY");
		Style("ROLLOVER", "OUTLINE");
		Cursor("Highlight");
		UseVar("editor.texture.index");
	}

//ADDED BY THE BLACK ROOKS - TEXTURE FILL BUTTONS

CreateControl("FillTitle", "STATIC")
	{
		Pos(8, 379);
		Size(80, 10);
		Font("TINY");
		JustifyText("LEFT");
		Text("Fill Options");
		Style("Transparent");
	}
CreateControl("BRFill1", "BUTTON")
	{
		ColorGroup("TVBUTTON1");

		Pos(8, 395);
		Size(89, 9);
		BorderSize(3);
		BevelSize(3);
		Font("TINY");
		Text("Layer with curr Text");
		Cursor("Highlight");
		Style("ROLLOVER", "RADIO", "OUTLINE");
		UseVar("editor.texture.mode.value");
		Value(5);
		NotifyParent("Button::Select", "Fill1");
	}

CreateControl("BRFill2", "BUTTON")
	{
		ColorGroup("TVBUTTON1");

		Pos(8, 415);
		Size(89, 9);
		BorderSize(3);
		BevelSize(3);
		Font("TINY");
		Text("Layer with Texture 0");
		Cursor("Highlight");
		Style("ROLLOVER", "RADIO", "OUTLINE");
		UseVar("editor.texture.mode.value");
		Value(6);
		NotifyParent("Button::Select", "Fill2");
	}
CreateControl("BRFill3", "BUTTON")
	{
		ColorGroup("TVBUTTON1");

		Pos(8, 435);
		Size(89, 9);
		BorderSize(3);
		BevelSize(3);
		Font("TINY");
		Text("All Layers curr Text");
		Cursor("Highlight");
		Style("ROLLOVER", "RADIO", "OUTLINE");
		UseVar("editor.texture.mode.value");
		Value(7);
		NotifyParent("Button::Select", "Fill3");
	}
CreateControl("BRFill4", "BUTTON")
	{
		ColorGroup("TVBUTTON1");

		Pos(8, 455);
		Size(89, 9);
		BorderSize(3);
		BevelSize(3);
		Font("TINY");
		Text("All Layers with Text 0");
		Cursor("Highlight");
		Style("ROLLOVER", "RADIO", "OUTLINE");
		UseVar("editor.texture.mode.value");
		Value(8);
		NotifyParent("Button::Select", "Fill4");
	}
//END OF ADDITIONS


	OnEvent("Control::Activate")
	{
		Cmd("editor.mode.texture");

		Activate("|EditTextureList");
	}

	OnEvent("Control::Deactivate")
	{
		Deactivate("|EditTextureList");
	}

	OnEvent("Square")
	{
		Cmd("editor.texture.shape.square");
	}

	OnEvent("Circle")
	{
		Cmd("editor.texture.shape.circle");
	}

	OnEvent("Cone")
	{
		Cmd("editor.texture.shape.cone");
	}

	OnEvent("Bell")
	{
		Cmd("editor.texture.shape.bell");
	}

	OnEvent("Paint")
	{
		Cmd("editor.texture.mode.paint");
	}

	OnEvent("Spray")
	{
		Cmd("editor.texture.mode.spray");
	}

	OnEvent("Raise")
	{
		Cmd("editor.texture.mode.raise");
	}

	OnEvent("Blend")
	{
		Cmd("editor.texture.mode.blend");
	}

	OnEvent("Eyedrop")
	{
		Cmd("editor.texture.mode.eyedrop");
	}

//ADDED By The Black Rooks 08/04/00 Texture Fill commands
	OnEvent("Fill1")
	{
		Cmd("editor.texture.fill");
	}

	OnEvent("Fill2")
	{
		Cmd("editor.texture.index 0");
		Cmd("editor.texture.fill");

	}
	OnEvent("Fill3")
	{
		Cmd("editor.texture.layer 0");
		Cmd("editor.texture.fill");
		Cmd("editor.texture.layer 1");
		Cmd("editor.texture.fill");
		Cmd("editor.texture.layer 2");
		Cmd("editor.texture.fill");
		Cmd("editor.texture.layer 3");
		Cmd("editor.texture.fill");
	}
	OnEvent("Fill4")
	{
		Cmd("editor.texture.index 0");
		Cmd("editor.texture.layer 0");
		Cmd("editor.texture.fill");
		Cmd("editor.texture.layer 1");
		Cmd("editor.texture.fill");
		Cmd("editor.texture.layer 2");
		Cmd("editor.texture.fill");
		Cmd("editor.texture.layer 3");
		Cmd("editor.texture.fill");
	}

}

