Issue 335 (#384)

Co-authored-by: Dennis Ploeger <develop@dieploegers.de>
Co-authored-by: dploeger <dploeger@users.noreply.github.com>
This commit is contained in:
Dennis Ploeger
2021-09-06 08:57:45 +02:00
committed by GitHub
parent c8958e7454
commit 3ee46f4977
8 changed files with 135 additions and 98 deletions

View File

@@ -57,6 +57,8 @@ func run(command_params: Array) -> int:
escoria.main.scene_transition.fade_out()
yield(escoria.main.scene_transition, "transition_done")
escoria.inputs_manager.clear_stack()
escoria.main_menu_instance.hide()
var res_room = escoria.resource_cache.get_resource(command_params[0])

View File

@@ -104,7 +104,8 @@ func perform_inputevent_on_object(
global_position
# If clicked object not in inventory, player walks towards it
if not escoria.inventory_manager.inventory_has(obj.global_id):
if not obj.node is ESCPlayer and \
not escoria.inventory_manager.inventory_has(obj.global_id):
var context = _walk_towards_object(
obj,
event.position,

View File

@@ -7,6 +7,9 @@ class_name ESCPlayer, "res://addons/escoria-core/design/esc_player.svg"
# The node that references the camera position
export(NodePath) var camera_position_node
# Wether the player can be selected like an item
export(bool) var selectable = false
# A player is always movable
func _init():
@@ -15,8 +18,11 @@ func _init():
# Ready function
func _ready():
# For ESCPlayer, avoid the CollisionShape2D used for movement to catch inputs
disconnect("input_event", self, "manage_input")
if selectable:
._ready()
else:
tooltip_name = ""
disconnect("input_event", self, "manage_input")
# Return the camera position if a camera_position_node exists or the