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);
}
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.
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
i dont think so, it looks fine to me.
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