Skip to content

Commit 87a1e87

Browse files
committed
Add option to pause game in FreeCamera mod
1 parent 05874e1 commit 87a1e87

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

Mods/FreeCamera/include/FreeCamera.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ class FreeCamera : public ModInterface
6262
bool areControlsVisible;
6363
std::unordered_map<std::string, std::string> pcControls;
6464
std::unordered_map<std::string, std::string> controllerControls;
65+
bool pauseGame;
6566

6667
float freeCamSpeedChangeThreshold;
6768
float freeCamTranslationSpeedChangeSensitivity;

Mods/FreeCamera/src/FreeCamera.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ FreeCamera::FreeCamera() :
2626
instantlyKillNpcAction("InstantKill"),
2727
teleportMainCharacterAction("Teleport"),
2828
areControlsVisible(false),
29+
pauseGame(false),
2930
freeCamSpeedChangeThreshold(0.5f),
3031
deltaTranslationSpeed(0.f),
3132
freeCamTranslationSpeedChangeSensitivity(4.f),
@@ -160,6 +161,18 @@ void FreeCamera::OnDrawMenu()
160161
ToggleFreeCamera();
161162
}
162163

164+
if (ImGui::Checkbox(ICON_MD_TIMER " Pause Game", &pauseGame))
165+
{
166+
if (pauseGame)
167+
{
168+
GameLoopManager->SetPlayMode(EPlayMode::PLAYMODE_PAUSED);
169+
}
170+
else
171+
{
172+
GameLoopManager->SetPlayMode(EPlayMode::PLAYMODE_PLAYING);
173+
}
174+
}
175+
163176
if (ImGui::Button(ICON_MD_SPORTS_ESPORTS " Free Camera Controls"))
164177
{
165178
areControlsVisible = !areControlsVisible;

0 commit comments

Comments
 (0)