//-------------------------------------------------------------------------------------------
//
// Note:
// Much of the menu structure defined here is accessed internally by CCMDs
// and menu generation code. If you want to design your own menus make sure
// that they are named identically and that links to all important submenus
// are present.
//
//-------------------------------------------------------------------------------------------

DEFAULTLISTMENU
{
	Font "BigFont", "Untranslated"
	IfGame(Doom, Chex)
	{
		Selector "M_SKULL1", -32, -5
		Linespacing 16
		Font "BigFont", "Red"
	}
	IfGame(Strife)
	{
		Selector "M_CURS1", -28, -5
		Linespacing 19
	}
	IfGame(Heretic, Hexen)
	{
		Selector "M_SLCTR1", -28, -1
		Linespacing 20
	}
}

//-------------------------------------------------------------------------------------------
//
// The main menu. There's a lot of differences here between the games
//
//-------------------------------------------------------------------------------------------

LISTMENU "MainMenu"
{
	IfGame(Doom, Chex)
	{
		StaticPatch 94, 2, "M_DOOM"
		Position 97, 72
		IfOption(ReadThis)
		{
			Position 97, 64
		}
	}
	IfGame(Strife)
	{
		StaticPatch 84, 2, "M_STRIFE"
		Position 97, 45
	}
	IfGame(Heretic)
	{
		StaticPatch 88, 0, "M_HTIC"
		StaticPatch 40, 10, "M_SKL01"
		StaticPatch 232, 10, "M_SKL00"
		Position 110, 56
	}
	IfGame(Hexen)
	{
		StaticPatch 88, 0, "M_HTIC"
		StaticPatch 37, 80, "FBULB0"
		StaticPatch 278, 80, "FBULA0"
		Position 110, 56
	}
	
	IfGame(Doom, Strife, Chex)
	{
		PatchItem "M_NGAME", "n", "PlayerclassMenu"
		ifOption(SwapMenu)
		{
			PatchItem "M_LOADG", "l", "LoadGameMenu"
			PatchItem "M_SAVEG", "s", "SaveGameMenu"
			PatchItem "M_OPTION","o", "OptionsMenu"
		}
		else
		{
			PatchItem "M_OPTION","o", "OptionsMenu"
			PatchItem "M_LOADG", "l", "LoadGameMenu"
			PatchItem "M_SAVEG", "s", "SaveGameMenu"
		}
		ifOption(ReadThis)
		{
			PatchItem "M_RDTHIS","r", "ReadThisMenu"
		}
		PatchItem "M_QUITG", "q", "QuitMenu"
	}
	
	IfGame(Heretic, Hexen)
	{
		TextItem "$MNU_NEWGAME", "n", "PlayerclassMenu"
		TextItem "$MNU_OPTIONS", "o", "OptionsMenu"
		TextItem "$MNU_GAMEFILES", "g", "GameFilesMenu"
		TextItem "$MNU_INFO", "i", "ReadThisMenu"
		TextItem "$MNU_QUITGAME", "q", "QuitMenu"
	}
}

//-------------------------------------------------------------------------------------------
//
// Important note about the following template menus:
// Don't even think about replacing them with something that's not an empty menu
// with some static elements only. Proper function is not guaranteed then.
//
//-------------------------------------------------------------------------------------------

//-------------------------------------------------------------------------------------------
//
// The player class menu
// The init code will set the first item to 'autoselect' if it's the only one.
//
//-------------------------------------------------------------------------------------------

ListMenu "PlayerclassMenu"
{
	IfGame(Doom, Heretic, Hexen, Strife)
	{
		NetgameMessage "$NEWGAME"
	}
	IfGame(Chex)
	{
		NetgameMessage "$CNEWGAME"
	}

	IfGame(Doom, Strife, Chex)
	{
		StaticTextCentered 160, 15, "$MNU_CHOOSECLASS"
		Position 48, 63
		PlayerDisplay 220, 63, "20 00 00", "80 00 40"
		MouseWindow 0, 220
	}
	IfGame(Heretic)
	{
		StaticTextCentered 160, 15, "$MNU_CHOOSECLASS"
		Position 80, 50
		PlayerDisplay 220, 50, "20 00 00", "80 00 40"
		MouseWindow 0, 220
	}
	IfGame(Hexen)
	{
		StaticText 34, 24, "$MNU_CHOOSECLASS"
		Position 66, 58
		PlayerDisplay 174, 8, "00 07 00", "40 53 40"
		MouseWindow 0, 174
	}
	// The rest of this menu will be set up based on the actual player definitions.
}

//-------------------------------------------------------------------------------------------
//
// The episode menu
// The init code will set the first item to 'autoselect' if it's the only one.
//
//-------------------------------------------------------------------------------------------

ListMenu "EpisodeMenu"
{
	IfGame(Doom, Heretic, Hexen, Strife)
	{
		NetgameMessage "$NEWGAME"
	}
	IfGame(Chex)
	{
		NetgameMessage "$CNEWGAME"
	}

	IfGame(Doom, Chex)
	{
		Position 48, 63
		StaticPatch 54, 38, "M_EPISOD"
	}
	IfGame(Strife)
	{
		Position 48, 63
		StaticText 54, 38, "$MNU_EPISODE"
	}
	IfGame(Heretic, Hexen)
	{
		Position 80, 50
	}
	// items will be filled in by MAPINFO
}

//-------------------------------------------------------------------------------------------
//
// The skill menu
// Most of this will be filled in at runtime
//
//-------------------------------------------------------------------------------------------

ListMenu "SkillMenu"
{

	IfGame(Doom, Chex)
	{
		StaticPatch 96, 14, "M_NEWG"
	}
	IfGame(Strife)
	{
		StaticPatch 96, 14, "M_NGAME"
	}
	IfGame(Doom, Strife, Chex)
	{
		StaticPatch 54, 38, "M_SKILL"
		Position 48, 63
	}
	IfGame (Heretic)
	{
		Position 38, 30
	}
	IfGame (Hexen)
	{
		StaticText 74, 16, "$MNU_CHOOSESKILL"
		Position 160, 44
		centermenu
	}
}

//-------------------------------------------------------------------------------------------
//
// Raven's game files menu
//
//-------------------------------------------------------------------------------------------

ListMenu "GameFilesMenu"
{
	Position 110, 60
	TextItem "$MNU_LOADGAME", "l", "LoadGameMenu"
	TextItem "$MNU_SAVEGAME", "s", "SaveGameMenu"
}

//-------------------------------------------------------------------------------------------
//
// Base definition for load game menu. Only the configurable part is done here
//
//-------------------------------------------------------------------------------------------

ListMenu "LoadGameMenu"
{
	IfGame(Doom, Heretic, Hexen, Strife)
	{
		NetgameMessage "$LOADNET"
	}
	IfGame(Chex)
	{
		NetgameMessage "$CLOADNET"
	}
	IfGame(Doom, Strife, Chex)
	{
		StaticPatchCentered 160, -20, "M_LOADG"
	}
	IfGame(Heretic, Hexen)
	{
		StaticTextCentered 160, -10, "$MNU_LOADGAME"
	}
	Position 80,54
	Class "LoadMenu"	// uses its own implementation
}

//-------------------------------------------------------------------------------------------
//
// Base definition for save game menu. Only the configurable part is done here
//
//-------------------------------------------------------------------------------------------

ListMenu "SaveGameMenu"
{
	IfGame(Doom, Strife, Chex)
	{
		StaticPatchCentered 160, -20, "M_SAVEG"
	}
	IfGame(Heretic, Hexen)
	{
		StaticTextCentered 160, -10, "$MNU_SAVEGAME"
	}
	Position 80,54
	Class "SaveMenu"	// uses its own implementation
}

//-------------------------------------------------------------------------------------------
//
// The option menu
//
//-------------------------------------------------------------------------------------------

OptionValue "YesNo"
{
	0, "No"
	1, "Yes"
}

OptionValue "NoYes"
{
	0, "Yes"
	1, "No"
}

OptionValue "OnOff"
{
	0, "Off"
	1, "On"
}

OptionValue "OffOn"
{
	0, "On"
	1, "Off"
}

OptionMenuSettings
{
	// These can be overridden if a different menu fonts requires it.
	Linespacing 8
	IfGame(Heretic, Hexen)
	{
		Linespacing 9
	}
}

DefaultOptionMenu
{
	Position -15
	IfGame(Heretic, Hexen)
	{
		Position -13
	}
}

OptionMenu "OptionsMenu"
{
	Title "OPTIONS"
	Submenu "Customize Controls",		"CustomizeControls"
	Submenu "Mouse options",			"MouseOptions"
	Submenu "Joystick options",			"JoystickOptions"
	StaticText " "
	Submenu "Player Setup",				"PlayerMenu"
	Submenu "Gameplay Options",			"GameplayOptions"
	Submenu "Compatibility Options",	"CompatibilityOptions"
	Submenu "Automap Options",			"AutomapOptions"
	Submenu "HUD Options",				"HUDOptions"
	Submenu "Miscellaneous Options",	"MiscOptions"
	Submenu "Network Options",			"NetworkOptions"
	Submenu "Sound Options",			"SoundOptions"
	Submenu "Display Options",			"VideoOptions"
	Submenu "Set video mode",			"VideoModeMenu"
	StaticText " "
	SafeCommand "Reset to defaults",	"reset2defaults"
	SafeCommand	"Reset to last saved",	"reset2saved"
	Command "Go to console",			"menuconsole"
}

//-------------------------------------------------------------------------------------------
//
// The player menu
//
//-------------------------------------------------------------------------------------------

OptionValue "Gender"
{
	0, "Male"
	1, "Female"
	2, "Other"
}

ListMenu "PlayerMenu"
{
	StaticTextCentered 160, 6, "$MNU_PLAYERSETUP"
	Font "SmallFont"
	Linespacing 14
	Position 48, 36

	IfGame (Doom, Strife, Chex)
	{
		PlayerNameBox "Name", 0, "Playerbox"
		Selector "-", -16, -1
	}
	IfGame(Heretic, Hexen)
	{
		PlayerNameBox "Name", 5, "Playerbox"
		Selector "-", -16, 1
	}
	IfGame(Doom, Heretic, Strife, Chex)
	{
		MouseWindow 0, 220
		PlayerDisplay 220, 80, "20 00 00", "80 00 40", 1, "PlayerDisplay"
	}
	IfGame(Hexen)
	{
		MouseWindow 0, 220
		PlayerDisplay 220, 80, "00 07 00", "40 53 40", 1, "PlayerDisplay"
	}
	
	ValueText "Team", "Team"
	ValueText "Color", "Color"
	Linespacing 10
	Slider "Red", "Red", 0, 255, 16
	Slider "Green", "Green", 0, 255, 16
	Linespacing 14
	Slider "Blue", "Blue", 0, 255, 16
	ValueText "Class", "Class"
	ValueText "Skin", "Skin"
	ValueText "Gender", "Gender", "Gender"
	Slider "Autoaim", "Autoaim", 0, 35, 1
	ValueText "Switch on pickup", "Switch", "OffOn"
	ValueText "Always Run", "AlwaysRun", "OnOff"
	Class "PlayerMenu"
}

//-------------------------------------------------------------------------------------------
//
// Controls Menu
//
//-------------------------------------------------------------------------------------------

OptionMenu "CustomizeControls"
{
	Title "CUSTOMIZE CONTROLS"
	ScrollTop 2
	StaticTextSwitchable 	"ENTER to change, BACKSPACE to clear", "Press new key for control, ESC to cancel", "ControlMessage"
	StaticText 	""
	StaticText 	"Controls", 1
	Control 	"Fire",					"+attack"
	Control 	"Secondary Fire",		"+altattack"
	Control 	"Weapon Reload",		"+reload"
	Control 	"Weapon Zoom",			"+zoom"
	Control		"Weapon State 1",		"+user1"
	Control		"Weapon State 2",		"+user2"
	Control		"Weapon State 3",		"+user3"
	Control		"Weapon State 4",		"+user4"
	Control 	"Use / Open",			"+use"
	Control 	"Move forward",			"+forward"
	Control 	"Move backward",		"+back"
	Control 	"Strafe left",			"+moveleft"
	Control 	"Strafe right",			"+moveright"
	Control 	"Turn left",			"+left"
	Control 	"Turn right",			"+right"
	Control		"Quick Turn",			"turn180"
	Control 	"Jump",					"+jump"
	Control 	"Crouch",				"+crouch"
	Control 	"Crouch Toggle",		"crouch"
	Control 	"Fly / Swim up",		"+moveup"
	Control 	"Fly / Swim down",		"+movedown"
	Control 	"Stop flying",			"land"
	Control 	"Mouse look",			"+mlook"
	Control 	"Keyboard look",		"+klook"
	Control 	"Look up",				"+lookup"
	Control 	"Look down",			"+lookdown"
	Control 	"Center view",			"centerview"
	Control 	"Run",					"+speed"
	Control 	"Toggle Run",			"toggle cl_run"
	Control 	"Strafe",				"+strafe"
	Control 	"Show Scoreboard",		"+showscores"
	Control 	"Toggle Scoreboard",	"togglescoreboard"
	StaticText 	""
	StaticText 	"Chat", 1
	Control 	"Say",					"messagemode"
	Control 	"Team say",				"messagemode2"
	StaticText 	""
	StaticText 	"Weapons", 1
	Control 	"Next weapon",			"weapnext"
	Control 	"Previous weapon",		"weapprev"
	Control		"Weapon Slot 1",		"slot 1"
	Control		"Weapon Slot 2",		"slot 2"
	Control		"Weapon Slot 3",		"slot 3"
	Control		"Weapon Slot 4",		"slot 4"
	Control		"Weapon Slot 5",		"slot 5"
	Control		"Weapon Slot 6",		"slot 6"
	Control		"Weapon Slot 7",		"slot 7"
	Control		"Weapon Slot 8",		"slot 8"
	Control		"Weapon Slot 9",		"slot 9"
	Control		"Weapon Slot 0",		"slot 0"
	StaticText 	""
	StaticText 	"Inventory", 1
	Control 	"Activate item",		"invuse"
	Control 	"Activate all items",	"invuseall"
	Control 	"Next item",			"invnext"
	Control 	"Previous item",		"invprev"
	Control 	"Drop item",			"invdrop"
	Control		"Query item",			"invquery"
	Control 	"Drop weapon",			"weapdrop"
	StaticText 	""
	StaticText 	"Other", 1
	Control 	"Toggle automap",		"togglemap"
	Control 	"Chasecam",				"chase"
	Control 	"Coop spy",				"spynext"
	Control 	"Screenshot",			"screenshot"
	Control  	"Open console",			"toggleconsole"
	StaticText 	""
	StaticText 	"Strife Popup Screens", 1
	Control 	"Mission objectives",	"showpop 1"
	Control 	"Keys list",			"showpop 2"
	Control 	"Weapons/ammo/stats",	"showpop 3"
}

//-------------------------------------------------------------------------------------------
//
// Mouse Menu
//
//-------------------------------------------------------------------------------------------

OptionValue "Corners"
{
	-1, "Off"
	0, "Upper left"
	1, "Upper right"
	2, "Lower left"
	3, "Lower right"
}

OptionValue "MenuMouse"
{
	0, "No"
	1, "Yes"
	2, "Touchscreen-like"
}

OptionString "Cursors"
{
	"None", "Default"
	"cursor", "Simple arrow"
	"doomcurs", "Doom"
	"herecurs", "Heretic"
	"hexncurs", "Hexen"
	"strfcurs", "Strife"
	"chexcurs", "Chex"
	"-", "System cursor"
}

OptionMenu "MouseOptions"
{
	Title "MOUSE OPTIONS"
	Option "Enable mouse",				"use_mouse", "YesNo"
	Option "Enable mouse in menus",	"m_use_mouse", "MenuMouse", "use_mouse"
	Option "Show back button",		"m_show_backbutton", "Corners", "use_mouse"
	Option "Cursor",				"vid_cursor", "Cursors"
	StaticText 	""
	Slider "Overall sensitivity",		"mouse_sensitivity", 0.5, 2.5, 0.1
	Option "Prescale mouse movement",	"m_noprescale", "NoYes"
	Option "Smooth mouse movement",		"smooth_mouse", "YesNo"
	StaticText 	""
	Slider "Turning speed",				"m_yaw", 0, 2.5, 0.1
	Slider "Mouselook speed",			"m_pitch", 0, 2.5, 0.1
	Slider "Forward/Backward speed",	"m_forward", 0, 2.5, 0.1
	Slider "Strafing speed",			"m_side", 0, 2.5, 0.1
	StaticText 	""
	Option "Always Mouselook",			"freelook", "OnOff"
	Option "Invert Mouse",				"invertmouse", "OnOff"
	Option "Lookspring",				"lookspring", "OnOff"
	Option "Lookstrafe",				"lookstrafe", "OnOff"
}


//-------------------------------------------------------------------------------------------
//
// Joystick Menu
//
//-------------------------------------------------------------------------------------------

OptionMenu "JoystickOptions"
{
	Title "CONTROLLER OPTIONS"
	// Will be filled in by joystick code.
}

OptionValue "JoyAxisMapNames"
{
	-1, "None"
	0, "Turning"
	1, "Looking Up/Down"
	2, "Moving Forward"
	3, "Strafing"
	4, "Moving Up/Down"
}

OptionValue "Inversion"
{
	0, "Not Inverted"
	1, "Inverted"
}

OptionMenu "JoystickConfigMenu"
{
	Title "CONFIGURE CONTROLLER"
	Class "JoystickConfigMenu"
	// Will be filled in by joystick code.
}


//-------------------------------------------------------------------------------------------
//
// Video Menu
//
//-------------------------------------------------------------------------------------------

OptionValue ColumnMethods 
{
	0.0, "Original"
	1.0, "Optimized"
}

OptionValue RocketTrailTypes 
{
	0.0, "Off"
	1.0, "Particles"
	2.0, "Sprites"
	3.0, "Sprites & Particles"
}

OptionValue BloodTypes 
{
	0.0, "Sprites"
	1.0, "Sprites & Particles"
	2.0, "Particles"
}

OptionValue PuffTypes 
{
	0.0, "Sprites"
	1.0, "Particles"
}

OptionValue Wipes 
{
	0.0, "None"
	1.0, "Melt"
	2.0, "Burn"
	3.0, "Crossfade"
}

OptionValue Endoom 
{
	0.0, "Off"
	1.0, "On"
	2.0, "Only modified"
}

OptionValue Contrast 
{
	0.0, "Off"
	1.0, "On"
	2.0, "Smooth"
}

OptionValue Fuzziness
{
	0.0, "Translucent"
	1.0, "Fuzz"
	2.0, "Shadow"
}

OptionMenu "VideoOptions"
{
	Title "DISPLAY OPTIONS"
	
	Submenu "Scoreboard Options", 		"ScoreboardOptions"
	StaticText " "
	Slider "Screen size",				"screenblocks", 3.0, 12.0, 1.0, 0
	Slider "Brightness",				"Gamma", 0.75, 3.0, 0.05, 2
	Option "Vertical Sync",				"vid_vsync", "OnOff"
	Option "Rendering Interpolation",	"cl_capfps", "OffOn"
	Option "Column render mode",		"r_columnmethod", "ColumnMethods"

	StaticText " "
	Option "Screen wipe style",			"wipetype", "Wipes"

	IfOption(Windows)
	{
		Option	"Show ENDOOM screen",	"showendoom", "Endoom"
		//Option "DirectDraw palette hack", "vid_palettehack", "OnOff"
		//Option "Use attached surfaces", "vid_attachedsurfaces", "OnOff"
	}
	
	Option "Stretch short skies",		"r_stretchsky", "OnOff"
	Option "Use fuzz effect",			"r_drawfuzz", "Fuzziness"
	Slider "Lost Soul translucency",	"transsouls", 0.25, 1.0, 0.05, 2
	Option "Use fake contrast",			"r_fakecontrast", "Contrast"
	Option "Rocket Trails",				"cl_rockettrails", "RocketTrailTypes"
	Option "Blood Type",				"cl_bloodtype", "BloodTypes"
	Option "Bullet Puff Type",			"cl_pufftype", "PuffTypes"
	Slider "Number of particles",		"r_maxparticles", 100, 10000, 100, 0
	Slider "Number of decals",			"cl_maxdecals", 0, 10000, 100, 0
	Option "Show player sprites",		"r_drawplayersprites", "OnOff"
	Option "Death camera",				"r_deathcamera", "OnOff"
	Option "Teleporter zoom",			"telezoom", "OnOff"
	Slider "Earthquake shake intensity",	"r_quakeintensity", 0.0, 1.0, 0.05, 2
	Option "Interpolate monster movement",	"nomonsterinterpolation", "NoYes"
	Slider "Menu dim",					"dimamount", 0, 1.0, 0.05, 2
	ColorPicker "Dim color",			"dimcolor"
}

//-------------------------------------------------------------------------------------------
//
// HUD menu
//
//-------------------------------------------------------------------------------------------

OptionValue DisplayTagsTypes 
{
	0.0, "None"
	1.0, "Items"
	2.0, "Weapons"
	3.0, "Both"
}

OptionValue TextColors
{
	0.0, "\cabrick"
	1.0, "\cbtan"
	2.0, "\ccgray"
	3.0, "\cdgreen"
	4.0, "\cebrown"
	5.0, "\cfgold"
	6.0, "\cgred"
	7.0, "\chblue"
	8.0, "\ciorange"
	9.0, "\cjwhite"
	10.0, "\ckyellow"
	11.0, "\cldefault"
	12.0, "\cmblack"
	13.0, "\cnlight blue"
	14.0, "\cocream"
	15.0, "\cpolive"
	16.0, "\cqdark green"
	17.0, "\crdark red"
	18.0, "\csdark brown"
	19.0, "\ctpurple"
	20.0, "\cudark gray"
	21.0, "\cvcyan"
}

OptionValue Crosshairs
{
	// will be filled in from the XHAIRS lump
}

OptionValue ZDoomHexen
{
	0.0, "ZDoom"
	1.0, "Hexen"
}

OptionValue ZDoomStrife
{
	0.0, "ZDoom"
	1.0, "Strife"
}

OptionMenu "HUDOptions"
{
	Title "HUD Options"
	Submenu "Alternative HUD",			"AltHudOptions"
	Submenu "Message Options", 			"MessageOptions"
	StaticText " "
	Option "Default Crosshair",			"crosshair", "Crosshairs"
	Option "Force default crosshair",	"crosshairforce", "OnOff"
	Option "Grow crosshair when picking up items",	"crosshairgrow", "OnOff"
	ColorPicker "Crosshair color", 		"crosshaircolor"
	Option "Crosshair shows health",	"crosshairhealth", "OnOff"
	Option "Scale crosshair",			"crosshairscale", "OnOff"
	StaticText " "
	Option "Display nametags",			"displaynametags", "DisplayTagsTypes"
	Option "Nametag color",				"nametagcolor", "TextColors", "displaynametags"
	Option "Stretch status bar",		"st_scale", "OnOff"
	Option "Stretch Fullscreen HUD",	"hud_scale", "OnOff"
	Option "Use old ouch mug shot formula",	"st_oldouch", "OnOff"
	StaticText " "
	Option "Hexen weapon flashes",		"pf_hexenweaps",	"ZDoomHexen"
	Option "Poison damage flashes",		"pf_poison",		"ZDoomHexen"
	Option "Ice death flashes",			"pf_ice",			"ZDoomHexen"
	Option "Poison Buildup flashes",	"pf_hazard",		"ZDoomStrife"
}
	
//-------------------------------------------------------------------------------------------
//
// Alternative HUD
//
//-------------------------------------------------------------------------------------------

OptionValue "AMCoordinates"
{
	0, "Player"
	1, "Map"
}

OptionValue "AltHUDScale"
{
	0, "Off"
	1, "Scale to 640x400"
	2, "Pixel double"
}

OptionValue "AltHUDAmmo"
{
	0, "Current weapon"
	1, "Available weapons"
	2, "All weapons"
}

OptionValue "AltHUDTime"
{
	0, "Off"
	1, "Level, milliseconds"
	2, "Level, seconds"
	3, "Level"
	4, "Hub, seconds"
	5, "Hub"
	6, "Total, seconds"
	7, "Total"
	8, "System, seconds"
	9, "System"
}

OptionValue "AltHUDLag"
{
	0, "Off"
	1, "Netgames only"
	2, "Always"
}

OptionMenu "AltHUDOptions"
{
	Title "Alternative HUD"
	//Indent 220
	Option "Enable alternative HUD",				"hud_althud", "OnOff"
	Option "Stretch alternative HUD",				"hud_althudscale", "AltHUDScale"
	Option "Show secret count",						"hud_showsecrets", "OnOff"
	Option "Show monster count",					"hud_showmonsters", "OnOff"
	Option "Show item count",						"hud_showitems", "OnOff"
	Option "Show stamina and accuracy",				"hud_showstats", "OnOff"
	Option "Show berserk",							"hud_berserk_health", "OnOff"
	Option "Show weapons",							"hud_showweapons", "OnOff"
	Option "Show ammo for",							"hud_showammo", "AltHUDAmmo"
	Option "Show time",								"hud_showtime", "AltHUDTime"
	Option "Time color",							"hud_timecolor", "TextColors"
	Option "Show network latency",					"hud_showlag", "AltHUDLag"
	Slider "Red ammo display below %",				"hud_ammo_red", 0, 100, 1, 0
	Slider "Yellow ammo display below %",			"hud_ammo_yellow", 0, 100, 1, 0
	Slider "Red health display below",				"hud_health_red", 0, 100, 1, 0
	Slider "Yellow health display below",			"hud_health_yellow", 0, 100, 1, 0
	Slider "Green health display below",			"hud_health_green", 0, 100, 1, 0
	Slider "Red armor display below",				"hud_armor_red", 0, 100, 1, 0
	Slider "Yellow armor display below",			"hud_armor_yellow", 0, 100, 1, 0
	Slider "Green armor display below",				"hud_armor_green", 0, 100, 1, 0
	StaticText " "
	StaticText "Alternative Automap HUD", 1
	option "Map title color",						"hudcolor_titl", "TextColors"
	option "Map time color",						"hudcolor_ltim", "TextColors"
	option "Hub time color",						"hudcolor_time", "TextColors"
	option "Total time color",						"hudcolor_ttim", "TextColors"
	option "Coordinate color",						"hudcolor_xyco", "TextColors"
	option "Coordinate mode",						"map_point_coordinates", "AMCoordinates"
	option "Statistics name color",					"hudcolor_statnames", "TextColors"
	option "Statistics color",						"hudcolor_stats", "TextColors"
}

//-------------------------------------------------------------------------------------------
//
// Misc menu
//
//-------------------------------------------------------------------------------------------

OptionValue Autosave
{
	0,	"Always"
	1,	"Scripts Only"
	2,	"Never"
}

OptionValue dehopt
{
	0,	"Never"
	1,	"All"
	2,	"Only last one"
}

OptionMenu "MiscOptions"
{
	Title "Miscellaneous Options"
	//Indent 220
	IfOption(Windows)
	{
		Option "Merge left+right Alt/Ctrl/Shift", 		"k_mergekeys", "OnOff"
		Option "Alt-Enter toggles fullscreen",			"k_allowfullscreentoggle", "OnOff"
	}
	IfOption(Mac)
	{
		Option "Command-F toggles fullscreen",			"k_allowfullscreentoggle", "OnOff"
	}
	Option "Show IWAD selection dialog",			"queryiwad", "OnOff"
	StaticText " "
	Option "Enable cheats from all games",			"allcheats", "OnOff"
	Option "Enable autosaves",						"disableautosave", "Autosave"
	Slider "Number of autosaves",					"autosavecount", 1, 20, 1, 0
	Option "Load *.deh/*.bex lumps",				"dehload", "dehopt"
	StaticText " "
	Option "Cache nodes",							"gl_cachenodes", "OnOff"
	Slider "Time threshold for node caching",		"gl_cachetime", 0.0, 2.0, 0.1
	SafeCommand "Clear node cache",					"clearnodecache"
}

//-------------------------------------------------------------------------------------------
//
// Automap Menu
//
//-------------------------------------------------------------------------------------------

OptionValue MapColorTypes
{
	0, "Custom"
	1, "Traditional Doom"
	2, "Traditional Strife"
	3, "Traditional Raven"
}

OptionValue SecretTypes
{
	0, "Never"
	1, "Only when found"
	2, "Always"
}

OptionValue RotateTypes
{
	0, "Off"
	1, "On"
	2, "On for overlay only"
}

OptionValue OverlayTypes
{
	0, "Off"
	1, "Overlay+Normal"
	2, "Overlay Only"
}

OptionValue MaplabelTypes
{
	0, "Never"
	1, "Always"
	2, "Not for hubs"
}

OptionValue STSTypes
{
	0, "Off"
	1, "Front"
	2, "Animated"
	3, "Rotated"
}

OptionValue MapBackTypes
{
	0, "Off"
	1, "On"
	2, "Map defined colors only"
}

OptionMenu AutomapOptions
{
	Title "AUTOMAP OPTIONS"
	Option "Map color set",				"am_colorset", "MapColorTypes"
	Option "Allow map defined colors",	"am_customcolors", "YesNo"
	Submenu "Set custom colors",		"MapColorMenu"
	Submenu "Customize map controls",	"MapControlsMenu"
	StaticText " "
	Option "Rotate automap",			"am_rotate", "RotateTypes"
	Option "Overlay automap",			"am_overlay", "OverlayTypes"
	Option "Enable textured display",	"am_textured", "OnOff"
	Option "Follow player",				"am_followplayer", "OnOff"
	StaticText " "
	Option "Show item counts",			"am_showitems", "OnOff"
	Option "Show monster counts",		"am_showmonsters", "OnOff"
	Option "Show secret counts",		"am_showsecrets", "OnOff"
	Option "Show time elapsed",			"am_showtime", "OnOff"
	Option "Show total time elapsed",	"am_showtotaltime", "OnOff"
	Option "Show secrets on map",		"am_map_secrets", "SecretTypes"
	Option "Show map label",			"am_showmaplabel", "MaplabelTypes"
	Option "Draw map background",		"am_drawmapback", "MapBackTypes"
	Option "Show keys (cheat)",			"am_showkeys", "OnOff"
	Option "Show trigger lines",		"am_showtriggerlines", "OnOff"
	Option "Show things as sprites",	"am_showthingsprites", "STSTypes"
}

//-------------------------------------------------------------------------------------------
//
// Automap Controls
//
//-------------------------------------------------------------------------------------------

OptionMenu MapControlsMenu
{
	Title "CUSTOMIZE MAP CONTROLS"
	ScrollTop 2
	StaticTextSwitchable 	"ENTER to change, BACKSPACE to clear", "Press new key for control, ESC to cancel", "ControlMessage"
	StaticText 	""
	StaticText "Map Controls", 1
	MapControl "Pan left",		"+am_panleft"
	MapControl "Pan right",		"+am_panright"
	MapControl "Pan up",		"+am_panup"
	MapControl "Pan down",		"+am_pandown"
	MapControl "Zoom in",		"+am_zoomin"
	MapControl "Zoom out",		"+am_zoomout"
	MapControl "Toggle zoom",	"am_gobig"
	MapControl "Toggle follow",	"am_togglefollow"
	MapControl "Toggle grid",	"am_togglegrid"
	MapControl "Toggle texture","am_toggletexture"
	MapControl "Set mark",		"am_setmark"
	MapControl "Clear mark",	"am_clearmarks"
}

//-------------------------------------------------------------------------------------------
//
// Automap Colors
//
//-------------------------------------------------------------------------------------------

OptionMenu MapColorMenu
{
	Title "CUSTOMIZE MAP COLORS"
	SafeCommand "Restore default custom colors", "am_restorecolors"
	StaticText " "
	ColorPicker "Background",								"am_backcolor"		
	ColorPicker "You",										"am_yourcolor"		
	ColorPicker "1-sided walls",							"am_wallcolor"		
	ColorPicker "2-sided walls with different floors",		"am_fdwallcolor"		
	ColorPicker "2-sided walls with different ceilings",	"am_cdwallcolor"		
	ColorPicker "2-sided walls with 3D floors",				"am_efwallcolor"		
	ColorPicker "Map grid",									"am_gridcolor"		
	ColorPicker "Center point",								"am_xhaircolor"		
	ColorPicker "Not-yet-seen walls",						"am_notseencolor"		
	ColorPicker "Locked doors",								"am_lockedcolor"		
	ColorPicker "Teleporter to the same map",				"am_intralevelcolor"	
	ColorPicker "Teleporter to a different map",			"am_interlevelcolor"	
	ColorPicker "Secret sector",							"am_secretsectorcolor"	
	ColorPicker "Special trigger lines",					"am_specialwallcolor"
	StaticText " "
	StaticText "Cheat Mode", 1
	ColorPicker "Invisible 2-sided walls",		"am_tswallcolor"		
	ColorPicker "Secret walls",					"am_secretwallcolor"	
	ColorPicker "Actors",						"am_thingcolor"		
	ColorPicker "Monsters",						"am_thingcolor_monster"		
	ColorPicker "non-counting Monsters",		"am_thingcolor_ncmonster"		
	ColorPicker "Friends",						"am_thingcolor_friend"		
	ColorPicker "Items",						"am_thingcolor_item"			
	ColorPicker "Count Items",					"am_thingcolor_citem"			
	StaticText " "
	StaticText "Overlay Mode", 1
	ColorPicker "You",							"am_ovyourcolor"		
	ColorPicker "1-sided walls",				"am_ovwallcolor"		
	ColorPicker "2-sided walls with different floors",		"am_ovfdwallcolor"		
	ColorPicker "2-sided walls with different ceilings",	"am_ovcdwallcolor"		
	ColorPicker "2-sided walls with 3D floors",				"am_ovefwallcolor"		
	ColorPicker "Not-yet-seen walls",			"am_ovunseencolor"	
	ColorPicker "Locked doors",				"am_ovlockedcolor"
	ColorPicker "Teleporter to the same map",					"am_ovtelecolor"		
	ColorPicker "Teleporter to a different map",			"am_ovinterlevelcolor"	
	ColorPicker "Secret sector",				"am_ovsecretsectorcolor"	
	ColorPicker "Special trigger lines",		"am_ovspecialwallcolor"
	StaticText " "
	StaticText "Overlay Cheat Mode", 1
	ColorPicker "Invisible 2-sided walls",		"am_ovotherwallscolor"		
	ColorPicker "Secret walls",					"am_ovsecretwallcolor"	
	ColorPicker "Actors",						"am_ovthingcolor"		
	ColorPicker "Monsters",						"am_ovthingcolor_monster"		
	ColorPicker "non-counting Monsters",		"am_ovthingcolor_ncmonster"		
	ColorPicker "Friends",						"am_ovthingcolor_friend"		
	ColorPicker "Items",						"am_ovthingcolor_item"		
	ColorPicker "Count Items",					"am_ovthingcolor_citem"		
}

//-------------------------------------------------------------------------------------------
//
// Color Picker
//
//-------------------------------------------------------------------------------------------

OptionMenu ColorPickerMenu
{
	Title "SELECT COLOR"
	// This menu will be created by the calling code
}

//-------------------------------------------------------------------------------------------
//
// Messages
//
//-------------------------------------------------------------------------------------------


OptionValue ScaleValues
{
	0, "Off"
	1, "On"
	2, "Double"
}

OptionValue MessageLevels
{
	0.0, "Item Pickup"
	1.0, "Obituaries"
	2.0, "Critical Messages"
}

OptionMenu MessageOptions
{
	Title 	"MESSAGES"
	Option "Show messages",				"show_messages", "OnOff"
	Option "Show obituaries",			"show_obituaries", "OnOff"
	Option "Show secret notifications",	"cl_showsecretmessage", "OnOff"
	Option "Scale text in high res", 	"con_scaletext", "ScaleValues"
	Option "Minimum message level", 	"msg", "MessageLevels"
	Option "Center messages",			"con_centernotify", "OnOff"
	StaticText " "
	StaticText "Message Colors", 1
	StaticText " "
	Option "Item Pickup",				"msg0color", "TextColors"
	Option "Obituaries",				"msg1color", "TextColors"
	Option "Critical Messages",			"msg2color", "TextColors"
	Option "Chat Messages",				"msg3color", "TextColors"
	Option "Team Messages",				"msg4color", "TextColors"
	Option "Centered Messages",			"msgmidcolor", "TextColors"
	StaticText " "
	Option "Screenshot messages",		"screenshot_quiet",	"OffOn"
	Option "Detailed save messages",	"longsavemessages",	"OnOff"
}

//-------------------------------------------------------------------------------------------
//
// Scoreboard
//
//-------------------------------------------------------------------------------------------

OptionMenu ScoreboardOptions
{
	Title "SCOREBOARD OPTIONS"
	StaticText "Cooperative Options", 1
	StaticText " "
	Option "Enable Scoreboard",		"sb_cooperative_enable", "YesNo"
	Option "Header Color",			"sb_cooperative_headingcolor", "TextColors"
	Option "Your Player Color",		"sb_cooperative_yourplayercolor", "TextColors"
	Option "Other Players' Color",	"sb_cooperative_otherplayercolor", "TextColors"
	StaticText " "
	StaticText " "
	StaticText "Deathmatch Options", 1
	StaticText " "
	Option "Enable Scoreboard",		"sb_deathmatch_enable",	"YesNo"
	Option "Header Color",			"sb_deathmatch_headingcolor", "TextColors"
	Option "Your Player Color",		"sb_deathmatch_yourplayercolor", "TextColors"
	Option "Other Players' Color",	"sb_deathmatch_otherplayercolor", "TextColors"
	StaticText " "
	StaticText " "
	StaticText "Team Deathmatch Options", 1
	StaticText " "
	Option "Enable Scoreboard",		"sb_teamdeathmatch_enable", "YesNo"
	Option "Header Color",			"sb_teamdeathmatch_headingcolor", "TextColors"
}

/*=======================================
 *
 * Gameplay Options (dmflags) Menu
 *
 *=======================================*/
 
OptionValue  SmartAim
{
	0.0, "Off"
	1.0, "On"
	2.0, "Never friends"
	3.0, "Only monsters"
}

OptionValue  FallingDM
{
	0, "Off"
	1, "Old"
	2, "Hexen"
	3, "Strife"
}

OptionValue  JumpCrouchFreeLook
{
	0, "Default"
	1, "Off"
	2, "On"
}


OptionMenu GameplayOptions
{
	Title 	"GAMEPLAY OPTIONS"
	//Indent 222
	Option "Teamplay",				"teamplay",	"OnOff"
	Slider	"Team damage scalar",	"teamdamage", 0, 1, 0.05
	StaticText " "
	Option "Smart Autoaim",			"sv_smartaim", "SmartAim"
	StaticText " "
	Option "Falling damage",		"sv_fallingdamage", "FallingDM"
	Option "Drop weapon",			"sv_weapondrop", "YesNo"
	Option "Double ammo",			"sv_doubleammo", "YesNo"
	Option "Infinite ammo",			"sv_infiniteammo", "YesNo"
	Option "Infinite inventory",	"sv_infiniteinventory", "YesNo"
	Option "No monsters",			"sv_nomonsters", "YesNo"
	Option "No monsters to exit",	"sv_killallmonsters", "YesNo"
	Option "Monsters respawn",		"sv_monsterrespawn", "YesNo"
	Option "No respawn",			"sv_norespawn", "YesNo"
	Option "Items respawn",			"sv_itemrespawn", "YesNo"
	Option "Big powerups respawn",	"sv_respawnsuper", "YesNo"
	Option "Fast monsters",			"sv_fastmonsters", "YesNo"
	Option "Degeneration",			"sv_degeneration", "YesNo"
	Option "Allow Autoaim",			"sv_noautoaim", "NoYes"
	Option "Allow Suicide",			"sv_disallowsuicide", "NoYes"
	Option "Allow jump",			"sv_jump", "JumpCrouchFreeLook"
	Option "Allow crouch",			"sv_crouch", "JumpCrouchFreeLook"
	Option "Allow freelook",		"sv_freelook", "JumpCrouchFreeLook"
	Option "Allow FOV",				"sv_nofov", "NoYes"
	Option "Allow BFG aiming",		"sv_nobfgaim", "NoYes"
	Option "Allow automap",			"sv_noautomap", "NoYes"
	Option "Automap allies",		"sv_noautomapallies", "NoYes"
	Option "Allow spying",			"sv_disallowspying", "NoYes"
	Option "Chasecam cheat",		"sv_chasecam", "YesNo"
	Option "Check ammo for weapon switch",	"sv_dontcheckammo", "NoYes"
	Option "Icon's death kills its spawns",	"sv_killbossmonst", "YesNo"
	Option "End sector counts for kill %",	"sv_nocountendmonst", "NoYes"

	StaticText " "
	StaticText "Deathmatch Settings",1
	Option "Weapons stay",			"sv_weaponstay", "YesNo"
	Option "Allow powerups",		"sv_noitems", "NoYes"
	Option "Allow health",			"sv_nohealth", "NoYes"
	Option "Allow armor",			"sv_noarmor", "NoYes"
	Option "Spawn farthest",		"sv_spawnfarthest", "YesNo"
	Option "Same map",				"sv_samelevel", "YesNo"
	Option "Force respawn",			"sv_forcerespawn", "YesNo"
	Option "Allow exit",			"sv_noexit", "NoYes"
	Option "Barrels respawn",		"sv_barrelrespawn", "YesNo"
	Option "Respawn protection",	"sv_respawnprotect", "YesNo"
	Option "Lose frag if fragged",	"sv_losefrag", "YesNo"
	Option "Keep frags gained",		"sv_keepfrags", "YesNo"
	Option "No team switching",		"sv_noteamswitch", "YesNo"

	StaticText " "
	StaticText "Cooperative Settings",1
	Option "Spawn multi. weapons", 	"sv_noweaponspawn", "NoYes"
	Option "Lose entire inventory",	"sv_cooploseinventory", "YesNo"
	Option "Keep keys",				"sv_cooplosekeys", "NoYes"
	Option "Keep weapons",			"sv_cooploseweapons", "NoYes"
	Option "Keep armor",			"sv_cooplosearmor", "NoYes"
	Option "Keep powerups",			"sv_cooplosepowerups", "NoYes"
	Option "Keep ammo",				"sv_cooploseammo", "NoYes"
	Option "Lose half ammo",		"sv_coophalveammo", "YesNo"
	Option "Spawn where died",		"sv_samespawnspot", "YesNo"
	Class "GameplayMenu"
}

/*=======================================
 *
 * Compatibility Options Menu
 *
 *=======================================*/


OptionValue CompatModes
{
	0, "Default"
	1, "Doom"
	2, "Doom (strict)"
	3, "Boom"
	6, "Boom (strict)"
	5, "MBF"
	4, "ZDoom 2.0.63"
}

OptionMenu "CompatibilityOptions"
{
	Title "COMPATIBILITY OPTIONS"
	Option "Compatibility mode",						"compatmode", "CompatModes", "", 1
	
	StaticText " "
	StaticText "Actor Behavior",1
	Option "Crushed monsters can be resurrected",		"compat_CORPSEGIBS", "YesNo"	
	Option "Friendly monsters aren't blocked",			"compat_NOBLOCKFRIENDS", "YesNo"
	Option "Limit Pain Elementals' Lost Souls",			"compat_LIMITPAIN", "YesNo"
	Option "Monster movement is affected by effects",	"compat_MBFMONSTERMOVE", "YesNo"
	Option "Monsters cannot cross dropoffs",			"compat_CROSSDROPOFF", "YesNo"
	Option "Monsters get stuck over dropoffs",			"compat_DROPOFF", "YesNo"
	Option "Monsters see invisible players",			"compat_INVISIBILITY", "YesNo"
	Option "No Minotaur floor flames in water",			"compat_MINOTAUR", "YesNo"
	Option "Spawn item drops on the floor",				"compat_NOTOSSDROPS", "YesNo"
	
	StaticText " "
	StaticText "DehackEd Behavior",1
	Option "DEH health settings like Doom2.exe",		"compat_DEHHEALTH", "YesNo"
	Option "Original A_Mushroom speed in DEH mods",		"compat_MUSHROOM", "YesNo"
	
	StaticText " "
	StaticText "Map/Action Behavior",1
	Option "All special lines can block <use>",			"compat_USEBLOCKING", "YesNo"
	Option "Allow any bossdeath for level special",		"compat_ANYBOSSDEATH", "YesNo"
	Option "Disable BOOM door light effect",			"compat_NODOORLIGHT", "YesNo"
	Option "Find neighboring light like Doom",			"compat_LIGHT", "YesNo"
	Option "Find shortest textures like Doom",			"compat_SHORTTEX", "YesNo"
	Option "Use buggier stair building",				"compat_stairs", "YesNo"
	Option "Use Doom's floor motion behavior",			"compat_floormove", "YesNo"
	Option "Use Doom's point-on-line algorithm",		"compat_pointonline", "YesNo"
	
	StaticText " "
	StaticText "Physics Behavior",1
	Option "Actors are infinitely tall",				"compat_nopassover", "YesNo"
	Option "Boom scrollers are additive",				"compat_BOOMSCROLL", "YesNo"
	Option "Cannot travel straight NSEW",				"compat_badangles", "YesNo"
	Option "Enable wall running",						"compat_WALLRUN", "YesNo"
	Option "Raven scrollers use original speed",		"compat_RAVENSCROLL", "YesNo"
	Option "Self ref. sectors don't block shots",		"compat_TRACE", "YesNo"
	Option "Use Doom code for hitscan checks",			"compat_HITSCAN", "YesNo"
	Option "Use Doom heights for missile clipping",		"compat_MISSILECLIP", "YesNo"

	
	StaticText " "
	StaticText "Rendering Behavior",1
	Option "Draw polyobjects like Hexen",				"compat_POLYOBJ", "YesNo"
	Option "Ignore Y offsets on masked midtextures",	"compat_MASKEDMIDTEX", "YesNo"
	Option "Invert sprite sorting",						"compat_SPRITESORT", "YesNo"
	
	StaticText " "
	StaticText "Sound Behavior",1
	Option "Cripple sound for silent BFG trick",		"compat_soundslots", "YesNo"
	Option "Don't let others hear your pickups",		"compat_SILENTPICKUP", "YesNo"
	Option "Inst. moving floors are not silent",		"compat_silentinstantfloors", "YesNo"
	Option "Sector sounds use center as source",		"compat_SECTORSOUNDS", "YesNo"
	Option "Sounds stop when actor vanishes",			"compat_soundcutoff", "YesNo"
	Option "Use original sound target handling",		"compat_SOUNDTARGET", "YesNo"
	
	Class "CompatibilityMenu"
}

/*=======================================
 *
 * Sound Options Menu
 *
 *=======================================*/
 
OptionValue SampleRates
{
	0,		"Default"
	4000,	"4000 Hz"
	8000,	"8000 Hz"
	11025,	"11025 Hz"
	22050,	"22050 Hz"
	32000,	"32000 Hz"
	44100,	"44100 Hz"
	48000,	"48000 Hz"
}


OptionValue BufferSizes
{
	   0, "Default"
	  64, "64 samples"
	 128, "128 samples"
	 256, "256 samples"
	 512, "512 samples"
	1024, "1024 samples"
	2048, "2048 samples"
	4096, "4096 samples"
}


OptionValue BufferCounts
{
	   0, "Default"
	   2, "2"
	   3, "3"
	   4, "4"
	   5, "5"
	   6, "6"
	   7, "7"
	   8, "8"
	   9, "9"
	  10, "10"
	  11, "11"
	  12, "12"
}


OptionString SoundOutputsWindows
{
	"Default",		"Default"
	"DirectSound",	"DirectSound"
	"WASAPI",		"Vista WASAPI"
	"ASIO",			"ASIO"
	"WaveOut",		"WaveOut"
	"No sound",		"No sound"
}


OptionString SoundOutputsUnix
{
	"Default",		"Default"
	"OSS",			"OSS"
	"ALSA",			"ALSA"
	"SDL",			"SDL"
	"ESD",			"ESD"
	"PulseAudio",	"PulseAudio"
	"No sound",		"No sound"
}

OptionString SoundOutputsMac
{
	"Core Audio",		"Core Audio"
	"No sound",			"No sound"
}

OptionString ALDevices
{
	// filled in by the sound code
}

OptionString OutputFormats
{
	"PCM-8",		"8-bit"
	"PCM-16",		"16-bit"
	"PCM-24",		"24-bit"
	"PCM-32",		"32-bit"
	"PCM-Float",	"32-bit float"
}


OptionString SpeakerModes
{
	"Auto",		"Auto"
	"Mono",		"Mono"
	"Stereo",	"Stereo"
	"Prologic",	"Dolby Prologic Decoder"
	"Quad",		"Quad"
	"Surround",	"5 speakers"
	"5.1",		"5.1 speakers"
	"7.1",		"7.1 speakers"
}


OptionString Resamplers
{
	"NoInterp",		"No interpolation"
	"Linear",		"Linear"
	"Cubic",		"Cubic"
	"Spline",		"Spline"
}


OptionString SoundBackends
{
	"fmod",		"FMOD Ex"
	"openal",	"OpenAL"
	"null",		"No Sound"
}

OptionString SoundBackendsFModOnly
{
	"fmod",		"FMOD Ex"
	"null",		"No Sound"
}

OptionString SoundBackendsOpenALOnly
{
	"openal",	"OpenAL"
	"null",		"No Sound"
}

OptionMenu FMODSoundItems
{
	Title "FMOD OPTIONS"
	Slider	"Underwater cutoff",	"snd_waterlp", 0.0, 2000.0, 50.0, 0
	IfOption(Windows)
	{
		Option "Output system",  "snd_output", "SoundOutputsWindows"
	}
	IfOption(Unix)
	{
		Option "Output system",  "snd_output", "SoundOutputsUnix"
	}
	IfOption(Mac)
	{
		Option "Output system",  "snd_output", "SoundOutputsMac"
	}
	Option "Output format",      "snd_output_format", "OutputFormats"
	Option "Speaker mode",       "snd_speakermode", "SpeakerModes"
	Option "Resampler",          "snd_resampler", "Resamplers"
	Option "HRTF filter",        "snd_hrtf", "OnOff"
	StaticText " "
	Option "Buffer size",			"snd_buffersize", "BufferSizes"
	Option "Buffer count",			"snd_buffercount", "BufferCounts"
}


OptionMenu OpenALSoundItems
{
	Title "OPENAL OPTIONS"
	Option "Playback device",	"snd_aldevice",	"ALDevices"
	Option "Enable EFX",		"snd_efx",		"OnOff"
}


OptionValue MidiDevices
{
	// filled in by the sound code
}

OptionMenu SoundOptions
{
	Title "SOUND OPTIONS"
	Slider "Sounds volume",		"snd_sfxvolume", 0, 1, 0.05
	Slider "Menu volume",		"snd_menuvolume", 0, 1, 0.05
	Slider "Music volume",		"snd_musicvolume", 0, 1, 0.05
	Option "MIDI device",		"snd_mididevice", "MidiDevices"
	StaticText " "
	Option "Underwater reverb",	"snd_waterreverb", "OnOff"
	Option "Randomize pitches",	"snd_pitched", "OnOff"
	Slider "Sound channels",	"snd_channels", 8, 256, 8, 0
	StaticText " "

	ifoption(fmodex)
	{
		ifoption(openal)
		{
			Option "Sound backend",		"snd_backend", "SoundBackends"
		}
		else
		{
			Option "Sound backend",		"snd_backend", "SoundBackendsFModOnly"
		}
	}
	else
	{
		ifoption(openal)
		{
			Option "Sound backend",		"snd_backend", "SoundBackendsOpenALOnly"
		}
	}
	
	ifoption(fmodex)
	{
		Submenu "FMOD options",		"FMODSoundItems"
	}
	ifoption(openal)
	{
		Submenu "OpenAL options",	"OpenALSoundItems"
	}
	StaticText " "
	Command "Restart sound",	"snd_reset"

	StaticText " "
	Submenu "Advanced options",			"AdvSoundOptions"
	Submenu "Module replayer options",	"ModReplayerOptions"
}

/*=======================================
 *
 * Advanced Sound Options Menu
 *
 *=======================================*/

OptionValue GusMemory
{
	0, "Unlimited"
	1, "256K"
	2, "512K"
	3, "768K"
	4, "1024K"
}

OptionValue OplCores
{
	0, "MAME OPL2"
	1, "DOSBox OPL3"
	2, "Java OPL3"
	3, "Nuked OPL3"
}

OptionMenu AdvSoundOptions
{
	Title "ADVANCED SOUND OPTIONS"
	Option "Sample rate",			"snd_samplerate", "SampleRates"
	StaticText " "
	StaticText "OPL Synthesis",	1
	Slider "Number of emulated OPL chips", "opl_numchips", 1, 8, 1, 0
	Option "Full MIDI stereo panning", "opl_fullpan", "OnOff"
	Option "OPL Emulator Core", "opl_core", "OplCores"
	StaticText " "
	StaticText "GUS Emulation",	1
	TextField "GUS config file", "midi_config"
	Slider "MIDI voices",	"midi_voices", 16, 256, 4, 0
	Option "Read DMXGUS lumps", "midi_dmxgus", "OnOff"
	Option "GUS memory size", "gus_memsize", "GusMemory"
	StaticText " "
	StaticText "FluidSynth",	1
	TextField "Patch set", "fluid_patchset"
	Slider "Gain",	"fluid_gain", 0, 10, 0.5, 1
	Option "Reverb", "fluid_reverb", "OnOff"
	Slider "MIDI voices", "fluid_voices", 16, 4096, 16, 1
	// Leaving out the more advanced stuff for now.
	StaticText " "
	StaticText "Timidity++",	1
	TextField "Path for executable", "timidity_exe"
	Option "Reverb", "timidity_reverb", "OnOff"
	Option "Chorus", "timidity_chorus", "OnOff"
	Slider "Relative volume",	"timidity_mastervolume", 0, 4, 0.2, 1
	StaticText " "
	StaticText "WildMidi",	1
	TextField "WildMidi config file", "wildmidi_config"
	Option "Reverb", "wildmidi_reverb", "OnOff"
}

/*=======================================
 *
 * Module Replayer Options Menu
 *
 *=======================================*/

OptionValue ModReplayers
{
	0.0, "Sound System"
	1.0, "foo_dumb"
}


OptionValue ModQuality
{
	0.0, "Aliasing"
	1.0, "Linear"
	2.0, "Cubic"
	3.0, "Band-limited step"		// BLEP
	4.0, "Linear (Slower)"
	5.0, "Band-limited linear"		// BLAM
	6.0, "Cubic (Slower)"
	7.0, "Sinc"
}


OptionValue ModVolumeRamps
{
	0.0, "None"
	1.0, "Note on/off only"
	2.0, "Full ramping"
}


OptionMenu ModReplayerOptions
{
	Title "MODULE REPLAYER OPTIONS"
	Option "Replayer engine",		"mod_dumb", "ModReplayers"
	StaticText " "
	Slider "Master Volume",			"mod_dumb_mastervolume", 1, 16, 0.5, 1
	Option "Sample rate",			"mod_samplerate", "SampleRates", "mod_dumb"
	Option "Quality",				"mod_interp", "ModQuality", "mod_dumb"
	Option "Volume ramping",		"mod_volramp", "ModVolumeRamps", "mod_dumb"
	StaticText " "
	Option "Chip-o-matic",			"mod_autochip", "OnOff", "mod_dumb"
	// TODO if the menu system is ever rewritten: Provide a decent
	// mechanism to edit the chip-o-matic settings like you can with
	// the foo_dumb preferences in foobar2000.
}

/*=======================================
 *
 * Video mode menu
 *
 *=======================================*/

OptionValue ForceRatios
{
	0.0, "Off"
	3.0, "4:3"
	1.0, "16:9"
	5.0, "17:10"
	2.0, "16:10"
	4.0, "5:4"
}
OptionValue Ratios
{
	0.0, "4:3"
	1.0, "16:9"
	2.0, "16:10"
	3.0, "17:10"
	 -1, "All"
}
OptionValue RatiosTFT
{
	0.0, "4:3"
	4.0, "5:4"
	1.0, "16:9"
	2.0, "16:10"
	3.0, "17:10"
	 -1, "All"
}

OptionMenu VideoModeMenu
{
	Title "VIDEO MODE"
	
	Option "Fullscreen",			"fullscreen", "YesNo"
	IfOption(Mac)
	{
		Option "Retina/HiDPI support", "vid_hidpi", "YesNo"
	}
	Option "Aspect ratio",			"menu_screenratios", "Ratios"
	Option "Force aspect ratio",	"vid_aspect", "ForceRatios"
	Option "Enable 5:4 aspect ratio","vid_tft", "YesNo"
	StaticText " "
	ScreenResolution "res_0"
	ScreenResolution "res_1"
	ScreenResolution "res_2"
	ScreenResolution "res_3"
	ScreenResolution "res_4"
	ScreenResolution "res_5"
	ScreenResolution "res_6"
	ScreenResolution "res_7"
	ScreenResolution "res_8"
	ScreenResolution "res_9"
	StaticTextSwitchable "Press ENTER to set mode", "", "VMEnterText"
	StaticText " "
	StaticTextSwitchable "T to test mode for 5 seconds", "Please wait 5 seconds...", "VMTestText"
	class VideoModeMenu
}

/*=======================================
 *
 * Network options menu
 *
 *=======================================*/

OptionMenu NetworkOptions
{
	Title "NETWORK OPTIONS"
	StaticText "Local options", 1
	Option "Movement prediction",		"cl_noprediction", "OffOn"
	Option "Predict line actions",		"cl_predict_specials", "OnOff"
	Slider "Prediction Lerp Scale",		"cl_predict_lerpscale", 0.0, 0.5, 0.05
	Slider "Lerp Threshold",			"cl_predict_lerpthreshold", 0.1, 16.0, 0.1
	StaticText " "
	StaticText "Host options", 1
	Option "Extra Tics",				"net_extratic", "ExtraTicMode"
	Option "Latency balancing",			"net_ticbalance", "OnOff"
	
}

OptionValue ExtraTicMode
{
	0, "None"
	1, "1"
	2, "All unacknowledged"
}
