--arcadeResult

function arcadeResult_onUpPressed()
	resultList_inputUp()
end

function arcadeResult_onDownPressed()
	resultList_inputDown()	
end

function arcadeResult_onSubmitPressed()
	cfunction("enableInput", 0)	
	resultList_hide()
	cfunction("fadeOverlay", "resultLevelName", 100,0,250)
	cfunction("fadeOverlay", "resultLevelRecord", 100,0,250)
	cfunction("setTimer", 250, "arcadeResult_afterTextFadeOut")
end

function arcadeResult_onLeaveState()	
end

function arcadeResult_onEnterState()	
	cfunction("enableInput", 0)
	arcadeResult_isNewRecord = 0
	arcadeResult_newRecordMin = 0
	arcadeResult_newRecordSec = 0
	arcadeResult_newRecordHSec = 0
	createWindowFrame("arcadeResult_afterWindowOpen", 2.68, 15)	
end

function arcadeResult_afterWindowOpen() 
	cfunction("showFontOverlay", "resultLevelName", 1,100,0,17)
	cfunction("setFontOverlayText", "resultLevelName", "")
	cfunction("setFontOverlayText", "resultLevelName", '\05'.."@ "..trackData[flow_trackId][2] .." @")
	
	if arcadeResult_isNewRecord == 1 then
		cfunction("showFontOverlay", "resultLevelRecord", 1,100,0,35)
		cfunction("setFontOverlayText", "resultLevelRecord", '\03'..'3'..'\05' .. lng_RESULTNEWTRACKREC.." "..getReadableTime(arcadeResult_newRecordMin, arcadeResult_newRecordSec, arcadeResult_newRecordHSec)..'\03'..'0')
	end
	
	resultList_setNumberOfOpponents(flow_arcadeNumberOfOpponents)
	resultList_setPlayerIndex(flow_trackFinishedPosition)
	resultList_setHeader(arcadeResult_fontOverlayHeader)
	resultList_show()
	
	cfunction("enableInput", 1)
end

function arcadeResult_afterTextFadeOut()
	closePopupWindow("arcadeResult_afterWindowClose")
end

function arcadeResult_afterWindowClose()
	cfunction("transitionToState", "arcadeAgainQuestion")
end