function choosePlayersNumIconsMenu(originalBGImage)
	local ovImg=Image.load("images/menus/skin_choose_playersNumIcons.png")
	
	local nbIcons=nil
	local i=0
	local prop=nil
	local currentSelection=1
	local names=nil
	if playersNumPreviews==nil then
		-- loading
		screen:blit(0, 0, originalBGImage, true)
		alert("loading")
		
		playersNumPreviews={}
		names=getFolderList("images/icons/playersNum")
		nbIcons=tableLength(names)
		for i=1,nbIcons do
			playersNumPreviews[i]={}
			playersNumPreviews[i]["num"]=i
			playersNumPreviews[i]["p1"]=Image.load("images/icons/playersNum/"..names[i].."/p1.png")
			playersNumPreviews[i]["p2"]=Image.load("images/icons/playersNum/"..names[i].."/p2.png")
			playersNumPreviews[i]["p3"]=Image.load("images/icons/playersNum/"..names[i].."/p3.png")
			playersNumPreviews[i]["p4"]=Image.load("images/icons/playersNum/"..names[i].."/p4.png")
			prop=loadPropertiesFile("images/icons/playersNum/"..names[i].."/playersNumIcons.properties")
			playersNumPreviews[i]["author"]=prop["author"]
			playersNumPreviews[i]["name"]=prop["name"]
			playersNumPreviews[i]["description"]=prop["description"]
			playersNumPreviews[i]["language"]=prop["language"]
			playersNumPreviews[i]["copyright"]=prop["copyright"]
			playersNumPreviews[i]["folderName"]=names[i]
			if USERPREF["playersNumIcons"]==names[i] then --this is what the user is using
				currentSelection=i
			end
		end
	else
		nbIcons=tableLength(playersNumPreviews)
		for i=1,nbIcons do
			if USERPREF["playersNumIcons"]==playersNumPreviews[i]["folderName"] then --this is what the user is using
				currentSelection=i
			end
		end
	end
	
	drawPlayersNumMenu(originalBGImage, currentSelection, nbIcons, ovImg)
	
	while true do
		updateInputs(Controls.read())
		

		--specific inputs
		if inputFirstPress("left") or inputIsRepeating("left") then
			if currentSelection>1 then
				currentSelection=currentSelection-1
			else
				currentSelection=nbIcons
			end
			drawPlayersNumMenu(originalBGImage, currentSelection, nbIcons, ovImg)
		elseif inputFirstPress("right") or inputIsRepeating("right") then
			if currentSelection<nbIcons then
				currentSelection=currentSelection+1
			else
				currentSelection=1
			end
			drawPlayersNumMenu(originalBGImage, currentSelection, nbIcons, ovImg)
		elseif inputFirstPress("l") or inputIsRepeating("l") then
			if currentSelection>3 then --1+4
				currentSelection=currentSelection-3
			else
				currentSelection=1
			end
			drawPlayersNumMenu(originalBGImage, currentSelection, nbIcons, ovImg)
		elseif inputFirstPress("r") or inputIsRepeating("r") then
			if currentSelection<nbIcons-2 then
				currentSelection=currentSelection+3
			else
				currentSelection=nbIcons
			end
			drawPlayersNumMenu(originalBGImage, currentSelection, nbIcons, ovImg)
		end
		
		--selection
		if inputFirstPress("cross") or inputFirstPress("circle") then
			alert("loading...")
			selectPlayersNumIcons(playersNumPreviews[currentSelection]["folderName"])
			return "changed"
		end
		
		
		
		
		
		--usual inputs
		if inputFirstPress("start") then
			return "quitMenu"
		end
		
		if inputFirstPress("square") then
			return "cancel"
		end
		
	end
end

function drawPlayersNumMenu(originalBGImage, currentSelection, nbIcons, ovImg)
	local xref=90
	local yref=92

	screen:blit(0, 0, originalBGImage, true)
	screen:blit(0, 0, ovImg, true)

	screen:blit(xref, yref+22, playersNumPreviews[currentSelection]["p1"], true)
	screen:blit(xref+15, yref+22, playersNumPreviews[currentSelection]["p2"], true)
	screen:blit(xref, yref+37, playersNumPreviews[currentSelection]["p3"], true)
	screen:blit(xref+15, yref+37, playersNumPreviews[currentSelection]["p4"], true)
	printBicolor(screen, xref+270, yref, currentSelection.."/"..nbIcons, black, white)
	printBicolor(screen, xref, yref, playersNumPreviews[currentSelection]["name"], black, white)
	printBicolor(screen, xref+40, yref+25, "Author:", black, white)
	printBicolor(screen, xref+120, yref+25, playersNumPreviews[currentSelection]["author"], black, white)
	printBicolor(screen, xref+40, yref+35, "Language:", black, white)
	printBicolor(screen, xref+120, yref+35, playersNumPreviews[currentSelection]["language"], black, white)
	printBicolor(screen, xref, yref+57, playersNumPreviews[currentSelection]["description"], black, white)
	printU(screen, xref, yref+91, playersNumPreviews[currentSelection]["copyright"], white, false, "default", 8, 8, 8, black)
	
	screen.flip()
	screen.waitVblankStart()
end
















