Revert "adding state handling to post_its"

This reverts commit 7fb7be47a8.
This commit is contained in:
Adrian Schmid 2023-07-14 19:15:15 +02:00
parent 181f6a7e26
commit 1a21997e82
1 changed files with 10 additions and 13 deletions

View File

@ -6,8 +6,6 @@ var sibling
var shift_tween
var modulate_tween
var on_stage = false
@export var text: String = "" :
set (value):
if is_inside_tree() or Engine.is_editor_hint():
@ -62,8 +60,8 @@ func replace_with(postit: PostIt):
self.sibling = postit.sibling
func _process(_delta: float) -> void:
if on_stage:
_move_post_it()
_move_post_it()
func _on_focus_entered():
print(self, "is focused")
@ -72,7 +70,7 @@ func _on_focus_exited():
print(self, "is not focused")
func _on_mouse_entered():
if on_stage and not Input.is_action_pressed("mouse_left"):
if not Input.is_action_pressed("mouse_left"):
highlighted = true
if "handle_hover" in owner:
owner.handle_hover(self)
@ -81,14 +79,13 @@ func _on_mouse_exited():
highlighted = false
func _on_input_event(viewport, event, shape_idx):
if on_stage:
if event is InputEventMouseMotion:
_move_post_it()
if event is InputEventMouseMotion:
_move_post_it()
if event is InputEventMouseButton:
if event.button_index == MOUSE_BUTTON_LEFT:
if is_dragable and "handle_mouse_button" in owner:
owner.handle_mouse_button(self, event)
if event is InputEventMouseButton:
if event.button_index == MOUSE_BUTTON_LEFT:
if is_dragable and "handle_mouse_button" in owner:
owner.handle_mouse_button(self, event)
func _move_post_it():
if is_dragged: