fix: error with dragon names
This commit is contained in:
parent
1378252483
commit
7c54b60337
3 changed files with 38 additions and 5 deletions
|
@ -1,6 +1,37 @@
|
|||
extends LineEdit
|
||||
|
||||
|
||||
var available_characters: Array[String] = [
|
||||
'A',
|
||||
'B',
|
||||
'C',
|
||||
'D',
|
||||
'E',
|
||||
'F',
|
||||
'G',
|
||||
'H',
|
||||
'I',
|
||||
'J',
|
||||
'K',
|
||||
'L',
|
||||
'M',
|
||||
'N',
|
||||
'O',
|
||||
'P',
|
||||
'Q',
|
||||
'R',
|
||||
'S',
|
||||
'T',
|
||||
'U',
|
||||
'V',
|
||||
'W',
|
||||
'X',
|
||||
'Y',
|
||||
'Z',
|
||||
' ',
|
||||
]
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
connect("text_changed", _text_to_upper)
|
||||
|
||||
|
@ -22,12 +53,12 @@ func _text_to_upper(new_text: String):
|
|||
}
|
||||
|
||||
var filtered_text := ""
|
||||
for c in new_text:
|
||||
if ascii_map.has(c):
|
||||
for c in new_text.to_upper():
|
||||
if ascii_map.has(c) and available_characters.has(ascii_map[c]):
|
||||
filtered_text += ascii_map[c]
|
||||
elif c.unicode_at(0) <= 127:
|
||||
elif c.unicode_at(0) <= 127 and available_characters.has(c):
|
||||
filtered_text += c
|
||||
|
||||
var last_caret_column = caret_column
|
||||
text = filtered_text.to_upper()
|
||||
text = filtered_text
|
||||
caret_column = last_caret_column
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue