20 lines
554 B
GDScript
20 lines
554 B
GDScript
extends LineEdit
|
|
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
func _ready():
|
|
|
|
text = str(Globals.get_save("sensitivity", 100))
|
|
_text_just_changed("")
|
|
|
|
text_changed.connect(_text_just_changed)
|
|
|
|
|
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
func _text_just_changed(_new_text):
|
|
Globals.write_save("sensitivity", int(text))
|
|
text = str(Globals.get_save("sensitivity", 100))
|
|
caret_column = text.length()
|
|
Globals.sensitivity = int(text) / 100.0 * 0.004
|
|
print ("sensitivity: ", Globals.sensitivity)
|