-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMiniGameNavigation.cpp
More file actions
51 lines (43 loc) · 1.23 KB
/
MiniGameNavigation.cpp
File metadata and controls
51 lines (43 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include "Game/Common/MiniGameNavigation.h"
#include "Core/App/AppContext.h"
#include "Core/App/IGameHost.h"
#include "Game/MainMenu/MainMenuGame.h"
#include <cstdio>
#include <memory>
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <Windows.h>
bool WasDebugReturnToMainMenuPressed(const InputSystem &input)
{
return input.GetKeyboard().WasKeyPressed(Key::P);
}
bool RequestReturnToEngineMainMenu(AppContext &context, const char *const source)
{
if (context.GameHost == nullptr)
{
char buffer[320]{};
(void)std::snprintf(
buffer,
sizeof(buffer),
"[NAV][RETURN_MAIN] ERROR GameHost=null source=%s\n",
source != nullptr ? source : "(null)");
OutputDebugStringA(buffer);
return false;
}
{
char buffer[320]{};
(void)std::snprintf(
buffer,
sizeof(buffer),
"[NAV][RETURN_MAIN] source=%s\n",
source != nullptr ? source : "(null)");
OutputDebugStringA(buffer);
}
context.GameHost->RequestSwitchGame(std::make_unique<MainMenuGame>());
if (context.Input.System != nullptr)
{
context.Input.System->ConsumePressedStates();
}
return true;
}