mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-10 07:48:31 +07:00
square-bracket-containing promotions are addable via visible name in dev console
This commit is contained in:
@ -76,7 +76,7 @@ internal class CliInput(
|
|||||||
override fun equals(other: Any?): Boolean = when {
|
override fun equals(other: Any?): Boolean = when {
|
||||||
this === other -> true
|
this === other -> true
|
||||||
other is CliInput -> compareTo(other) == 0
|
other is CliInput -> compareTo(other) == 0
|
||||||
other is String -> compareTo(other, method) == 0
|
other is String -> compareTo(other.replace("[","").replace("]",""), method) == 0
|
||||||
else -> false
|
else -> false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,6 +37,7 @@ internal class ConsoleUnitCommands : ConsoleCommandNode {
|
|||||||
val promotions = console.getSelectedUnit().promotions.promotions
|
val promotions = console.getSelectedUnit().promotions.promotions
|
||||||
val options = console.gameInfo.ruleset.unitPromotions.keys.asSequence()
|
val options = console.gameInfo.ruleset.unitPromotions.keys.asSequence()
|
||||||
.filter { it !in promotions }
|
.filter { it !in promotions }
|
||||||
|
.map { it.replace("[","").replace("]","") }
|
||||||
.asIterable()
|
.asIterable()
|
||||||
return getAutocompleteString(params.lastOrNull().orEmpty(), options, console)
|
return getAutocompleteString(params.lastOrNull().orEmpty(), options, console)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user