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

//
// CREATE TEXTURE EDITOR VARIABLES
//
ConfigureVarSys()
{
	CreateInteger("editor.texture.shape.value", 0);
	SetIntegerRange("editor.texture.shape.value", 0, 3);
	CreateInteger("editor.texture.mode.value", 0);
	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, 127);
		Gradient(0, 255, 255, 255, 127);
		Foreground(1, 255, 255, 255, 255);
		Background(1, 255, 255, 255, 191);
		Gradient(1, 255, 255, 255, 191);
		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
// EditTextureList
CreateControl("EditTextureList", "WINDOW")
{
	Geometry("RIGHT", "TOP");
	Pos(0, 75);
	Size(113, 435);

	ColorGroup("BACKGROUND");

	CreateControl("TileTitle", "STATIC")
	{
		Pos(8, 8);
		Size(120, 0);
		Font("TINY");
		JustifyText("LEFT");
		Text("Tile");
		Style("TRANSPARENT");
	}

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

		Pos(5, 15);
		Size(48, 48);
		Font("TINY");
		Text("0");
		Cursor("Highlight");
		Style("ROLLOVER", "RADIO");
		UseVar("editor.texture.index");
		Value(0);
	}

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

		Pos(57, 15);
		Size(48, 48);
		Font("TINY");
		Text("1");
		Cursor("Highlight");
		Style("ROLLOVER", "RADIO");
		UseVar("editor.texture.index");
		Value(1);
	}

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

		Pos(5, 68);
		Size(48, 48);
		Font("TINY");
		Text("2");
		Cursor("Highlight");
		Style("ROLLOVER", "RADIO");
		UseVar("editor.texture.index");
		Value(2);
	}

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

		Pos(57, 68);
		Size(48, 48);
		Font("TINY");
		Text("3");
		Cursor("Highlight");
		Style("ROLLOVER", "RADIO");
		UseVar("editor.texture.index");
		Value(3);
	}

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

		Pos(5, 120);
		Size(48, 48);
		Font("TINY");
		Text("4");
		Cursor("Highlight");
		Style("ROLLOVER", "RADIO");
		UseVar("editor.texture.index");
		Value(4);
	}

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

		Pos(57, 120);
		Size(48, 48);
		Font("TINY");
		Text("5");
		Cursor("Highlight");
		Style("ROLLOVER", "RADIO");
		UseVar("editor.texture.index");
		Value(5);
	}

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

		Pos(5, 173);
		Size(48, 48);
		Font("TINY");
		Text("6");
		Cursor("Highlight");
		Style("ROLLOVER", "RADIO");
		UseVar("editor.texture.index");
		Value(6);
	}

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

		Pos(57, 173);
		Size(48, 48);
		Font("TINY");
		Text("7");
		Cursor("Highlight");
		Style("ROLLOVER", "RADIO");
		UseVar("editor.texture.index");
		Value(7);
	}

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

		Pos(5, 225);
		Size(48, 48);
		Font("TINY");
		Text("8");
		Cursor("Highlight");
		Style("ROLLOVER", "RADIO");
		UseVar("editor.texture.index");
		Value(8);
	}

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

		Pos(57, 225);
		Size(48, 48);
		Font("TINY");
		Text("9");
		Cursor("Highlight");
		Style("ROLLOVER", "RADIO");
		UseVar("editor.texture.index");
		Value(9);
	}

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

		Pos(5, 278);
		Size(48, 48);
		Font("TINY");
		Text("10");
		Cursor("Highlight");
		Style("ROLLOVER", "RADIO");
		UseVar("editor.texture.index");
		Value(10);
	}

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

		Pos(57, 278);
		Size(48, 48);
		Font("TINY");
		Text("11");
		Cursor("Highlight");
		Style("ROLLOVER", "RADIO");
		UseVar("editor.texture.index");
		Value(11);
	}

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

		Pos(5, 330);
		Size(48, 48);
		Font("TINY");
		Text("12");
		Cursor("Highlight");
		Style("ROLLOVER", "RADIO");
		UseVar("editor.texture.index");
		Value(12);
	}

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

		Pos(57, 330);
		Size(48, 48);
		Font("TINY");
		Text("13");
		Cursor("Highlight");
		Style("ROLLOVER", "RADIO");
		UseVar("editor.texture.index");
		Value(13);
	}

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

		Pos(5, 383);
		Size(48, 48);
		Font("TINY");
		Text("14");
		Cursor("Highlight");
		Style("ROLLOVER", "RADIO");
		UseVar("editor.texture.index");
		Value(14);
	}

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

		Pos(57, 383);
		Size(48, 48);
		Font("TINY");
		Text("15");
		Cursor("Highlight");
		Style("ROLLOVER", "RADIO");
		UseVar("editor.texture.index");
		Value(15);
	}
}

//
// CREATE THE TEXTURE EDITOR WINDOW
//
CreateControl("EditTexture", "WINDOW")
{
	Pos(0, 98);
	Size(158, 638);

	ColorGroup("BACKGROUND");

	CreateControl("WidthTitle", "STATIC")
	{
		Pos(8, 8);
		Size(120, 15);
		Font("TINY");
		JustifyText("LEFT");
		Text("Width");
		Style("TRANSPARENT");
	}

	CreateControl("Width", "EDIT")
	{
		Pos(98, 11);
		Size(45, 11);
		BorderSize(5);
		BevelSize(5);
		Cursor("Highlight");
		Font("TINY");
		UseVar("editor.texture.size.width");
		Style("ROLLOVER", "OUTLINE");
	}
	CreateControl("Width", "SLIDER")
	{
		Pos(12, 33);
		Size(134, 11);
		BorderSize(3);
		BevelSize(5);
		Cursor("Highlight");
		Font("TINY");
		UseVar("editor.texture.size.width");
		Style("ROLLOVER", "OUTLINE");
	}

	CreateControl("DepthTitle", "STATIC")
	{
		Pos(8, 56);
		Size(120, 15);
		Font("TINY");
		JustifyText("LEFT");
		Text("Depth");
		Style("TRANSPARENT");
	}

	CreateControl("Depth", "EDIT")
	{
		Pos(98, 59);
		Size(45, 11);
		BorderSize(5);
		BevelSize(5);
		Cursor("Highlight");
		Font("TINY");
		UseVar("editor.texture.size.depth");
		Style("ROLLOVER", "OUTLINE");
	}

	CreateControl("Depth", "SLIDER")
	{
		Pos(12, 81);
		Size(134, 11);
		BorderSize(3);
		BevelSize(5);
		Cursor("Highlight");
		Font("TINY");
		UseVar("editor.texture.size.depth");
		Style("ROLLOVER", "OUTLINE");
	}

	CreateControl("ShapeTitle", "STATIC")
	{
		Pos(8, 98);
		Size(120, 15);
		Font("TINY");
		JustifyText("LEFT");
		Text("Shape");
		Style("TRANSPARENT");
	}

	CreateControl("ShapeSquare", "BUTTON")
	{
		Pos(12, 120);
		Size(59, 14);
		BorderSize(5);
		BevelSize(5);
		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(87, 120);
		Size(59, 14);
		BorderSize(5);
		BevelSize(5);
		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(12, 150);
		Size(59, 14);
		BorderSize(5);
		BevelSize(5);
		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(87, 150);
		Size(59, 14);
		BorderSize(5);
		BevelSize(5);
		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(8, 173);
		Size(120, 15);
		Font("TINY");
		JustifyText("LEFT");
		Text("Mode");
		Style("TRANSPARENT");
	}

	CreateControl("ModePaint", "BUTTON")
	{
		Pos(12, 195);
		Size(59, 14);
		BorderSize(5);
		BevelSize(5);
		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(87, 195);
		Size(59, 14);
		BorderSize(5);
		BevelSize(5);
		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(12, 225);
		Size(59, 14);
		BorderSize(5);
		BevelSize(5);
		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(87, 225);
		Size(59, 14);
		BorderSize(5);
		BevelSize(5);
		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(12, 255);
		Size(59, 14);
		BorderSize(5);
		BevelSize(5);
		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(12, 278);
		Size(120, 15);
		Font("TINY");
		JustifyText("LEFT");
		Text("Layer");
		Style("Transparent");
	}

	CreateControl("Layer0", "BUTTON")
	{
		Pos(12, 300);
		Size(14, 14);
		BorderSize(5);
		BevelSize(5);
		Font("TINY");
		Style("ROLLOVER", "RADIO", "OUTLINE");
		Cursor("Highlight");
		Text("0");
		UseVar("editor.texture.layer");
		Value(0);
	}

	CreateControl("Layer1", "BUTTON")
	{
		Pos(42, 300);
		Size(14, 14);
		BorderSize(5);
		BevelSize(5);
		Font("TINY");
		Style("ROLLOVER", "RADIO", "OUTLINE");
		Cursor("Highlight");
		Text("1");
		UseVar("editor.texture.layer");
		Value(1);
	}

	CreateControl("Layer2", "BUTTON")
	{
		Pos(72, 300);
		Size(14, 14);
		BorderSize(5);
		BevelSize(5);
		Font("TINY");
		Style("ROLLOVER", "RADIO", "OUTLINE");
		Cursor("Highlight");
		Text("2");
		UseVar("editor.texture.layer");
		Value(2);
	}

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

	CreateControl("LayerSolo", "BUTTON")
	{
		Pos(132, 300);
		Size(14, 14);
		BorderSize(5);
		BevelSize(5);
		Font("TINY");
		Style("ROLLOVER", "TOGGLE", "OUTLINE");
		Cursor("Highlight");
		Text("S");
		UseVar("editor.texture.solo");
	}
	
	CreateControl("PressureTitle", "STATIC")
	{
		Pos(8, 330);
		Size(120, 15);
		Font("TINY");
		JustifyText("LEFT");
		Text("Pressure");
		Style("Transparent");
	}

	CreateControl("Pressure", "EDIT")
	{
		Pos(98, 335);
		Size(45, 11);
		BorderSize(5);
		BevelSize(5);
		Font("TINY");
		Style("ROLLOVER", "OUTLINE");
		Cursor("Highlight");
		UseVar("editor.texture.pressure");
	}
		CreateControl("PressureSlider", "SLIDER")
	{
		Pos(12, 357);
		Size(134, 11);
		BorderSize(3);
		BevelSize(5);
		Font("TINY");
		Style("ROLLOVER", "OUTLINE");
		Cursor("Highlight");
		Range (0,100);
		UseVar("editor.texture.pressure");
	}

	CreateControl("ForegroundTitle", "STATIC")
	{
		Pos(8, 375);
		Size(120, 15);
		Font("TINY");
		JustifyText("LEFT");
		Text("Foreground");
		Style("Transparent");
	}

	CreateControl("Foreground", "EDIT")
	{
		Pos(12, 398);
		Size(134, 14);
		BorderSize(5);
		BevelSize(5);
		Font("TINY");
		Style("ROLLOVER", "OUTLINE");
		Cursor("Highlight");
		UseVar("editor.texture.foreground");
	}

	CreateControl("BackgroundTitle", "STATIC")
	{
		Pos(8, 420);
		Size(120, 15);
		Font("TINY");
		JustifyText("LEFT");
		Text("Background");
		Style("Transparent");
	}

	CreateControl("Background", "EDIT")
	{
		Pos(12, 443);
		Size(134, 14);
		BorderSize(5);
		BevelSize(5);
		Font("TINY");
		Style("ROLLOVER", "OUTLINE");
		Cursor("Highlight");
		UseVar("editor.texture.background");
	}

	CreateControl("IndexTitle", "STATIC")
	{
		Pos(12, 465);
		Size(120, 15);
		Font("TINY");
		JustifyText("LEFT");
		Text("Texture");
		Style("Transparent");
	}

	CreateControl("Index", "EDIT")
	{
		Pos(12, 488);
		Size(134, 14);
		BorderSize(5);
		BevelSize(5);
		Font("TINY");
		Style("ROLLOVER", "OUTLINE");
		Cursor("Highlight");
		UseVar("editor.texture.index");
	}

//ADDED BY THE BLACK ROOKS - TEXTURE FILL BUTTONS

CreateControl("FillTitle", "STATIC")
	{
		Pos(12, 510);
		Size(120, 15);
		Font("TINY");
		JustifyText("LEFT");
		Text("Fill Options");
		Style("Transparent");
	}
CreateControl("BRFill1", "BUTTON")
	{
		Pos(12, 533);
		Size(59, 14);
		BorderSize(5);
		BevelSize(5);
		Font("TINY");
		Text("Curr Text");
		Cursor("Highlight");
		Style("ROLLOVER", "RADIO", "OUTLINE");
		UseVar("editor.texture.mode.value");
		Value(5);
		NotifyParent("Button::Select", "Fill1");
	}

CreateControl("BRFill2", "BUTTON")
	{

		Pos(87, 533);
		Size(59, 14);
		BorderSize(5);
		BevelSize(5);
		Font("TINY");
		Text("Texture 0");
		Cursor("Highlight");
		Style("ROLLOVER", "RADIO", "OUTLINE");
		UseVar("editor.texture.mode.value");
		Value(6);
		NotifyParent("Button::Select", "Fill2");
	}
CreateControl("BRFill3", "BUTTON")
	{

		Pos(12, 563);
		Size(134, 14);
		BorderSize(5);
		BevelSize(5);
		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")
	{

		Pos(12, 593);
		Size(134, 14);
		BorderSize(5);
		BevelSize(5);
		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");
	}

	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");
	}

	OnEvent("Fill1")
	{
		Cmd("editor.texture.fill");
		Cmd("editor.texture.mode.value 0");

	}

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

	}
	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");
		Cmd("editor.texture.mode.value 0");
	}
	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");
		Cmd("editor.texture.mode.value 0");
	}
}
