mirror of
https://github.com/yairm210/Unciv.git
synced 2025-03-14 12:00:12 +07:00
Diplomacy Screen right table is scrollable (#3260)
* Diplomacy Screen right table is scrollable * Scrollable city-state table * Resized to fit lower resolution * Fix right table width
This commit is contained in:
parent
a6642cb536
commit
a24335abea
@ -82,7 +82,7 @@ class DiplomacyScreen(val viewingCiv:CivilizationInfo):CameraStageBaseScreen() {
|
||||
|
||||
fun updateRightSide(otherCiv: CivilizationInfo) {
|
||||
rightSideTable.clear()
|
||||
if (otherCiv.isCityState()) rightSideTable.add(getCityStateDiplomacyTable(otherCiv))
|
||||
if (otherCiv.isCityState()) rightSideTable.add(ScrollPane(getCityStateDiplomacyTable(otherCiv)))
|
||||
else rightSideTable.add(ScrollPane(getMajorCivDiplomacyTable(otherCiv))).height(stage.height)
|
||||
}
|
||||
|
||||
@ -97,7 +97,7 @@ class DiplomacyScreen(val viewingCiv:CivilizationInfo):CameraStageBaseScreen() {
|
||||
private fun getCityStateDiplomacyTable(otherCiv: CivilizationInfo): Table {
|
||||
val otherCivDiplomacyManager = otherCiv.getDiplomacyManager(viewingCiv)
|
||||
|
||||
val diplomacyTable = Table()
|
||||
val diplomacyTable = Table().apply { width = this@DiplomacyScreen.stage.width - leftSideTable.width }
|
||||
diplomacyTable.defaults().pad(10f)
|
||||
diplomacyTable.add(otherCiv.getLeaderDisplayName().toLabel(fontSize = 24)).row()
|
||||
diplomacyTable.add("{Type: } {${otherCiv.cityStateType}}".toLabel()).row()
|
||||
@ -137,8 +137,8 @@ class DiplomacyScreen(val viewingCiv:CivilizationInfo):CameraStageBaseScreen() {
|
||||
friendBonusLabelColor = Color.GRAY
|
||||
|
||||
val friendBonusLabel = friendBonusText.toLabel(friendBonusLabelColor)
|
||||
diplomacyTable.add(friendBonusLabel).row()
|
||||
|
||||
.apply { setWrap(true); setAlignment(Align.center) }
|
||||
diplomacyTable.add(friendBonusLabel).width(rightSideTable.width - 50f).row()
|
||||
|
||||
diplomacyTable.addSeparator()
|
||||
|
||||
@ -196,7 +196,8 @@ class DiplomacyScreen(val viewingCiv:CivilizationInfo):CameraStageBaseScreen() {
|
||||
val description = assignedQuest.getDescription()
|
||||
|
||||
questTable.add(title.toLabel(fontSize = 24)).row()
|
||||
questTable.add(description.toLabel()).row()
|
||||
questTable.add(description.toLabel().apply { setWrap(true); setAlignment(Align.center) })
|
||||
.width(rightSideTable.width - 50f).row()
|
||||
if (quest.duration > 0)
|
||||
questTable.add("[${remainingTurns}] turns remaining".toLabel()).row()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user