menu
{
	name	'DW_DIFFICULTY_FINETUNE'
	modal
	align center center
	onOpen
	"
	diffCategory=0
	dwDifficultyLookup=build_dwDifficultyLookup()
	"

	button -- Background
	{
		area %mosaic_area%
		mosaic %mosaic% 
	}
	
	label -- Title
	{
		area %title_area%
		text  "DW_DIFFICULTY_FINETUNE_TITLE" 
		text style	"title"
	}
	
	label -- Instruction
	{
		area %subtitle_area%
		text  "DW_DIFFICULTY_FINETUNE_SUBTITLE" 
		text style	"label"
	}
	label -- Contextual instruction
	{
		area %context_area%
		text lua "Infinity_FetchString(dwDifficultyHelp())"
		text style	"label"
	}

	list -- Key categories
	{
		column 
		{ 
			width 100 
			label
			{
				area 0 0 -1 -1
				text lua "Infinity_FetchString(dw_difficulty[dwDifficultyLookup[rowNumber]].short)"
				text style	"normal"
				text align	left center 
			}
		}
		area %left_column_area%
		
		rowheight	24
		table		"dwDifficultyLookup"
		var			diffCategory
		scrollbar	'%left_column_scrollbar%'
		action
		"
			key=0
			diffValue=Infinity_GetINIValue('Script',dw_difficulty[dwDifficultyLookup[diffCategory]].variable,0)
		"
	}

	
	list -- Key bindings
	{
		column 
		{ 
			width 80 
			label
			{
				area 0 0 -1 -1
				text lua "Infinity_FetchString(dw_difficulty_labels[dw_difficulty_entries[dwDifficultyLookup[diffCategory]][rowNumber].value])"
				text style	"normal"
				align left center
			}
		}
		
		column 
		{ 
			width 20
			label
			{
				area		%toggle_button_area%
				bam		%toggle_button%
				%toggle_button_scale%
				%toggle_button_align%
				frame		lua "dwDifficultyToggleFrame()"
			
			}
		}

		area %right_column_area%
		rowheight	40
		table		"dw_difficulty_entries[dwDifficultyLookup[diffCategory]]"
		var			key
		scrollbar	'%right_column_scrollbar%'
		action
		"
			dwDifficultyOnClick()		
		"
	}
	
	
	text
	{
		area		%text_area%
		text		lua "dwDisplayDifficulty()"
		text style	normal
		text align	left top
		text point	12
		scrollbar	'%text_scrollbar%'
	}
	
	button
	{
		area %done_button_area%
		bam '%done_button%'
		%done_button_sequence%
		text		"DONE_BUTTON"
		text style	"button"
		action
		"
			key = 0
			Infinity_PopMenu();
		"	
	}
	button
	{
		area %revert_button_area%
		bam '%revert_button%'
		%revert_button_sequence%
		text		"REVERT_BUTTON"
		text style	"button"
		
		action
		"
			key=0;
			diffCategory=0;
			dwDifficultyRevert();
		"	
	}
}
