feat: introduce escoria-ui-keyboard-9verbs to verify register_custom_input_handler() API
This commit was started by copying `addons/escoria-ui-9verbs` as the basis for `addons/escoria-ui-keyboard-9verbs`. It was then amended to wire up keyboard shortcuts for each verb using the new `register_custom_input_handler()` API. Note that `addons/escoria-ui-keyboard-9verbs/input_map.gd` introduces one action per verb and provides a `add_actions_to_input_map()` function to add the actions to the `InputMap`. The `_process_input()` function in `game.gd` is responsible for mapping each action to the appropriate call to `verbs_menu.on_action_selected()`.
This commit is contained in:
committed by
Julian Murgia
parent
14cf1327fe
commit
5a77bd6fdc
18
addons/escoria-ui-keyboard-9verbs/plugin.gd
Normal file
18
addons/escoria-ui-keyboard-9verbs/plugin.gd
Normal file
@@ -0,0 +1,18 @@
|
||||
# Plugin script to initialize Escoria simple mouse UI
|
||||
tool
|
||||
extends EditorPlugin
|
||||
|
||||
|
||||
# Register UI
|
||||
func _enter_tree() -> void:
|
||||
call_deferred("_register")
|
||||
|
||||
|
||||
# Deregister UI
|
||||
func _exit_tree() -> void:
|
||||
escoria.deregister_ui("res://addons/escoria-ui-keyboard-9verbs/game.tscn")
|
||||
|
||||
|
||||
# Register UI with Escoria
|
||||
func _register():
|
||||
escoria.register_ui("res://addons/escoria-ui-keyboard-9verbs/game.tscn")
|
||||
Reference in New Issue
Block a user