Move Escoria settings load action out of init (#414)

InputMap actions added/removed at plugin enabled/disabled
Some changes to README
Co-authored-by: StraToN <StraToN@users.noreply.github.com>
This commit is contained in:
Julian Murgia
2021-10-14 21:56:02 +02:00
committed by GitHub
parent 00de7fcc4d
commit c859cffa33
6 changed files with 36 additions and 11 deletions

View File

@@ -85,7 +85,8 @@ func _ready():
func _input(event) -> void:
if not escoria.current_state == escoria.GAME_STATE.DEFAULT:
return
if event.is_action_pressed("switch_action_verb"):
if InputMap.has_action("switch_action_verb") \
and event.is_action_pressed("switch_action_verb"):
if event.button_index == BUTTON_WHEEL_UP:
emit_signal("mouse_wheel_up")
elif event.button_index == BUTTON_WHEEL_DOWN:

View File

@@ -54,7 +54,8 @@ func _ready():
#
# - event: The event received
func _on_inventory_item_gui_input(event: InputEvent):
if event.is_action_pressed("switch_action_verb"):
if InputMap.has_action("switch_action_verb") \
and event.is_action_pressed("switch_action_verb"):
if event.button_index == BUTTON_WHEEL_UP:
escoria.inputs_manager._on_mousewheel_action(-1)
elif event.button_index == BUTTON_WHEEL_DOWN: