My GUI Thread

Started by Gfunkera, Fri 09/04/2004 08:33:33

Previous topic - Next topic

Gfunkera

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....

Code: ags
  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);

}



Scummbuddy

Code: ags

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.
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

Ginny

It seems to me like there is also one } missing here a the end:

Code: ags

    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

Try Not to Breathe - coming sooner or later!

We may have years, we may have hours, but sooner or later, we push up flowers. - Membrillo, Grim Fandango coroner

Scummbuddy

i dont think so, it looks fine to me.
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

Scorpiorus

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

SMF spam blocked by CleanTalk