Details:
Basically, a simple proc, GetMouseLoc() (name doesn't matter), that returns a list with the following values:
under_object
icon-x
icon-y
under_location
under_window (would be useful)
This would get the above values without us having to use the mouse at all. This would be very useful for many games, specially shooters, where you would have to hold down the mouse to keep shooting.
Andre-G1 and I have tried to come up with workarounds, but with no luck. Here's a quick example:
client
var
mousepx=0
mousepy=0
mousex=0
mousey=0
mouse_isdown=0
proc
Shoot()
spawn while(mouse_isdown)
world<<"you shoot ([mousex],[mousey])([mousepx],[mousepy])!"
sleep(1)
UpdateMouseLoc(plist,loc)
var/Plist[]=params2list(plist)
src.mousepx=Plist["icon-x"]
src.mousepy=Plist["icon-y"]
src.mousex=loc:x
src.mousey=loc:y
MouseDrag(src_object,over_object,src_location,over_location,src_control,over_control,params)
src.UpdateMouseLoc(params,src_location)
..()
MouseEntered(object,location,control,params)
src.UpdateMouseLoc(params,location)
..()
MouseExited(object,location,control,params)
src.UpdateMouseLoc(params,location)
..()
MouseDown(object,location,control,params)
mouse_isdown=1
src.UpdateMouseLoc(params,location)
src.Shoot()
..()
MouseUp()
mouse_isdown=0
..()
Unfortunately, MouseDown() is the only proc that calls UpdateMouseLoc(), the other procs are not called while the mouse is down.
Thanks, and hope you consider.
Also if anyone has any tips on how to make this work, feel free to help out!
MouseEntered() is your best chance here. It is the only one you need. However, it will not be updated every pixel and it will not account for when the mouse leaves the map. It can do mouse_x, mouse_y, location, and control very well. The problem lies in the pixel location. While you may get it, it will not update every time the mouse has moved over an object.
[edit]
I also support this idea.