ID:507391
 
Applies to:DM Language
Status: Open

Issue hasn't been assigned a status value.
Recently (I think; maybe it was a bug fix) it was made so that MouseEntered is called when an atom moves under the mouse while the mouse is stationary. This is great, but MouseEntered isn't called in this case if the mouse is down. I'm guessing it assumes that if the mouse is down, the mouse entering something would be a drag. But an atom moving, and not the mouse, would not be a drag.

So basically what I would like is for MouseEntered to be called when the mouse is down and an atom moves under the mouse while it is stationary (not being dragged).

Edit: I suppose you could argue that the mouse moving away from the location of an object on the screen due to the screen itself moving and not the mouse would be a drag. If so, though, at least call MouseDrag when an atom moves under a stationary mouse like it does with MouseEntered.
IMO, MouseEntered() should be called in all cases, even when dragging, it is still entering things...
In response to Falacy
Falacy wrote:
IMO, MouseEntered() should be called in all cases, even when dragging, it is still entering things...

As long as it doesn't hurt performance too much, I would have to agree. Developers who didn't want MouseEntered to be called when dragging could easily use a variable when dragging that prevents MouseEntered code from executing.

My main issue, though, is at least calling one of the mouse procs when the mouse is down and atoms move under the mouse.
If MouseDrag() is not called in this case, then it is a bug with MouseDrag(). Though, I agree with Falacy about MouseEntered().
After implementing machine guns into Box Zombies, which you can hold down the mouse to continually fire, this lack of functionality has proved rather clunky. If you start shooting to your left, and then walk upwards, you will end up shooting nearly below you, since the mouse never updates its position as you move when it is held down.
In response to Falacy
MouseEntered() isn't called while the mouse button is held, that's in MouseDrag().
In response to Kaiochao
Kaiochao wrote:
MouseEntered() isn't called while the mouse button is held, that's in MouseDrag().

MouseDrag() isn't called unless the player moves the mouse. If you aren't holding down a mouse button, and the player is walking, then MouseEntered() will automatically be called over new tiles regardless. Calling MouseEntered() from MouseDrag() helps lessen the issue, but still relies on the player moving their mouse at some point.
The problem is nothing is called if you have the mouse down and the player moves or an atom moves under the mouse while the cursor is stationary (just holding down the mouse button and not moving the mouse). The only time something is called when the mouse is down is if the user actually moves the cursor themselves.
Also, if you drag an object onto another object, MouseEntered() is called, but MouseExited() isn't.
Bumping this to hopefully get it added/fixed.