//========= Copyright © 2007, addiktiveGAMING - TEAMLegend, All rights reserved. =========// // // Purpose: Abstract class to represent game states (Eg. Main Menu, In-game, etc) // File: GameState.cpp //========================================================================================// #include "cbase.h" #include "LegendApp.h" #include "GameTime.h" bool MainMenuState::Run() { // Do any keyboard checking here int iDialogResult = m_spGUIContext->ShowDialogModal( NULL, "resources\\MainMenu.xml", VVertex2f(0,0), m_spGUIContext->GetNullApp() ); if ( iDialogResult == VGUIManager::ID_CANCEL ) // abort the game return false; else if ( iDialogResult == VGUIManager::ID_ACCEPT ) CLegendApp::GetSingleton()->EnterState( new InGameState() ); //Update game timer LegendTime LegendTime; LegendTime.UpdateGameTimer(); return true; }