--cfunction("createState", "controlScreen", "controlScreen")
controlScreen_xPos = 144
controlScreen_smUnlocked = {}

function controlScreen_onSubmitPressed()		
	cfunction("enableInput", 0)
	cfunction("startSoundSample", "back_sfx", 1, 100)
	
	if controlScreen_smUnlocked[1] == 1 then		
		--cfunction("fadeOverlay", "keys_dragster", 100, 0, 150)
	end
	if controlScreen_smUnlocked[2] == 1 then
		--cfunction("fadeOverlay", "keys_scorch", 100, 0, 150)
	end
	if controlScreen_smUnlocked[3] == 1 then		
		--cfunction("fadeOverlay", "keys_mammoth", 100, 0, 150)		
	end
	if controlScreen_smUnlocked[4] == 1 then				
		--cfunction("fadeOverlay", "keys_glide", 100, 0, 150)
	end

	cfunction("fadeOverlay", "ss_content", 100, 0, 150)	

	closePopupWindow("controlScreen_afterWindowClose")
end

function controlScreen_afterWindowClose()
	cfunction("transitionToState", "pauseState")
end

function controlScreen_onCancelPressed()		
	controlScreen_onSubmitPressed()	
end

function controlScreen_afterWindowOpen()
	cfunction("enableInput", 1)

	cfunction("showFontOverlay", "ss_content", 1, 0, 20, 80, 440, 140)

	xText = ""
	if controlScreen_smUnlocked[1] == 1 then
		--cfunction("showBitmapOverlay", "keys_dragster", 1, 0, controlScreen_xPos, 75)
		--cfunction("fadeOverlay", "keys_dragster", 0, 100, 150)		
		xText = xText .. "- " .. lng_ACTIVATEDRAGSTER .. "\n"
	end
	if controlScreen_smUnlocked[2] == 1 then
		--cfunction("showBitmapOverlay", "keys_scorch", 1, 0, controlScreen_xPos, 105)
		--cfunction("fadeOverlay", "keys_scorch", 0, 100, 150)		
		xText = xText .. "- " .. lng_ACTIVATESCORCH .. "\n"
	end
	if controlScreen_smUnlocked[3] == 1 then		
		--cfunction("showBitmapOverlay", "keys_mammoth", 1, 0, controlScreen_xPos, 165)
		--cfunction("fadeOverlay", "keys_mammoth", 0, 100, 150)		
		xText = xText .. "- " .. lng_ACTIVATEMAMMOTH .. "\n"
	end
	if controlScreen_smUnlocked[4] == 1 then		
		--cfunction("showBitmapOverlay", "keys_glide", 1, 0, controlScreen_xPos, 135)
		--cfunction("fadeOverlay", "keys_glide", 0, 100, 150)		
		xText = xText .. "- " .. lng_ACTIVATEGHOST
	end

	cfunction("setFontOverlayText", "ss_content", xText)	
	cfunction("fadeOverlay", "ss_content", 0, 100, 150)	
end

function controlScreen_onEnterState()	
	cfunction("enableInput", 0)
	openPopupWindow("controlScreen_afterWindowOpen", 2.3)
end


function controlScreen_onLeaveState()
	
end
