Closing GUI on load sucess

Started by BorisZ, Sun 12/09/2004 16:23:25

Previous topic - Next topic

BorisZ

Hi
How can I be sure that user will load the game, and not cancel loading. I have GUI that I am closing after user presses load. But if user presses cancel on load screen, GUI is off and there is a blank room.
Thanks!

Scorpiorus

I'm not quite sure what you are after but if you really want to force the user load a game just remove the cancel button from the GUI.

Or what behaviour do you want when the user presses "cancel"?

Albert Cuandero

I think using a command to return the player to the room they came from would solve this.

For my load GUI (Interface 2) I use:
Code: ags

else if (button == 2) { //Resume playing
Ã,  Ã,  InterfaceOff (2);
Ã,  Ã,  SetDefaultCursor();
Ã,  Ã,  }


However if I get the player to an extra room first (like a map, or a book) I use this:

Code: ags

if (interface == 3) { //return
Ã,  Ã,  if (button == 0) {
Ã,  Ã,  Ã,  NewRoomEx (character[ GetPlayerCharacter () ].prevroom, character[ GetPlayerCharacter () ].x , character[ GetPlayerCharacter () ].y);
Ã,  Ã,  Ã,  InterfaceOff (3);
Ã,  Ã,  Ã,  }
Ã,  Ã,  }


Does it help?
int do_you_like_me;
if (do_you_like_me == 1) Display ("You can call me Al");
else {}

BorisZ

All the answers I got are related to custom load game GUI, but I am using built-in load game gui.
Is there a way to check if user has loaded the game and then do something (remove custmo GUI) and when he presses cancel, it does nothing (all with built-in load GUI)?

Scorpiorus

Yes, there is a global on_event function that can be used to catch the load event:

// main global script file

function on_event (int event, int data)  {

    if (event == RESTORE_GAME)
    {
        // code just after the game is restored
        GUIOff(...);
    }

}

SMF spam blocked by CleanTalk