Ideally, it would work similar to the vanilla settings GUI: inputting a number above or below the range is allowed, but when the textfield is confirmed, the value is set to whatever the last valid value was. Here is an example of what I mean, implemented through script:
(I added the red background by tinting the existing textfield active_background image)
Of course, being able to read the min and max would be nice, so I can add the red background and manipulate an adjacent slider correctly.
Thanks for your time!
Edit: In case anyone's interested, here's the style for the red background:
Code: Select all
styles['invalid_short_number_textfield'] = {
type = 'textbox_style',
parent = 'short_number_textfield',
active_background = {
base = {position={265,0}, corner_size=8, tint=warning_red_color},
shadow = textbox_dirt
}
}