Prepare Android controller and export support
This commit is contained in:
parent
c84f305c34
commit
d24f2f50c0
9 changed files with 192 additions and 11 deletions
|
|
@ -34,12 +34,12 @@ func _ready() -> void:
|
|||
|
||||
|
||||
func handle_input(event: InputEvent, can_open: bool) -> bool:
|
||||
if not event.is_action("open_emotes"):
|
||||
return false
|
||||
var key_event: InputEventKey = event as InputEventKey
|
||||
if key_event == null or key_event.echo:
|
||||
if key_event != null and key_event.echo:
|
||||
return false
|
||||
if key_event.physical_keycode != KEY_C:
|
||||
return false
|
||||
if key_event.pressed:
|
||||
if event.is_pressed():
|
||||
if _is_open or not can_open:
|
||||
return _is_open
|
||||
open_menu()
|
||||
|
|
|
|||
|
|
@ -193,6 +193,14 @@ func _unhandled_input(event: InputEvent) -> void:
|
|||
or not _fishing_spot.can_change_hotbar_selection()
|
||||
):
|
||||
return
|
||||
if event.is_action_pressed("hotbar_previous"):
|
||||
_hotbar.cycle_selection(-1)
|
||||
get_viewport().set_input_as_handled()
|
||||
return
|
||||
if event.is_action_pressed("hotbar_next"):
|
||||
_hotbar.cycle_selection(1)
|
||||
get_viewport().set_input_as_handled()
|
||||
return
|
||||
if event is InputEventKey and event.pressed and not event.echo:
|
||||
for index: int in range(PlayerHotbarType.SLOT_COUNT):
|
||||
if event.is_action_pressed("hotbar_%d" % (index + 1)):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue