mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2024-12-22 20:32:38 +01:00
Adding tab to complete shortcut
This commit is contained in:
parent
d498c2340b
commit
d2c95b8db0
2 changed files with 11 additions and 1 deletions
|
@ -80,6 +80,11 @@ right_click={
|
|||
"events": [ Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"button_mask":0,"position":Vector2( 0, 0 ),"global_position":Vector2( 0, 0 ),"factor":1.0,"button_index":2,"pressed":false,"doubleclick":false,"script":null)
|
||||
]
|
||||
}
|
||||
tab_complete={
|
||||
"deadzone": 0.5,
|
||||
"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)
|
||||
]
|
||||
}
|
||||
|
||||
[network]
|
||||
|
||||
|
|
|
@ -56,7 +56,12 @@ func _input(event):
|
|||
input.text = game.state["history"][history_position]
|
||||
input.caret_position = input.text.length()
|
||||
get_tree().set_input_as_handled()
|
||||
|
||||
|
||||
if event.is_action_pressed("tab_complete"):
|
||||
if completions.visible:
|
||||
completions.get_root().get_children().select(0)
|
||||
get_tree().set_input_as_handled()
|
||||
|
||||
func load_command(id):
|
||||
input.text = premade_commands[id]
|
||||
input.caret_position = input.text.length()
|
||||
|
|
Loading…
Reference in a new issue