mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-04 23:40:01 +07:00
Tiles are now larger, population and units placed in a more visually pleasing way
This commit is contained in:
@ -21,8 +21,8 @@ android {
|
||||
applicationId "com.unciv.game"
|
||||
minSdkVersion 14
|
||||
targetSdkVersion 26
|
||||
versionCode 29
|
||||
versionName "1.3.2"
|
||||
versionCode 30
|
||||
versionName "1.3.3"
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
|
@ -29,7 +29,7 @@ open class TileGroup(var tileInfo: TileInfo) : Group() {
|
||||
val groupSize = 50f
|
||||
this.setSize(groupSize,groupSize)
|
||||
hexagon = ImageGetter.getImage("TerrainIcons/Hexagon.png")
|
||||
val imageScale = groupSize * 1.3f / hexagon.width
|
||||
val imageScale = groupSize * 1.5f / hexagon.width
|
||||
hexagon.setScale(imageScale)
|
||||
hexagon.setOrigin(Align.center)
|
||||
hexagon.setPosition((width - hexagon.width) / 2,
|
||||
@ -43,7 +43,7 @@ open class TileGroup(var tileInfo: TileInfo) : Group() {
|
||||
populationImage!!.run {
|
||||
setSize(20f, 20f)
|
||||
setPosition(this@TileGroup.width/2 - width/2,
|
||||
this@TileGroup.height/2 - height/2 - 15)
|
||||
this@TileGroup.height/2 - height/2 - 20)
|
||||
} // top left
|
||||
addActor(populationImage)
|
||||
}
|
||||
@ -94,7 +94,7 @@ open class TileGroup(var tileInfo: TileInfo) : Group() {
|
||||
addActor(unitImage!!)
|
||||
unitImage!!.setSize(20f, 20f)
|
||||
unitImage!!.setPosition(width/2 - unitImage!!.width/2,
|
||||
height/2 - unitImage!!.height/2 +15) // top
|
||||
height/2 - unitImage!!.height/2 +20) // top
|
||||
}
|
||||
|
||||
if (tileInfo.unit == null && unitImage != null) {
|
||||
|
@ -13,6 +13,7 @@ import com.unciv.ui.pickerscreens.TechPickerScreen
|
||||
import com.unciv.ui.utils.CameraStageBaseScreen
|
||||
import com.unciv.ui.utils.disable
|
||||
import com.unciv.ui.utils.enable
|
||||
import com.unciv.ui.worldscreen.WorldScreen
|
||||
import java.util.*
|
||||
|
||||
class UnitActions {
|
||||
@ -24,10 +25,9 @@ class UnitActions {
|
||||
}
|
||||
}
|
||||
|
||||
fun getUnitActions(tile: TileInfo): List<TextButton> {
|
||||
fun getUnitActions(tile: TileInfo, worldScreen: WorldScreen): List<TextButton> {
|
||||
|
||||
val unit = tile.unit!!
|
||||
val worldScreen = UnCivGame.Current.worldScreen!!
|
||||
val tileMapHolder = worldScreen.tileMapHolder
|
||||
val unitTable = worldScreen.unitTable
|
||||
|
||||
|
@ -27,7 +27,7 @@ class UnitTable(val worldScreen: WorldScreen) : Table(){
|
||||
val tileTableBackground = ImageGetter.getDrawable("skin/tileTableBackground.png")
|
||||
.tint(Color(0x004085bf))
|
||||
pad(20f)
|
||||
setBackground(tileTableBackground)
|
||||
background = tileTableBackground
|
||||
add(unitLabel)
|
||||
add(unitActionsTable)
|
||||
row()
|
||||
@ -41,7 +41,7 @@ class UnitTable(val worldScreen: WorldScreen) : Table(){
|
||||
|
||||
if(selectedUnitTile!=null) {
|
||||
unitLabel.setText(getSelectedUnit().name+" "+getSelectedUnit().movementString)
|
||||
for (button in UnitActions().getUnitActions(selectedUnitTile!!))
|
||||
for (button in UnitActions().getUnitActions(selectedUnitTile!!,worldScreen))
|
||||
unitActionsTable.add(button).colspan(2).pad(5f)
|
||||
.size(button.width * worldScreen.buttonScale, button.height * worldScreen.buttonScale).row()
|
||||
}
|
||||
|
Reference in New Issue
Block a user