Resolved #3495 - Added scrollbars to civilopedia and picker screens

Better Civilopedia layout
This commit is contained in:
Yair Morgenstern 2021-02-15 22:38:54 +02:00
parent 1e981abe53
commit 7c09663271
4 changed files with 15 additions and 16 deletions

View File

@ -1,11 +1,15 @@
## 3.12.15
## 3.13.0
Mod-specific maps are go! :D
Movement algorithm updated - can no longer see whether you can move to unknown tiles
Solved "AI doesn't declare war" bug
Removed Scenario Maps entirely - was not a well thought-out concept and caused more confusion than actual fun.
Better tech descriptions for increased improvement stats
## 3.12.14
Catch for bug in new movement algorithm when you can't move to a unknown tile, but CAN pass through (but not move to) intermediate tiles.

View File

@ -31,8 +31,8 @@ class UnitMovementAlgorithms(val unit:MapUnit) {
if (areConnectedByRoad && (!areConnectedByRiver || civInfo.tech.roadsConnectAcrossRivers))
{
return if (unit.civInfo.tech.movementSpeedOnRoadsImproved) 1 / 3f + extraCost
else 1 / 2f + extraCost
if (unit.civInfo.tech.movementSpeedOnRoadsImproved) return 1 / 3f + extraCost
else return 1 / 2f + extraCost
}
if (unit.ignoresTerrainCost) return 1f + extraCost
if (areConnectedByRiver) return 100f // Rivers take the entire turn to cross

View File

@ -22,7 +22,7 @@ class CivilopediaScreen(ruleset: Ruleset) : CameraStageBaseScreen() {
private val categoryToEntries = LinkedHashMap<String, Collection<CivilopediaEntry>>()
private val categoryToButtons = LinkedHashMap<String, Button>()
private val entrySelectTable = Table().apply { defaults().pad(6f) }
private val entrySelectTable = Table().apply { defaults().pad(6f).left() }
val description = "".toLabel()
@ -147,17 +147,12 @@ class CivilopediaScreen(ruleset: Ruleset) : CameraStageBaseScreen() {
description.wrap = true
val entrySelectScroll = ScrollPane(entrySelectTable)
entrySelectScroll.setupOverscroll(5f, 1f, 200f)
entryTable.add(entrySelectScroll)
.width(Value.percentWidth(0.25f, entryTable))
.fillY()
.pad(Value.percentWidth(0.02f, entryTable))
entryTable.add(ScrollPane(description)).colspan(4)
.width(Value.percentWidth(0.65f, entryTable))
.fillY()
.pad(Value.percentWidth(0.02f, entryTable))
// Simply changing these to x*width, y*height won't work
val entrySelectScroll = ScrollPane(entrySelectTable, skin)
entrySelectTable.left()
entrySelectScroll.setOverscroll(false, false)
entryTable.add(entrySelectScroll).width(stage.width*0.3f).padLeft(stage.width*0.02f)
.padRight(stage.width*0.03f)
entryTable.add(ScrollPane(description)).width(stage.width*0.6f).padRight(stage.width*0.05f)
select("Tutorials")
}

View File

@ -24,7 +24,7 @@ open class PickerScreen : CameraStageBaseScreen() {
descriptionLabel = "".toLabel()
descriptionLabel.wrap = true
val labelScroll = ScrollPane(descriptionLabel)
val labelScroll = ScrollPane(descriptionLabel,skin)
bottomTable.add(labelScroll).pad(5f).fill().expand()
rightSideButton = "".toTextButton()