Item Highlight with shift key
This commit is contained in:
@@ -28,19 +28,18 @@ var outline: ItemOutline
|
||||
var highlight: bool
|
||||
var lastHighlightState: bool
|
||||
|
||||
var active: bool
|
||||
|
||||
# React to the mouse entering the item by emitting the respective signal
|
||||
func mouse_entered():
|
||||
active = true
|
||||
if escoria.action_manager.is_object_actionable(global_id):
|
||||
#outline.show()
|
||||
#if outline != null:
|
||||
# outline.show()
|
||||
emit_signal("mouse_entered_item", self)
|
||||
|
||||
|
||||
# React to the mouse exiting the item by emitting the respective signal
|
||||
func mouse_exited():
|
||||
#if outline != null:
|
||||
# outline.hide()
|
||||
active = false
|
||||
emit_signal("mouse_exited_item", self)
|
||||
|
||||
func _ready():
|
||||
@@ -55,6 +54,9 @@ func _ready():
|
||||
outline.hide()
|
||||
|
||||
func _process(_delta) -> void:
|
||||
if(is_interactive == false):
|
||||
return
|
||||
|
||||
if highlight != lastHighlightState:
|
||||
if highlight:
|
||||
outline.show()
|
||||
@@ -65,9 +67,13 @@ func _process(_delta) -> void:
|
||||
|
||||
func highlight(value: bool):
|
||||
highlight = value
|
||||
var a = 0
|
||||
|
||||
|
||||
func set_tooltip(action: String, text: String):
|
||||
set(action + "_text", text)
|
||||
|
||||
func _input(event):
|
||||
if(event.is_action_pressed("ui_show_hints")):
|
||||
highlight(true)
|
||||
elif (event.is_action_released("ui_show_hints")):
|
||||
if(!active):
|
||||
highlight(false)
|
||||
@@ -197,9 +197,6 @@ func _process_input(event: InputEvent, is_default_state: bool) -> bool:
|
||||
elif event.is_action_pressed(ESC_UI_CHANGE_VERB_ACTION):
|
||||
escoria.logger.error("Someone invoked ESC_UI_CHANGE_VERB_ACTION:", [event.as_text()])
|
||||
return true
|
||||
#elif event is InputEventAction:
|
||||
# event.is_action_pressed("ui_show_hints")
|
||||
# escoria.main.current_scene.get
|
||||
return false
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user