From 2eef87c163f535278480fbaeb94093df04b6da7c Mon Sep 17 00:00:00 2001 From: LUCASTUCIOUS Date: Sun, 28 Jul 2024 14:15:04 +0200 Subject: [PATCH] Cursor look state machine --- core/Cursor.gd | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/core/Cursor.gd b/core/Cursor.gd index f0e8ccf..4c9464c 100644 --- a/core/Cursor.gd +++ b/core/Cursor.gd @@ -136,6 +136,17 @@ func cursorClick(): hoveredObject.on_click() func cursor_look(): + if (grabbedSticker ): + currentCursorState = CURSOR_STATE.GRABBED + elif (hoveredSticker): + if (!($GrabTimer.is_stopped())): + currentCursorState = CURSOR_STATE.GRABBED + else: + currentCursorState = CURSOR_STATE.GRAB + elif (!($GrabTimer.is_stopped())): + currentCursorState = CURSOR_STATE.CLICK + else: + currentCursorState = CURSOR_STATE.DEFAULT if (currentCursorState != oldCursorState): oldCursorState = currentCursorState