Resolved #2613 - added a close button to the Civ-picking popup in the New Game screen

This commit is contained in:
Yair Morgenstern
2020-06-03 19:09:48 +03:00
parent 3e31be1801
commit d511899ed8
6 changed files with 2913 additions and 2907 deletions

View File

@ -75,7 +75,7 @@ class EditorMapHolder(internal val mapEditorScreen: MapEditorScreen, internal va
val rounded = HexMath.roundHexCoords(hexPosition)
if (tileMap.contains(rounded))
return tileMap.get(rounded)
return tileMap[rounded]
else
return null
}

View File

@ -3,6 +3,7 @@ package com.unciv.ui.newgamescreen
import com.unciv.ui.utils.AutoScrollPane as ScrollPane
import com.badlogic.gdx.Gdx
import com.badlogic.gdx.graphics.Color
import com.badlogic.gdx.scenes.scene2d.Group
import com.badlogic.gdx.scenes.scene2d.Touchable
import com.badlogic.gdx.scenes.scene2d.ui.Table
import com.badlogic.gdx.scenes.scene2d.ui.TextButton
@ -171,6 +172,18 @@ class PlayerPickerTable(val newGameScreen: NewGameScreen, val newGameParameters:
}).pad(10f).width(nationsPopupWidth).row()
}
nationsPopup.add(ScrollPane(nationListTable)).height(newGameScreen.stage.height * 0.8f)
nationsPopup.pack()
val closeImage = ImageGetter.getImage("OtherIcons/Close")
closeImage.setSize(30f,30f)
val closeImageHolder = Group() // This is to add it some more clickable space, to make it easier to click on the phone
closeImageHolder.setSize(50f,50f)
closeImage.center(closeImageHolder)
closeImageHolder.addActor(closeImage)
closeImageHolder.onClick { nationsPopup.close() }
closeImageHolder.setPosition(0f, nationsPopup.height, Align.topLeft)
nationsPopup.addActor(closeImageHolder)
nationsPopup.open()
update()
}