mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-16 02:40:41 +07:00
Resolved #2613 - added a close button to the Civ-picking popup in the New Game screen
This commit is contained in:
Binary file not shown.
Before Width: | Height: | Size: 26 KiB |
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Before Width: | Height: | Size: 893 KiB After Width: | Height: | Size: 878 KiB |
Binary file not shown.
Before Width: | Height: | Size: 468 KiB After Width: | Height: | Size: 449 KiB |
@ -75,7 +75,7 @@ class EditorMapHolder(internal val mapEditorScreen: MapEditorScreen, internal va
|
|||||||
val rounded = HexMath.roundHexCoords(hexPosition)
|
val rounded = HexMath.roundHexCoords(hexPosition)
|
||||||
|
|
||||||
if (tileMap.contains(rounded))
|
if (tileMap.contains(rounded))
|
||||||
return tileMap.get(rounded)
|
return tileMap[rounded]
|
||||||
else
|
else
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ package com.unciv.ui.newgamescreen
|
|||||||
import com.unciv.ui.utils.AutoScrollPane as ScrollPane
|
import com.unciv.ui.utils.AutoScrollPane as ScrollPane
|
||||||
import com.badlogic.gdx.Gdx
|
import com.badlogic.gdx.Gdx
|
||||||
import com.badlogic.gdx.graphics.Color
|
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.Touchable
|
||||||
import com.badlogic.gdx.scenes.scene2d.ui.Table
|
import com.badlogic.gdx.scenes.scene2d.ui.Table
|
||||||
import com.badlogic.gdx.scenes.scene2d.ui.TextButton
|
import com.badlogic.gdx.scenes.scene2d.ui.TextButton
|
||||||
@ -171,6 +172,18 @@ class PlayerPickerTable(val newGameScreen: NewGameScreen, val newGameParameters:
|
|||||||
}).pad(10f).width(nationsPopupWidth).row()
|
}).pad(10f).width(nationsPopupWidth).row()
|
||||||
}
|
}
|
||||||
nationsPopup.add(ScrollPane(nationListTable)).height(newGameScreen.stage.height * 0.8f)
|
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()
|
nationsPopup.open()
|
||||||
update()
|
update()
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user