Se nos viene la olla
This commit is contained in:
@@ -7,35 +7,35 @@ var isHighlighted: bool
|
||||
var lastHighlightState: bool
|
||||
|
||||
func get_component_type():
|
||||
return "outline"
|
||||
return "outline"
|
||||
|
||||
func _ready():
|
||||
var collision = get_parent().collision
|
||||
if collision is CollisionPolygon2D:
|
||||
outline = ItemOutline.new()
|
||||
outline.polygon = collision.get("polygon")
|
||||
outline.color = Color(1,1,1,0.2)
|
||||
outline.set_outline_width(2.0)
|
||||
outline.set_outline_color(Color(1,1,1,1))
|
||||
collision.add_child(outline)
|
||||
outline.hide()
|
||||
var collision = get_parent().collision
|
||||
if collision is CollisionPolygon2D:
|
||||
outline = ItemOutline.new()
|
||||
outline.polygon = collision.get("polygon")
|
||||
outline.color = Color(1,1,1,0.2)
|
||||
outline.set_outline_width(2.0)
|
||||
outline.set_outline_color(Color(1,1,1,1))
|
||||
collision.add_child(outline)
|
||||
outline.hide()
|
||||
|
||||
|
||||
func highlight(value: bool):
|
||||
isHighlighted = value
|
||||
isHighlighted = value
|
||||
|
||||
func _process(_delta: float):
|
||||
if not escoria.action_manager.is_object_actionable(get_global_id()):
|
||||
return
|
||||
if isHighlighted != lastHighlightState:
|
||||
if isHighlighted:
|
||||
outline.show()
|
||||
else:
|
||||
outline.hide()
|
||||
lastHighlightState = isHighlighted
|
||||
# if not escoria.action_manager.is_object_actionable(get_global_id()):
|
||||
# return
|
||||
if isHighlighted != lastHighlightState:
|
||||
if isHighlighted:
|
||||
outline.show()
|
||||
else:
|
||||
outline.hide()
|
||||
lastHighlightState = isHighlighted
|
||||
|
||||
func _input(event):
|
||||
if(event.is_action_pressed("ui_show_hints")):
|
||||
highlight(true)
|
||||
elif (event.is_action_released("ui_show_hints")):
|
||||
highlight(false)
|
||||
if(event.is_action_pressed("ui_show_hints")):
|
||||
highlight(true)
|
||||
elif (event.is_action_released("ui_show_hints")):
|
||||
highlight(false)
|
||||
|
||||
Reference in New Issue
Block a user