From c5e16f150f4dd95ce9c2baf9a295e16b9ba5c49d Mon Sep 17 00:00:00 2001 From: Aaron Date: Sat, 20 Aug 2011 17:57:26 +0200 Subject: [PATCH] Working menu --- src/Events.pbi | 9 ++++++--- src/Main.pb | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Events.pbi b/src/Events.pbi index f8eb235..022d1f1 100644 --- a/src/Events.pbi +++ b/src/Events.pbi @@ -30,13 +30,16 @@ Procedure HandleEventMenu() ; We go to the target game state If KeyboardReleased(#PB_Key_Return) Menu_GotoCurrent() - CurrentState.s = *ActiveMenu\Entries()\TargetState + CurrentState = *ActiveMenu\Entries()\TargetState *ActiveMenu.GameMenu = Menus(CurrentState) EndIf - ;KeyboardPushed(#PB_Key_Escape) Or + EndProcedure Procedure HandleEventRunningGame() - Debug "Game starts!!!" + If KeyboardReleased(#PB_Key_Escape) + CurrentState = "MAIN_MENU" + *ActiveMenu.GameMenu = Menus(CurrentState) + EndIf EndProcedure \ No newline at end of file diff --git a/src/Main.pb b/src/Main.pb index 422f25f..c79c44a 100644 --- a/src/Main.pb +++ b/src/Main.pb @@ -106,7 +106,7 @@ If OpenWindow(0, 0, 0, Screen\Width, Screen\Height, title, #PB_Window_ScreenCent ; Draw the stuff on the screen FlipBuffers() ClearScreen(RGB(0, 0, 0)) - If StartDrawing(ScreenOutput()) + If StartDrawing(ScreenOutput()) And CurrentState <> "QUIT" GameStates(CurrentState)\DrawFun() StopDrawing() EndIf