Hi, niggling problem
The SaveCursorUntilItLeaves does not always release properly when it moves off gstatusline.gui after click a button on said gui.
function repeatedly_execute_always() {
GUI *theGui = GUI.GetAtScreenXY(mouse.x, mouse.y);
if (theGui == gStatusline)
{
mouse.SaveCursorUntilItLeaves();
mouse.Mode = eModePointer;
mouse.ChangeModeGraphic (eModePointer, 304); //304 being a custom pointer graphic
}
That's because mouse.SaveCursorUntilItLeaves() only works for Hotspots, Objects and Characters.
int old_mode;
function repeatedly_execute_always() {
GUI* theGui = GUI.GetAtScreenXY(mouse.x, mouse.y);
if (theGui == gStatusline && mouse.Mode != eModePointer) {
old_mode = mouse.Mode;
mouse.ChangeModeGraphic (eModePointer, 304);
mouse.Mode = eModePointer;
}
if (theGui != gStatusline && mouse.Mode == eModePointer && mouse.GetModeGraphic(eModePointer) == 304) {
mouse.mode = old_mode;
// mouse.ChangeModeGraphic (eModePointer, ORIGINAL_POINTER_SLOT);
}
}
Edit: corrected typo
Hi Khris,
thank you for that info.
unfortunately:
GlobalScript.asc(137): Error (line 137): undefined symbol 'theGUI'
This is line 137
if (theGUI != gStatusline && mouse.Mode == eModePointer && mouse.GetModeGraphic(eModePointer) == 304) {
Yeah, it's a typo, but really, try to fix this yourself. It's trivial.
Cheer Khris
Got it all sorted now.
Thank you