// ================================
// BATTLEZONE EDITOR INITIALIZATION
// ================================

//
// CONFIGURE FONTS
//
ConfigureInterface()
{
	// large font: bank gothic medium 12-point
	CreateFont("LARGE", "bg12.bmf");

	// medium font: bank gothic medium 10-point
	CreateFont("MEDIUM", "bg10.bmf");

	// small font: bank gothic medium 8-point
	CreateFont("SMALL", "bg08.bmf");

	// tiny font: small fonts 5-point
	CreateFont("TINY", "small.bmf");

	// use medium as the system font
	CreateFont("SYSTEM", "bg10.bmf");
}

//
// CONFIGURE COLORS
//
ConfigureInterface()
{
	// blue interface elements
	DefineColorGroup("DEFAULT")
	{
		// unselected, unhighlit, enabled
		Foreground(0, 255, 255, 255, 255);
		Background(0, 0, 127, 255, 127);
		Gradient(0, 0, 63, 127, 127);

		// selected, unhighlit, enabled
		Foreground(1, 255, 255, 255, 255);
		Background(1, 255, 0, 127, 127);
		Gradient(1, 127, 0, 63, 127);

		// unselected, highlit, enabled
		Foreground(2, 255, 255, 255, 255);
		Background(2, 127, 191, 255, 127);
		Gradient(2, 63, 95, 127, 127);

		// selected, highlit, enabled
		Foreground(3, 255, 255, 255, 255);
		Background(3, 255, 127, 191, 127);
		Gradient(3, 127, 63, 95, 127);

		// unselected, unhighlit, disabled
		Foreground(4, 191, 191, 191, 255);
		Background(4, 127, 127, 127, 127);
		Gradient(4, 63, 63, 63, 127);

		// selected, unhighlit, disabled
		Foreground(5, 255, 255, 255, 255);
		Background(5, 191, 191, 191, 127);
		Gradient(5, 95, 95, 95, 127);

		// unselected, highlit, disabled
		Foreground(6, 255, 255, 255, 255);
		Background(6, 191, 191, 191, 127);
		Gradient(6, 95, 95, 95, 127);

		// selected, highlit, disabled
		Foreground(7, 255, 255, 255, 255);
		Background(7, 255, 255, 255, 127);
		Gradient(7, 127, 127, 127, 127);
	}

	// magenta interface elements
	DefineColorGroup("MAGENTA")
	{
		// unselected, unhighlit, enabled
		Foreground(0, 255, 255, 255, 255);
		Background(0, 255, 0, 127, 127);
		Gradient(0, 127, 0, 63, 127);

		// selected, unhighlit, enabled
		Foreground(1, 255, 255, 255, 255);
		Background(1, 0, 127, 255, 127);
		Gradient(1, 0, 63, 127, 127);

		// unselected, highlit, enabled
		Foreground(2, 255, 255, 255, 255);
		Background(2, 255, 127, 191, 127);
		Gradient(2, 127, 63, 95, 127);

		// selected, highlit, enabled
		Foreground(3, 255, 255, 255, 255);
		Background(3, 127, 191, 255, 127);
		Gradient(3, 63, 95, 127, 127);

		// unselected, unhighlit, disabled
		Foreground(4, 191, 191, 191, 255);
		Background(4, 127, 127, 127, 127);
		Gradient(4, 63, 63, 63, 127);

		// selected, unhighlit, disabled
		Foreground(5, 255, 255, 255, 255);
		Background(5, 191, 191, 191, 127);
		Gradient(5, 95, 95, 95, 127);

		// unselected, highlit, disabled
		Foreground(6, 255, 255, 255, 255);
		Background(6, 191, 191, 191, 127);
		Gradient(6, 95, 95, 95, 127);

		// selected, highlit, disabled
		Foreground(7, 255, 255, 255, 255);
		Background(7, 255, 255, 255, 127);
		Gradient(7, 127, 127, 127, 127);
	}


	// Bright magenta interface elements
	DefineColorGroup("BRIGHTMAGENTA")
	{
		// unselected, unhighlit, enabled
		Foreground(0, 255, 255, 255, 255);
		Background(0, 200, 0, 127, 127);
		Gradient(0, 200, 0, 127, 127);

		// selected, unhighlit, enabled
		Foreground(1, 255, 255, 255, 255);
		Background(1, 0, 127, 255, 127);
		Gradient(1, 0, 63, 127, 127);

		// unselected, highlit, enabled
		Foreground(2, 255, 255, 255, 255);
		Background(2, 255, 127, 191, 127);
		Gradient(2, 127, 63, 95, 127);

		// selected, highlit, enabled
		Foreground(3, 255, 255, 255, 255);
		Background(3, 127, 191, 255, 127);
		Gradient(3, 63, 95, 127, 127);

		// unselected, unhighlit, disabled
		Foreground(4, 191, 191, 191, 255);
		Background(4, 127, 127, 127, 127);
		Gradient(4, 63, 63, 63, 127);

		// selected, unhighlit, disabled
		Foreground(5, 255, 255, 255, 255);
		Background(5, 191, 191, 191, 127);
		Gradient(5, 95, 95, 95, 127);

		// unselected, highlit, disabled
		Foreground(6, 255, 255, 255, 255);
		Background(6, 191, 191, 191, 127);
		Gradient(6, 95, 95, 95, 127);

		// selected, highlit, disabled
		Foreground(7, 255, 255, 255, 255);
		Background(7, 255, 255, 255, 127);
		Gradient(7, 127, 127, 127, 127);
	}

	// magenta listbox elements
	DefineColorGroup("LISTBOX")
	{
		// unselected, unhighlit
		Foreground(0, 255, 255, 255, 255);
		Background(0, 0, 0, 0, 255);
		Gradient(0, 0, 0, 0, 255);

		// selected, unhighlit
		Foreground(1, 255, 255, 255, 255);
		Background(1, 127, 0, 63, 255);
		Gradient(1, 127, 0, 63, 255);

		// unselected, highlit
		Foreground(2, 255, 255, 255, 255);
		Background(2, 63, 63, 63, 255);
		Gradient(2, 63, 63, 63, 255);

		// selected, highlit
		Foreground(3, 255, 255, 255, 255);
		Background(3, 255, 0, 127, 255);
		Gradient(3, 255, 0, 127, 255);

		// unselected, unhighlit, disabled
		Foreground(4, 191, 191, 191, 255);
		Background(4, 0, 0, 0, 255);
		Gradient(4, 0, 0, 0, 255);

		// selected, unhighlit, disabled
		Foreground(5, 255, 255, 255, 255);
		Background(5, 63, 63, 63, 255);
		Gradient(5, 63, 63, 63, 255);

		// unselected, highlit, disabled
		Foreground(6, 255, 255, 255, 255);
		Background(6, 63, 63, 63, 255);
		Gradient(6, 63, 63, 63, 255);

		// selected, highlit, disabled
		Foreground(7, 255, 255, 255, 255);
		Background(7, 127, 127, 127, 255);
		Gradient(7, 127, 127, 127, 255);
	}

	// blue listbox elements
	DefineColorGroup("BLACKBLUE")
	{
		// unselected, unhighlit, enabled
		Foreground(0, 255, 255, 255, 255);
		Background(0, 0, 0, 0, 255);
		Gradient(0, 0, 0, 0, 255);

		// selected, unhighlit, enabled
		Foreground(1, 255, 255, 255, 255);
		Background(1, 0, 63, 127, 255);
		Gradient(1, 0, 63, 127, 255);

		// unselected, highlit, enabled
		Foreground(2, 255, 255, 255, 255);
		Background(2, 63, 63, 63, 255);
		Gradient(2, 63, 63, 63, 255);

		// selected, highlit, enabled
		Foreground(3, 255, 255, 255, 255);
		Background(3, 0, 127, 255, 255);
		Gradient(3, 0, 127, 255, 255);

		// unselected, unhighlit, disabled
		Foreground(4, 191, 191, 191, 255);
		Background(4, 0, 0, 0, 255);
		Gradient(4, 0, 0, 0, 255);

		// selected, unhighlit, disabled
		Foreground(5, 255, 255, 255, 255);
		Background(5, 63, 63, 63, 255);
		Gradient(5, 63, 63, 63, 255);

		// unselected, highlit, disabled
		Foreground(6, 255, 255, 255, 255);
		Background(6, 63, 63, 63, 255);
		Gradient(6, 63, 63, 63, 255);

		// selected, highlit, disabled
		Foreground(7, 255, 255, 255, 255);
		Background(7, 127, 127, 127, 255);
		Gradient(7, 127, 127, 127, 255);
	}

	// 50% black background
	DefineColorGroup("BACKGROUND")
	{
		// unselected, unhighlit
		Foreground(0, 255, 255, 255, 255);
		Background(0, 0, 0, 0, 127);
		Gradient(0, 0, 0, 0, 127);

		// selected, unhighlit
		Foreground(1, 255, 255, 255, 255);
		Background(1, 0, 0, 0, 127);
		Gradient(1, 0, 0, 0, 127);

		// unselected, highlit
		Foreground(2, 255, 255, 255, 255);
		Background(2, 0, 0, 0, 127);
		Gradient(2, 0, 0, 0, 127);

		// selected, highlit
		Foreground(3, 255, 255, 255, 255);
		Background(3, 0, 0, 0, 127);
		Gradient(3, 0, 0, 0, 127);
	}
	
		// 75% black background
	DefineColorGroup("DARKBACKGROUND")
	{
		// unselected, unhighlit
		Foreground(0, 255, 255, 255, 255);
		Background(0, 0, 0, 0, 193);
		Gradient(0, 0, 0, 0, 193);

		// selected, unhighlit
		Foreground(1, 255, 255, 255, 255);
		Background(1, 0, 0, 0, 193);
		Gradient(1, 0, 0, 0, 193);

		// unselected, highlit
		Foreground(2, 255, 255, 255, 255);
		Background(2, 0, 0, 0, 193);
		Gradient(2, 0, 0, 0, 193);

		// selected, highlit
		Foreground(3, 255, 255, 255, 255);
		Background(3, 0, 0, 0, 193);
		Gradient(3, 0, 0, 0, 193);
	}

	// opaque white
	DefineColorGroup("WHITE")
	{
		// unselected, unhighlit
		Foreground(0, 255, 255, 255, 255);
		Background(0, 255, 255, 255, 255);
		Gradient(0, 255, 255, 255, 255);

		// selected, unhighlit
		Foreground(1, 255, 255, 255, 255);
		Background(1, 255, 255, 255, 255);
		Gradient(1, 255, 255, 255, 255);

		// unselected, highlit
		Foreground(2, 255, 255, 255, 255);
		Background(2, 255, 255, 255, 255);
		Gradient(2, 255, 255, 255, 255);

		// selected, highlit
		Foreground(3, 255, 255, 255, 255);
		Background(3, 255, 255, 255, 255);
		Gradient(3, 255, 255, 255, 255);
	}

	// group unit icon
	DefineColorGroup("GROUPICON")
	{
		// normal mode
		Foreground(0, 255, 255, 255, 255);
		Background(0, 255, 255, 255, 255);
		Gradient(0, 255, 255, 255, 255);

		// attacked mode
		Foreground(1, 255, 255, 255, 255);
		Background(1, 255, 0, 0, 255);
		Gradient(1, 255, 0, 0, 255);

		// normal mode (ignore highlight)
		Foreground(2, 255, 255, 255, 255);
		Background(2, 255, 255, 255, 255);
		Gradient(2, 255, 255, 255, 255);

		// attacked mode (ignore highlight)
		Foreground(3, 255, 255, 255, 255);
		Background(3, 255, 0, 0, 255);
		Gradient(3, 255, 0, 0, 255);
	}

	// group unit background
	DefineColorGroup("GROUPBACK")
	{
		// unselected, unhighlit
		Foreground(0, 255, 255, 255, 255);
		Background(0, 0, 63, 127, 0);
		Gradient(0, 0, 63, 127, 0);

		// selected, unhighlit
		Foreground(1, 255, 255, 255, 255);
		Background(1, 127, 0, 63, 127);
		Gradient(1, 127, 0, 63, 127);

		// unselected, highlit
		Foreground(2, 255, 255, 255, 255);
		Background(2, 63, 95, 127, 0);
		Gradient(2, 63, 95, 127, 0);

		// selected, highlit
		Foreground(3, 255, 255, 255, 255);
		Background(3, 127, 63, 95, 127);
		Gradient(3, 127, 63, 95, 127);
	}

	DefineColorGroup("COMMANDTEXT")
	{
		// normal mode: inert
		Foreground(0, 255, 255, 255, 255);
		Background(0, 0, 127, 255, 127);
		Gradient(0, 0, 63, 127, 127);

		// normal mode: selected
		Foreground(1, 255, 255, 255, 255);
		Background(1, 255, 0, 127, 127);
		Gradient(1, 127, 0, 63, 127);

		// normal mode: highlit
		Foreground(2, 255, 255, 255, 255);
		Background(2, 127, 191, 255, 127);
		Gradient(2, 63, 95, 127, 127);

		// normal mode: highlit and selected 
		Foreground(3, 255, 255, 255, 255);
		Background(3, 255, 127, 191, 127);
		Gradient(3, 127, 63, 95, 127);

		// disabled mode: inert
		Foreground(4, 191, 191, 191, 255);
		Background(4, 63, 63, 63, 127);
		Gradient(4, 31, 31, 31, 127);

		// disabled mode: selected
		Foreground(5, 255, 255, 255, 255);
		Background(5, 127, 127, 127, 127);
		Gradient(5, 63, 63, 63, 127);

		// disabled mode: highlit
		Foreground(6, 255, 255, 255, 255);
		Background(6, 127, 127, 127, 127);
		Gradient(6, 63, 63, 63, 127);

		// disabled mode: highlit and selected 
		Foreground(7, 255, 255, 255, 255);
		Background(7, 255, 255, 255, 127);
		Gradient(7, 127, 127, 127, 127);

		// ghosted mode: inert
		Foreground(8, 255, 255, 255, 127);
		Background(8, 0, 127, 255, 127);
		Gradient(8, 0, 63, 127, 127);

		// ghosted mode: selected
		Foreground(9, 255, 255, 255, 255);
		Background(9, 255, 0, 127, 127);
		Gradient(9, 127, 0, 63, 127);

		// ghosted mode: highlit
		Foreground(10, 255, 255, 255, 255);
		Background(10, 127, 191, 255, 127);
		Gradient(10, 63, 95, 127, 127);

		// ghosted mode: highlit and selected
		Foreground(11, 255, 255, 255, 255);
		Background(11, 255, 127, 191, 127);
		Gradient(11, 127, 63, 95, 127);

		// darkened mode: inert
		Foreground(12, 127, 127, 127, 255);
		Background(12, 0, 0, 0, 127);
		Gradient(12, 0, 0, 0, 127);

		// darkened mode: selected
		Foreground(13, 255, 255, 255, 255);
		Background(13, 63, 63, 63, 127);
		Gradient(13, 31, 31, 31, 127);

		// darkened mode: highlit
		Foreground(14, 255, 255, 255, 255);
		Background(14, 63, 63, 63, 127);
		Gradient(14, 31, 31, 31, 127);

		// darkened mode: highlit and selected
		Foreground(15, 255, 255, 255, 255);
		Background(15, 127, 127, 127, 127);
		Gradient(15, 63, 63, 63, 127);
	}

	DefineColorGroup("COMMANDICON")
	{
		// normal mode: inert
		Foreground(0, 255, 255, 255, 255);
		Background(0, 255, 255, 255, 255);
		Gradient(0, 255, 255, 255, 255);

		// normal mode: selected
		Foreground(1, 255, 255, 255, 255);
		Background(1, 255, 255, 255, 255);
		Gradient(1, 255, 255, 255, 255);

		// normal mode: highlit
		Foreground(2, 255, 255, 255, 255);
		Background(2, 255, 255, 255, 255);
		Gradient(2, 255, 255, 255, 255);

		// normal mode: highlit and selected
		Foreground(3, 255, 255, 255, 255);
		Background(3, 255, 255, 255, 255);
		Gradient(3, 255, 255, 255, 255);

		// disabled mode: inert
		Foreground(4, 127, 127, 127, 255);
		Background(4, 127, 127, 127, 255);
		Gradient(4, 127, 127, 127, 255);

		// disabled mode: selected
		Foreground(5, 255, 255, 255, 255);
		Background(5, 255, 255, 255, 255);
		Gradient(5, 255, 255, 255, 255);

		// disabled mode: highlit
		Foreground(6, 255, 255, 255, 255);
		Background(6, 255, 255, 255, 255);
		Gradient(6, 255, 255, 255, 255);

		// disabled mode: highlit and selected
		Foreground(7, 255, 255, 255, 255);
		Background(7, 255, 255, 255, 255);
		Gradient(7, 255, 255, 255, 255);

		// ghosted mode: inert
		Foreground(8, 255, 255, 255, 127);
		Background(8, 255, 255, 255, 127);
		Gradient(8, 255, 255, 255, 127);

		// ghosted mode: selected
		Foreground(9, 255, 255, 255, 255);
		Background(9, 255, 255, 255, 255);
		Gradient(9, 255, 255, 255, 255);

		// ghosted mode: highlit
		Foreground(10, 255, 255, 255, 255);
		Background(10, 255, 255, 255, 255);
		Gradient(10, 255, 255, 255, 255);

		// ghosted mode: highlit and selected
		Foreground(11, 255, 255, 255, 255);
		Background(11, 255, 255, 255, 255);
		Gradient(11, 255, 255, 255, 255);

		// darkened mode: inert
		Foreground(12, 63, 63, 63, 255);
		Background(12, 63, 63, 63, 255);
		Gradient(12, 63, 63, 63, 255);

		// darkened mode: selected
		Foreground(13, 255, 255, 255, 255);
		Background(13, 255, 255, 255, 255);
		Gradient(13, 255, 255, 255, 255);

		// darkened mode: highlit
		Foreground(14, 255, 255, 255, 255);
		Background(14, 255, 255, 255, 255);
		Gradient(14, 255, 255, 255, 255);

		// darkened mode: highlit and selected
		Foreground(15, 255, 255, 255, 255);
		Background(15, 255, 255, 255, 255);
		Gradient(15, 255, 255, 255, 255);
	}

	DefineColorGroup("LANCOLOR")
	{
		// unselected, unhighlit  
		Foreground(0, 150, 150, 150, 240);
		Background(0, 190, 190, 190, 230);
		Gradient(0, 100, 100, 100, 230);

		// selected, unhighlit
		Foreground(1, 225, 0, 0, 255);
		Background(1, 200, 200, 200, 255);
		Gradient(1, 155, 155, 155, 255);

		// unselected, highlit
		Foreground(2, 255, 255, 255, 255);
		Background(2, 255, 0, 0, 255);
		Gradient(2, 127, 0, 0, 255);

		// selected, highlit
		Foreground(3, 255, 255, 255, 255);
		Background(3, 255, 190, 40, 255);
		Gradient(3, 150, 80, 0, 255);
	}

	DefineColorGroup("HULLGAUGE")
	{
		// state 0: normal
		Foreground(0, 0, 255, 0, 127);
		Background(0, 0, 0, 0, 127);
		Gradient(0, 0, 0, 0, 127);

		// state 1: low
		Foreground(1, 255, 255, 0, 127);
		Background(1, 0, 0, 0, 127);
		Gradient(1, 0, 0, 0, 127);

		// state 2: critical
		Foreground(2, 255, 0, 0, 127);
		Background(2, 0, 0, 0, 127);
		Gradient(2, 0, 0, 0, 127);

		// state 3: empty
		Foreground(3, 0, 0, 0, 127);
		Background(3, 0, 0, 0, 127);
		Gradient(3, 0, 0, 0, 127);
	}

	DefineColorGroup("AMMOGAUGE")
	{
		// state 0: normal
		Foreground(0, 0, 127, 255, 127);
		Background(0, 0, 0, 0, 127);
		Gradient(0, 0, 0, 0, 127);

		// state 1: low
		Foreground(1, 0, 127, 255, 127);
		Background(1, 0, 0, 0, 127);
		Gradient(1, 0, 0, 0, 127);

		// state 2: critical
		Foreground(2, 0, 127, 255, 127);
		Background(2, 0, 0, 0, 127);
		Gradient(2, 0, 0, 0, 127);

		// state 3: empty
		Foreground(3, 0, 0, 0, 127);
		Background(3, 0, 0, 0, 127);
		Gradient(3, 0, 0, 0, 127);
	}
}

//
// CONFIGURE SOUNDS
//
ConfigureInterface()
{
	DefaultSound("MouseEnter", "shmroll.wav");
	DefaultSound("MouseLeave", "");
	DefaultSound("ButtonPress", "shmclick.wav");
	DefaultSound("ButtonRelease", "");
}

//
// CONFIGURE CURSORS
//
ConfigureCursors()
{
	// DEFAULT CURSOR
	CreateCursor("Default")
	{
		Size(32, 32);
		Hotspot(5, 10);
		Image("cursor.tga");
		Frames(0, 15);
  	}

	// HIGHLIGHT CURSOR
	CreateCursor("Highlight")
  	{
	    	Size(32, 32);
    		Hotspot(5, 10);
    		Image("cursor.tga");
		Frames(0, 15);
  	}

	// SET STANDARD CURSORS
  	StandardCursors()
	{
		Default("Default");
		IBeam("Default");
		Wait("Default");
		No("Default");
	}
}

// Default UI size/position
Cmd("gameprefs.Play_MapRadarHeight 128");
Cmd("gameprefs.Play_MapRadarWidth 128");
Cmd("gameprefs.Play_MapRadarXDiff 30");
Cmd("gameprefs.Play_MapRadarYDiff -10");

Cmd("gameprefs.Edit_MapRadarHeight 128");
Cmd("gameprefs.Edit_MapRadarWidth 128");
Cmd("gameprefs.Edit_MapRadarXDiff -30");
Cmd("gameprefs.Edit_MapRadarYDiff -10");

Cmd("gameprefs.Play_CockpitRadarHeight 140");
Cmd("gameprefs.Play_CockpitRadarWidth 260");
Cmd("gameprefs.Play_CockpitRadarXDiff 35");
// Cmd("gameprefs.Play_CockpitRadarXSIScale 0.75");  // Don't touch this, just the height/width/pos

Cmd("gameprefs.TargetViewWidthMult 0.25");
Cmd("gameprefs.TargetViewHeightMult 0.25");
Cmd("gameprefs.TargetViewXMult 0.75");
Cmd("gameprefs.TargetViewXDiff -10.0");
Cmd("gameprefs.TargetViewYMult 0.0");
Cmd("gameprefs.TargetViewYDiff 60.0");
