Cursor look state machine

This commit is contained in:
Lucas 2024-07-28 14:15:04 +02:00
parent bf0ddce8a5
commit 2eef87c163

View file

@ -136,6 +136,17 @@ func cursorClick():
hoveredObject.on_click() hoveredObject.on_click()
func cursor_look(): 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): if (currentCursorState != oldCursorState):
oldCursorState = currentCursorState oldCursorState = currentCursorState