Civilopeida entries sorted alphabetically

This commit is contained in:
Yair Morgenstern 2018-12-05 10:30:50 +02:00
parent 93646cd74b
commit 13ff4843c0

View file

@ -62,7 +62,8 @@ class CivilopediaScreen : CameraStageBaseScreen() {
buttons.add(button)
val buttonClicked = {
val newArray = Array<ICivilopedia>()
for (civilopediaEntry in map[str]!!) newArray.add(civilopediaEntry)
for (civilopediaEntry in map[str]!!.sortedBy { it.toString() }) // Alphabetical order
newArray.add(civilopediaEntry)
nameList.setItems(newArray)
nameList.selected = nameList.items.get(0)
label.setText(nameList.selected.description)