LOL - AGS likes walking icon (Solved)

Started by Volcan, Mon 01/07/2013 17:55:20

Previous topic - Next topic

Volcan

AGS keeps showing walking icon with my custom Quit gui.

Code: AGS
if (keycode == eKeyCtrlQ){
 mouse.UseModeGraphic(eModePointer);
 gQuitter.Visible = true;   // Ctrl-Q
}


Khris

Try:
Code: ags
  mouse.Mode = eModePointer

Volcan

#2
I tried:

Code: AGS
if (keycode == eKeyCtrlQ){
   mouse.UseModeGraphic(eModePointer);
   mouse.Mode = eModePointer;
   gQuitter.Visible = true; // Ctrl-Q
}


The walking cursor still appears.

But the code I just found works fine. See bellow.

Code: AGS
function repeatedly_execute_always() {
  
  // Put anything you want to happen every game cycle, even
  // when the game is blocked inside a command like a
  // blocking Walk().
  // You cannot run blocking commands from this function.
 if (IsGUIOn(9)){
  mouse.UseModeGraphic(eModePointer);
 }
}


Maybe there is an easier way to do.

Ryan Timothy B

This doesn't change the cursor to eModePointer:
     mouse.UseModeGraphic(eModePointer)

What that's doing is changing the current mode's graphic to the graphic of eModePointer.

Are you sure there isn't something in your script that's changing the mouse mode to eModeWalkto?

Volcan

Thanks Ryan.

Here a new code.
Code: AGS
function repeatedly_execute_always() {
  // Put anything you want to happen every game cycle, even
  // when the game is blocked inside a command like a
  // blocking Walk().
  // You cannot run blocking commands from this function.
  if (gQuitter.Visible) mouse.Mode = eModePointer;
}

Volcan

My new code works fine.

Thanks to everybody.

Khris

Ok, so you're forcing AGS back into eModePointer. Sure, that will work. But it's always better to fix the original problem, instead of patching over it like that.
In some repeatedly_execute of yours, the pointer is changed to eModeWalkto, presumably because GetLocationType() returns eLocationNothing.

SMF spam blocked by CleanTalk