mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-26 21:35:14 -04:00
Diplomacy graph size scales with screen space available (#1495)
* Diplomacy graph size scales with screen space available * Deleted debug option left on
This commit is contained in:
parent
6004d49803
commit
383b39c62d
@ -19,12 +19,11 @@ import java.text.DecimalFormat
|
|||||||
import kotlin.math.roundToInt
|
import kotlin.math.roundToInt
|
||||||
|
|
||||||
class EmpireOverviewScreen(val viewingPlayer:CivilizationInfo) : CameraStageBaseScreen(){
|
class EmpireOverviewScreen(val viewingPlayer:CivilizationInfo) : CameraStageBaseScreen(){
|
||||||
|
private val topTable = Table().apply { defaults().pad(10f) }
|
||||||
|
private val centerTable = Table().apply { defaults().pad(20f) }
|
||||||
|
|
||||||
init {
|
init {
|
||||||
onBackButtonClicked { UncivGame.Current.setWorldScreen() }
|
onBackButtonClicked { UncivGame.Current.setWorldScreen() }
|
||||||
val topTable = Table().apply { defaults().pad(10f) }
|
|
||||||
val centerTable=Table().apply { defaults().pad(20f) }
|
|
||||||
|
|
||||||
val closeButton = TextButton("Close".tr(), skin)
|
val closeButton = TextButton("Close".tr(), skin)
|
||||||
closeButton.onClick { UncivGame.Current.setWorldScreen() }
|
closeButton.onClick { UncivGame.Current.setWorldScreen() }
|
||||||
@ -100,7 +99,6 @@ class EmpireOverviewScreen(val viewingPlayer:CivilizationInfo) : CameraStageBase
|
|||||||
table.add(centerTable).expand().row()
|
table.add(centerTable).expand().row()
|
||||||
table.setFillParent(true)
|
table.setFillParent(true)
|
||||||
stage.addActor(table)
|
stage.addActor(table)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -331,7 +329,9 @@ class EmpireOverviewScreen(val viewingPlayer:CivilizationInfo) : CameraStageBase
|
|||||||
|
|
||||||
fun getDiplomacyGroup(): Group {
|
fun getDiplomacyGroup(): Group {
|
||||||
val relevantCivs = viewingPlayer.gameInfo.civilizations.filter { !it.isBarbarian() && !it.isCityState() }
|
val relevantCivs = viewingPlayer.gameInfo.civilizations.filter { !it.isBarbarian() && !it.isCityState() }
|
||||||
val groupSize = 500f
|
val freeWidth = stage.width
|
||||||
|
val freeHeight = stage.height - topTable.height
|
||||||
|
val groupSize = if (freeWidth > freeHeight) freeHeight else freeWidth
|
||||||
val group = Group()
|
val group = Group()
|
||||||
group.setSize(groupSize,groupSize)
|
group.setSize(groupSize,groupSize)
|
||||||
val civGroups = HashMap<String, Actor>()
|
val civGroups = HashMap<String, Actor>()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user