fix(rmti-ui): Handle many outline cases
This commit is contained in:
@@ -9,7 +9,7 @@ var lastHighlightState: bool
|
||||
func get_component_type():
|
||||
return "outline"
|
||||
|
||||
func _ready():
|
||||
func _ready() -> void:
|
||||
var collision = get_parent().collision
|
||||
if collision is CollisionPolygon2D:
|
||||
outline = ItemOutline.new()
|
||||
@@ -21,20 +21,14 @@ func _ready():
|
||||
outline.hide()
|
||||
|
||||
|
||||
func highlight(value: bool):
|
||||
isHighlighted = value
|
||||
|
||||
func _process(_delta: float):
|
||||
if not outline is ItemOutline:
|
||||
return
|
||||
if isHighlighted != lastHighlightState:
|
||||
if isHighlighted and escoria.current_state == escoria.GAME_STATE.DEFAULT and get_parent().is_interactive:
|
||||
outline.show()
|
||||
else:
|
||||
outline.hide()
|
||||
lastHighlightState = isHighlighted
|
||||
|
||||
func _input(event):
|
||||
func highlight(value: bool) -> void:
|
||||
# ESCPlayerWithTooltip adds 2 outlines. We handle every outline.
|
||||
# ToDo: Find why it has 2 outlines
|
||||
for node in get_parent().collision.get_children():
|
||||
if node is ItemOutline:
|
||||
node.visible = value
|
||||
|
||||
func _input(event) -> void:
|
||||
if not event.is_action("ui_show_hints"):
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user