From c400653f9dc64ff539542b0b3013587501704450 Mon Sep 17 00:00:00 2001 From: bleeptrack Date: Tue, 6 Oct 2020 11:34:12 +0200 Subject: [PATCH] Textedit save shortcut --- project.godot | 5 +++++ text_editor.gd | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/project.godot b/project.godot index ef74dca..444c39e 100644 --- a/project.godot +++ b/project.godot @@ -106,6 +106,11 @@ tab_complete={ "events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777218,"unicode":0,"echo":false,"script":null) ] } +save={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":true,"meta":false,"command":true,"pressed":false,"scancode":83,"unicode":0,"echo":false,"script":null) + ] +} [network] diff --git a/text_editor.gd b/text_editor.gd index 8bc0b3b..fc8e522 100644 --- a/text_editor.gd +++ b/text_editor.gd @@ -19,6 +19,10 @@ func _process(_delta): var filename = _client_connection.get_string(length) filename = filename.replace("%srepos/" % game.tmp_prefix_inside, "") open(filename) + +func _input(event): + if event.is_action_pressed("save"): + save() func open(filename): path = filename