Working menu

This commit is contained in:
Aaron 2011-08-20 17:57:26 +02:00
parent 2dba5ef64c
commit c5e16f150f
2 changed files with 7 additions and 4 deletions

View file

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

View file

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