flow_flowStateInMenu = 1

uimenu_curState = 1

function gameMode_runFlow()
	--cfunction("debugPrintB", "gameMode_runFlow. InMenu: ", flow_flowStateInMenu)	
	if flow_flowStateInMenu == 1 then
		if uimenu_curState == 1 then
			cfunction("addAction", "startMenu", 0)
			uimenu_curState = uimenu_curState +1
		else
			cfunction("addAction", "stopMenu", 0)			
			flow_flowStateInMenu = 0
			uimenu_curState = 1
		end
		
	else
		--cfunction("debugPrintB", "[gameMode_runFlow] GameMode", flow_gameMode)		
		if flow_gameMode == gameTypesIds["ARCADE"] then		
			arcade_runFlow()
		elseif flow_gameMode == gameTypesIds["TOURNAMENT"] then		
			tournament_runFlow()
		elseif flow_gameMode == gameTypesIds["MULTIPLAYER"] then		
			multiplayer_runFlow()
		elseif flow_gameMode == gameTypesIds["CHALLENGE"] then		
			challenge_runFlow()
		elseif flow_gameMode == gameTypesIds["TUTORIAL"] then		
			tutorial_runFlow()		
		elseif flow_gameMode == gameTypesIds["TIMETRIAL"] then		
			timetrial_runFlow()		
		else
			cfunction("debugPrintB", "[gameMode_runFlow] Wrong gameMode", flow_gameMode)		
		end
	end
	
	
end

function gameMode_resetFlow()
	arcade_resetFlow()
	tournament_resetFlow()
	multiplayer_resetFlow()
	challenge_resetFlow()
	timetrial_resetFlow()
	tutorial_resetFlow()
end

function gameMode_quitGame()
	cfunction("debugPrintB", "[gameMode_quitGame] InMenus:", flow_flowStateInMenu)
	if flow_flowStateInMenu == 1 then
		cfunction("addAction", "stopMenu", 0)
		cfunction("addAction", "quitGame", 0)
	else
		
	end
end

