AskNumberPopup
fun AskNumberPopup(screen: BaseScreen, label: String = "Please enter a number", icon: IconCircleGroup = ImageGetter.getImage("OtherIcons/Pencil").apply { this.color = Color.BLACK }.surroundWithCircle(80f), defaultText: String = "", amountButtons: List<Int> = listOf(), bounds: IntRange = IntRange(Int.MIN_VALUE, Int.MAX_VALUE), errorText: String = "Invalid input! Please enter a valid number.", validate: (input: Int) -> Boolean = { true }, actionOnOk: (input: Int) -> Unit = { })
Content copied to clipboard
Parameters
screen
The previous screen the user was on
label
A line of text shown to the user
icon
Icon at the top, should have size 80f
defaultText
The text that should be in the prompt at the start
amountButtons
Buttons that when clicked will add/subtract these amounts to the number
bounds
The bounds in which the number must lie. Defaults to Int.MIN_VALUE, Int.MAX_VALUE
errorText
Text that will be shown when an error is detected
validate
Function that should return true
when a valid input is detected
actionOnOk
Lambda that will be executed after pressing 'OK'.
Sources
jvm source
Link copied to clipboard