deep-entertainment / issues

Issue tracker for deep Entertainment projects
1 stars 0 forks source link

[EGOVENTURE] Resetting an overridden cursor moves the hotspot #37

Closed ThmsKnz closed 1 year ago

ThmsKnz commented 1 year ago

Describe the bug When resetting an overridden cursor a new target mouse position is calculated in function reset. This causes the cursor and its hotspot to move (in case there is a difference between the hotspot location of the original cursor and the overridden cursor).

To Reproduce I created 2 test scenes with a walk hotspot to switch between the scenes. In one of the scenes I added a cursor override:

func _ready():
    Cursors.override(Cursors.Type.CUSTOM1, preload("res://images/mouse/right_corner_down.png"), Vector2(60, 50))
func _exit_tree():
    Cursors.reset(Cursors.Type.CUSTOM1)

Scenario 1: Use the 'Go Forward' cursor in both Walk Hotspots. The Custom1 cursor is not being used in the scenes. Result: The 'Go Forward' cursor is moving with each 'Cursors.reset' call when switching the scene, although the Custom1 cursor is not being used.

Scenario 2: Use the 'CUSTOM1' cursor in both Walk Hotspots. Result: Same result than scenario 1. The cursor is 'moving' with each scene change.

When setting target_mouse_position to null in function reset() the side effect of the moving hotspot is gone. This is also identical to the behaviour in the override() function. Also there target_mouse_position is set to null.

I'll file a pull request later this week proposing an update to cursors.gd.

MikaelNyqvist commented 1 year ago

I use overridden cursors constantly. I've tested this in the two last playthroughs of my new game, and it has eradicated every single "moving" cursor, and has produced no side effects.