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
|
||||
|
|
|
@ -75,7 +75,7 @@ func move_window_to_bottom_right():
|
|||
var work_area_position: Vector2i = DisplayServer.screen_get_usable_rect(display_index).position
|
||||
var work_area_size: Vector2i = DisplayServer.screen_get_usable_rect(display_index).size
|
||||
|
||||
var window_size: Vector2i = Vector2i(work_area_size.y / 4 * 1.77777, work_area_size.y / 4)
|
||||
var window_size: Vector2i = Vector2i(work_area_size.y / 3 * 1.77777, work_area_size.y / 3)
|
||||
|
||||
var new_position: Vector2i = work_area_position + Vector2i(work_area_size.x - window_size.x, work_area_size.y - window_size.y)
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@ var alphabet: Dictionary = {
|
|||
'X': '23',
|
||||
'Y': '24',
|
||||
'Z': '25',
|
||||
' ': '26'
|
||||
}
|
||||
|
||||
var alphabet_inverse: Dictionary = {
|
||||
|
@ -62,6 +63,7 @@ var alphabet_inverse: Dictionary = {
|
|||
'23': 'X',
|
||||
'24': 'Y',
|
||||
'25': 'Z',
|
||||
'26': ' '
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue