bugfix: hide "press e to..." after taking items

This commit is contained in:
SyntaX 2020-01-27 16:40:44 +01:00
parent 7108d8394e
commit ae84dc0346

View File

@ -78,6 +78,7 @@ func _ready():
_lookCast.cast_to = Vector3(0, 0, INTERACT_DISTANCE) _lookCast.cast_to = Vector3(0, 0, INTERACT_DISTANCE)
_inventory = get_node("HUD") _inventory = get_node("HUD")
assert(null != _inventory)
# Set special fast time when in labyrinth # Set special fast time when in labyrinth
if IsInLabyrinth: if IsInLabyrinth:
@ -164,7 +165,6 @@ func process_collision_layers():
func check_interact(): func check_interact():
if _lookCast.is_colliding(): if _lookCast.is_colliding():
var collider = _lookCast.get_collider() var collider = _lookCast.get_collider()
if null != collider and collider.is_in_group("Touchables"): if null != collider and collider.is_in_group("Touchables"):
#show interact tooltip #show interact tooltip
_labelInteract.show() _labelInteract.show()
@ -181,8 +181,8 @@ func check_interact():
collider.do_interact(self) collider.do_interact(self)
if collider.is_in_group("Collectibles"): if collider.is_in_group("Collectibles"):
_inventory.add_item(collider.name) _inventory.add_item(collider.name)
#bugfix: remove _prev_look after taken _prev_look = null # remove after taken
_prev_look = null _labelInteract.hide()
else: else:
#stop showing interact tooltip and disable outline #stop showing interact tooltip and disable outline
_labelInteract.hide() _labelInteract.hide()
@ -253,11 +253,9 @@ func _on_respawn ():
yield(_animationFadeOut, "animation_finished") yield(_animationFadeOut, "animation_finished")
_animationFadeOut.seek(0, true) _animationFadeOut.seek(0, true)
# reset values
Daytime._set_time(0) Daytime._set_time(0)
Logger.info("save areas: " + String(_save_areas)) #Logger.info("save areas: " + String(_save_areas))
if _save_areas < 1 and not IsInLabyrinth: if _save_areas < 1 and not IsInLabyrinth:
Logger.info("reload scene") Logger.info("reload scene")