Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Gfunkera on Fri 09/04/2004 08:33:33

Title: My GUI Thread
Post by: Gfunkera on Fri 09/04/2004 08:33:33
Ok I've been trying to make my own custom quit GUI I've got that part to work, then when trying to set the quit button I get this problem when trying to compile

Runtime Error: Function Still Open, missing }

Its probally something simple... Its pretty late and I've been working on my game for almost 9 hours now.....

Here is my code I have not yet added the cancel button....

 if (interface == ICONBAR) {
   if (button == 4) {  // show stuff
   if (IsGUIOn(1)==0)
GUIOn(1);

   }
   else if (button == 5)    // save game
     SaveGameDialog();
   else if (button == 6)   // load game
     RestoreGameDialog();
   if (button == 7) {  // quit
   if (IsGUIOn(2)==0)
GUIOn(2);

   }
   else if (button == 8)    // about
     Display("Weed Quest v1.0 by: Demorgon Games http://ashton.b0x.com");
 }  // end if interface ICONBAR

 if (interface == STUFF) {
   // They clicked a button on the Inventory GUI
   
   if (button == 1) {
     // They pressed SELECT, so switch to the Get cursor
     SetCursorMode (MODE_USE);
     // But, override the appearance to look like the arrow
     SetMouseCursor (6);
   }
   
   if (button == 2) {
     // They pressed LOOK, so switch to that mode
     SetActiveInventory(-1);
     SetCursorMode(MODE_LOOK);  
   }
   if (button == 3) {
     // They pressed the OK button, close the GUI
     GUIOff (STUFF);
     SetDefaultCursor();
   }

   if ((button == 4) && (game.top_inv_item < game.num_inv_items - game.num_inv_displayed)) {
     // scroll down
     game.top_inv_item = game.top_inv_item + game.items_per_line;
   }
   if ((button == 5) && (game.top_inv_item > 0)){
     // scroll up
     game.top_inv_item = game.top_inv_item - game.items_per_line;
 } // end if interface STUFF

 if (interface == QUIT) {
   
// They Clicked a button on the QUIT GUI
   if (button == 0) {      
QuitGame(0);

}


Title: Re:My GUI Thread
Post by: Scummbuddy on Fri 09/04/2004 08:37:57

if (interface == QUIT) {
   
// They Clicked a button on the QUIT GUI
   if (button == 0) {      
QuitGame(0);

}


add another brace on the end to this one.
Title: Re:My GUI Thread
Post by: Ginny on Sat 10/04/2004 19:11:35
It seems to me like there is also one } missing here a the end:


   if ((button == 5) && (game.top_inv_item > 0)){
     // scroll up
     game.top_inv_item = game.top_inv_item - game.items_per_line;
 } // end if interface STUFF

Title: Re:My GUI Thread
Post by: Scummbuddy on Sat 10/04/2004 20:16:08
i dont think so, it looks fine to me.
Title: Re:My GUI Thread
Post by: Scorpiorus on Sat 10/04/2004 20:23:01
There is a hidden brace :)
if ((button == 5) && (game.top_inv_item > 0)){[/color]
// scroll up
game.top_inv_item = game.top_inv_item - game.items_per_line;
} // end if interface STUFF