Esempio n. 1
0
void
RoomBase::ToggleGUI()
{
	if (IsGUIShown())
		HideGUI();
	else
		ShowGUI();
}
Esempio n. 2
0
File: VoxGUI.cpp Progetto: rzh/Vox
void VoxGame::SetupGUI()
{
	m_pDeferredCheckBox->SetToggled(m_pVoxSettings->m_deferredRendering);
	m_pShadowsCheckBox->SetToggled(m_pVoxSettings->m_shadows);
	m_pSSAOCheckBox->SetToggled(m_pVoxSettings->m_ssao);
	m_pBlurCheckBox->SetToggled(m_pVoxSettings->m_blur);
	m_pDynamicLightingCheckBox->SetToggled(m_pVoxSettings->m_dynamicLighting);
	m_pMSAACheckBox->SetToggled(m_pVoxSettings->m_msaa);
	m_pInstanceRenderCheckBox->SetToggled(m_pVoxSettings->m_instancedParticles);
	m_pWireframeCheckBox->SetToggled(m_pVoxSettings->m_wireframeRendering);
	m_pDebugRenderCheckBox->SetToggled(m_pVoxSettings->m_debugRendering);
	m_pFaceMergingCheckbox->SetToggled(m_pVoxSettings->m_faceMerging);
	m_pStepUpdateCheckbox->SetToggled(m_pVoxSettings->m_stepUpdating);

	// Debug GUI
	if(m_pVoxSettings->m_showDebugGUI)
	{
		ShowGUI();
	}
	else
	{
		HideGUI();
	}

	// Game mode
	if (strcmp(m_pVoxSettings->m_gameMode.c_str(), "Debug") == 0)
	{
		m_pDebugOptionBox->SetToggled(true);
	}
	else if (strcmp(m_pVoxSettings->m_gameMode.c_str(), "Game") == 0)
	{
		m_previousCameraMode = CameraMode_MouseRotate;
		m_pGameOptionBox->SetToggled(true);
		m_pMouseRotateCameraOptionBox->SetToggled(true);

		// Supress exporting of files, since we are loading into a DEBUG configuration direct from bootstrap
		m_pInventoryManager->SetSupressExport(true);
		m_pActionBar->SetSupressExport(true);
		m_pPlayer->SetSupressStatsExport(true);
		// Load default inventory since we are loading directly into the game
		m_pInventoryManager->LoadInventory("", PlayerClass_Debug, false);
	}
	else if (strcmp(m_pVoxSettings->m_gameMode.c_str(), "FrontEnd") == 0)
	{
		m_pFrontEndOptionBox->SetToggled(true);
		m_pFrontendCameraOptionBox->SetToggled(true);
	}
	m_pVoxWindow->Update(m_deltaTime);
	GameModeChanged();
	CameraModeChanged();
}
Esempio n. 3
0
void VoxGame::KeyReleased(int key, int scancode, int mods)
{
	m_pGUI->KeyReleased(key, mods);

	if (m_pGUI->IsKeyboardInteractingWithGUIComponent() && key != GLFW_KEY_ESCAPE)
	{
		return;  // For textbox entry
	}

	switch (key)
	{
		// Player movement
		case GLFW_KEY_W:
		{
			m_bKeyboardForward = false;
			break;
		}
		case GLFW_KEY_S:
		{
			m_bKeyboardBackward = false;
			break;
		}
		case GLFW_KEY_A:
		{
			m_bKeyboardLeft = false;
			m_bKeyboardStrafeLeft = false;
			break;
		}
		case GLFW_KEY_D:
		{
			m_bKeyboardRight = false;
			m_bKeyboardStrafeRight = false;
			break;
		}
		case GLFW_KEY_F:
		{
			m_bKeyboardUp = false;
			break;
		}
		case GLFW_KEY_V:
		{
			m_bKeyboardDown = false;
			break;
		}
		case GLFW_KEY_SPACE:
		{
			m_bKeyboardSpace = false;
			break;
		}
		case GLFW_KEY_ESCAPE:
		{
			m_bKeyboardMenu = false;
			break;
		}
		case GLFW_KEY_O:
		{
			if (STEAM_BUILD == false)
			{
				m_pDebugCameraOptionBox->SetToggled(true);
				CameraModeChanged();
			}
			break;
		}
		case GLFW_KEY_L:
		{
			if (STEAM_BUILD == false)
			{
				SetPaused(!IsPaused());
			}
			break;
		}
		case GLFW_KEY_P:
		{
			if (STEAM_BUILD == false)
			{
				if (m_pGUI->IsKeyboardInteractingWithGUIComponent() == false)
				{
					if (m_pMainWindow->IsVisible() == false)
					{
						ShowGUI();
					}
					else
					{
						HideGUI();
					}
				}
			}
			break;
		}

		// Game GUI
		case GLFW_KEY_I:
		{
			if (GetGameMode() == GameMode_Game)
			{
				if (m_pPlayer->IsDead() == false)
				{
					if (m_pInventoryGUI->IsLoaded())
					{
						m_pInventoryGUI->Unload();

						if (VoxGame::GetInstance()->IsGUIWindowStillDisplayed() == false)
						{
							TurnCursorOff(false);
						}
					}
					else if (m_pFrontendManager->GetFrontendScreen() == FrontendScreen_None)
					{
						m_pInventoryGUI->Load();

						m_pPlayer->StopMoving();

						TurnCursorOn(false, false);
					}
				}
			}
			break;
		}
		case GLFW_KEY_C:
		{
			if (GetGameMode() == GameMode_Game)
			{
				if (m_pPlayer->IsDead() == false)
				{
					if (m_pCharacterGUI->IsLoaded())
					{
						m_pCharacterGUI->Unload();

						if (VoxGame::GetInstance()->IsGUIWindowStillDisplayed() == false)
						{
							TurnCursorOff(false);
						}
					}
					else if (m_pFrontendManager->GetFrontendScreen() == FrontendScreen_None)
					{
						m_pCharacterGUI->Load();

						m_pPlayer->StopMoving();

						TurnCursorOn(false, false);
					}
				}
			}
			break;
		}
		case GLFW_KEY_K:
		{
			if (GetGameMode() == GameMode_Game)
			{
				if (m_pPlayer->IsDead() == false)
				{
					if (m_pQuestGUI->IsLoaded())
					{
						m_pQuestGUI->Unload();

						if (VoxGame::GetInstance()->IsGUIWindowStillDisplayed() == false)
						{
							TurnCursorOff(false);
						}
					}
					else if (m_pFrontendManager->GetFrontendScreen() == FrontendScreen_None)
					{
						m_pQuestGUI->Load();

						m_pPlayer->StopMoving();

						TurnCursorOn(false, false);
					}
				}
			}
			break;
		}

		// Number keys
		case GLFW_KEY_1:
		{
			m_pActionBar->UseActionBarslot(0);
			break;
		}		
		case GLFW_KEY_2:
		{
			m_pActionBar->UseActionBarslot(1);
			break;
		}
		case GLFW_KEY_3:
		{
			m_pActionBar->UseActionBarslot(2);
			break;
		}
		case GLFW_KEY_4:
		{
			m_pActionBar->UseActionBarslot(3);
			break;
		}
		case GLFW_KEY_5:
		{
			m_pActionBar->UseActionBarslot(4);
			break;
		}
		case GLFW_KEY_6:
		{
			m_pActionBar->UseActionBarslot(5);
			break;
		}
		case GLFW_KEY_7:
		{
			m_pActionBar->UseActionBarslot(6);
			break;
		}
		case GLFW_KEY_8:
		{
			m_pActionBar->UseActionBarslot(7);
			break;
		}
		case GLFW_KEY_9:
		{
			m_pActionBar->UseActionBarslot(8);
			break;
		}
		case GLFW_KEY_0:
		{
			m_pActionBar->UseActionBarslot(9);
			break;
		}
	}
}