void VoxGame::SetGameMode(GameMode mode) { GameMode previousgameMode = m_gameMode; m_gameMode = mode; if (m_gameMode == GameMode_Debug) { } if (m_gameMode == GameMode_FrontEnd) { if (previousgameMode == GameMode_Game || previousgameMode == GameMode_Loading) { // Setup the gamedata since we have just loaded fresh into the frontend. SetupDataForFrontEnd(); } } if (m_gameMode == GameMode_Game) { if (previousgameMode == GameMode_FrontEnd || previousgameMode == GameMode_Loading) { // Setup the gamedata since we have just loaded fresh into a game. SetupDataForGame(); } } }
void VoxGame::SetGameMode(GameMode mode) { GameMode previousgameMode = m_gameMode; m_gameMode = mode; if (m_gameMode == GameMode_Debug) { } if (m_gameMode == GameMode_FrontEnd) { if (previousgameMode == GameMode_Game || previousgameMode == GameMode_Loading) { // Close all open GUI windows CloseAllGUIWindows(); // Clear the items m_pItemManager->ClearItems(); // Setup the gamedata since we have just loaded fresh into the frontend. SetupDataForFrontEnd(); } } if (m_gameMode == GameMode_Game) { if (previousgameMode == GameMode_FrontEnd || previousgameMode == GameMode_Loading) { // Close all open GUI windows CloseAllGUIWindows(); // Clear the items m_pItemManager->ClearItems(); // Reset the player m_pPlayer->ResetPlayer(); // Load default inventory m_pInventoryManager->LoadDefaultInventory("Steve"); // Setup the gamedata since we have just loaded fresh into a game. SetupDataForGame(); } } }