forked from woofmeow/straywild
Expand gameplay systems and interface controls
This commit is contained in:
parent
09b7a78533
commit
2710544070
46 changed files with 2072 additions and 153 deletions
|
|
@ -168,6 +168,12 @@ func _on_pressed() -> void:
|
|||
|
||||
func _on_gui_input(event: InputEvent) -> void:
|
||||
var mouse_event := event as InputEventMouseButton
|
||||
if mouse_event != null and mouse_event.pressed:
|
||||
# Pointer clicks give Buttons keyboard focus after their GUI callback.
|
||||
# Release that pointer-created focus on the next frame so a tooltip does
|
||||
# not remain pinned after the pointer leaves. Controller navigation still
|
||||
# keeps focus normally because it does not arrive as a mouse event.
|
||||
call_deferred("_release_pointer_focus")
|
||||
if (
|
||||
mouse_event != null
|
||||
and mouse_event.button_index == MOUSE_BUTTON_RIGHT
|
||||
|
|
@ -179,6 +185,11 @@ func _on_gui_input(event: InputEvent) -> void:
|
|||
accept_event()
|
||||
|
||||
|
||||
func _release_pointer_focus() -> void:
|
||||
if has_focus():
|
||||
release_focus()
|
||||
|
||||
|
||||
func _set_context_hovered(active: bool) -> void:
|
||||
_context_hovered = active
|
||||
_update_context_presence()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue