fixed some ui stuff
This commit is contained in:
PCs
Scenes
Scripts
Worlds/GreenPlanet
keybind_screen.gd@ -8,8 +8,15 @@ var text_selected := false
|
||||
var username := "default"
|
||||
|
||||
func _input(event: InputEvent) -> void:
|
||||
if event.is_action_pressed("Open Text Chat"):
|
||||
if text_selected:
|
||||
if !text_selected and event.is_action_pressed("Open Text Chat"):
|
||||
get_viewport().set_input_as_handled()
|
||||
opened.emit()
|
||||
$VBoxContainer/LineEdit.visible = true
|
||||
$VBoxContainer/LineEdit.grab_focus()
|
||||
text_selected = true
|
||||
return
|
||||
if text_selected and event is InputEventKey and event.pressed == true:
|
||||
if event.keycode == KEY_ENTER:
|
||||
closed.emit()
|
||||
$VBoxContainer/LineEdit.deselect()
|
||||
$VBoxContainer/LineEdit.visible = false
|
||||
@ -20,11 +27,11 @@ func _input(event: InputEvent) -> void:
|
||||
else:
|
||||
rpc("append_message", username, $VBoxContainer/LineEdit.text)
|
||||
$VBoxContainer/LineEdit.clear()
|
||||
else:
|
||||
opened.emit()
|
||||
$VBoxContainer/LineEdit.visible = true
|
||||
$VBoxContainer/LineEdit.grab_focus()
|
||||
text_selected = true
|
||||
if event.keycode == KEY_ESCAPE:
|
||||
closed.emit()
|
||||
$VBoxContainer/LineEdit.deselect()
|
||||
$VBoxContainer/LineEdit.visible = false
|
||||
text_selected = false
|
||||
|
||||
|
||||
func change_username(old_name, new_name):
|
||||
|
Reference in New Issue
Block a user