Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: on Sun 25/05/2003 18:02:45

Title: Changing mouse cursor in GUI
Post by: on Sun 25/05/2003 18:02:45
 >:( I've created a new GUI which is a shop buying screen. It starts when a dialog calls a script turning the GUI on. Problem is the mouse cursor is still the talking one. I want to change to the pointer I've tried adding SetMouseCursor(6) before the GUI is turned on but it doesn't work.
Title: Re:Changing mouse cursor in GUI
Post by: Ishmael on Mon 26/05/2003 05:57:20
Is the GUIOn() in the dialog_reguest? (are you using that function?) Have you tried putting it after the GUIOn()?
Title: Re:Changing mouse cursor in GUI
Post by: on Mon 26/05/2003 09:16:12
Yes I'm usin a dialog_request I've tried GUIon before and after the setmousecursor but either way the cursor stays as the talking one.
Title: Re:Changing mouse cursor in GUI
Post by: Scorpiorus on Mon 26/05/2003 23:03:16
Did you finish the dialog after the run-script command? (stop I mean)

-Cheers
Title: Re:Changing mouse cursor in GUI
Post by: on Tue 27/05/2003 07:31:40
I remembered to put a stop in after the run-dialog command, so it's something else. I'm thinking of changing mouse cursor before i run the dialog, then changing it again afterwards. that should work ( i think)  
Title: Re:Changing mouse cursor in GUI
Post by: Scorpiorus on Tue 27/05/2003 14:32:20
I just have a test and figured out the next:
When you start the dialog (using RunDialog() or through the interaction editor) AGS saves the current cursor mode and changes it to the arrow.
And when the dialog was finished it restores previously saved mode.

You place it inside dialog_request(), right? But when the dialog_request() is running the dialog itself hasn't ended actually. It will be just after dialog_request() has finished executing. Therefore it overrides the mode was set. (with MODE_TALK in your case):

Sequence:
==========
1. Run the dialog and save current mode (MODE_TALK)
2. On choose option run dialog_request()
3. SetCursorMode(MODE_"ARROW"); dialog is still running
4. GUIOn(...)
5. Ruturn from dialog_request(); dialog is still running
6. End dialog on stop command and restore saved mode
So we have MODE_TALK instead.

Quote'm thinking of changing mouse cursor before i run the dialog, then changing it again afterwards. that should work ( i think)
Yes, that is. Also you can set the mode just after the dialog has ended:

dialog script:
@2
run-script 1
stop


Global script:

int TimeForShopping = 0;
function dialog_request (int value) {

if (value == 1) {
   TimeForShopping = 1;
}

}


function repeatedly_execute() {

 if (TimeForShopping == 1) {
       SetMouseCursor(6);
       GUIOn(...);
       TimeForShopping = 0;
 }

}

-Cheers
Title: Re:Changing mouse cursor in GUI
Post by: on Tue 27/05/2003 18:30:26
Thanks for you help, I understand how it works now. The only problems I got now is trying to draw the characters  ;)