forked from rollingrock/Fallout-4-VR-Body
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMenu.cpp
More file actions
48 lines (37 loc) · 949 Bytes
/
Menu.cpp
File metadata and controls
48 lines (37 loc) · 949 Bytes
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
#include "Menu.h"
#include "f4sE_common/Relocation.h"
#include "F4SE_common/SafeWrite.h"
#include "utils.h"
namespace F4VRBody {
extern bool c_staticGripping;
bool inScopeMenu = false;
ScopeMenuEventHandler scopeMenuEvent;
bool dynamicGripEnabled = false;
bool isInScopeMenu() {
return inScopeMenu;
}
EventResult ScopeMenuEventHandler::ReceiveEvent(MenuOpenCloseEvent* a_event, void* dispatcher) {
const char* name = a_event->menuName.c_str();
if (!strcmp(name, "ScopeMenu")) {
if (a_event->isOpen) {
// _MESSAGE("scope opened");
if (!c_staticGripping) {
c_staticGripping = true;
// dynamicGripEnabled = true;
}
else {
dynamicGripEnabled = false;
}
inScopeMenu = true;
}
else {
//_MESSAGE("scope closed");
if (dynamicGripEnabled && c_staticGripping) {
// c_staticGripping = false;
}
inScopeMenu = false;
}
}
return EventResult::kEvent_Continue;
}
}