Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Ali on Thu 22/06/2006 23:51:39

Title: Cancelling 'Mouse.SaveCursorUntilItLeaves()' (solved)
Post by: Ali on Thu 22/06/2006 23:51:39
Hello,

I have created exit hotspots that call 'Mouse.SaveCursorUntilItLeaves()' before changing the cursor to the 'Exit' Cursor.

I call the CMI-style inventory by right-clicking, which works fine unless I right-click while over an exit hotspot. The inventory opens, I can pick up items, but as soon as I leave the GUI my cursor returns to the cursor it was before I went onto the exit hotspot and I lose the item.

Is there a way of erasing the game's memory of the saved cursor at the point of right-clicking?

Thanks!

-Ali.
Title: Re: Cancelling 'Mouse.SaveCursorUntilItLeaves()'
Post by: GarageGothic on Fri 23/06/2006 00:08:37
SaveCursorUntilItLeaves() is a horribly glitchy function that doesn't take all kinds of fun stuff into consideration. I had so much trouble with it that I simply ended up scripting my own replacement, and I recommend you do the same. It is after all only a single int that needs to be stored to remember the cursor and one pointer to remember the hotspot (or an int if you store the ID instead).
Title: Re: Cancelling 'Mouse.SaveCursorUntilItLeaves()'
Post by: Ali on Sat 24/06/2006 13:12:59
Thanks for pointing me in the right direction. I followed your instructions and re-coded it using hotspot properties, a hotspot pointer and an integer as you suggested.

It works perfic now!