-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathPipboy.h
More file actions
93 lines (72 loc) · 2.77 KB
/
Copy pathPipboy.h
File metadata and controls
93 lines (72 loc) · 2.77 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#pragma once
#include "Flashlight.h"
#include "PipboyPhysicalHandler.h"
namespace frik
{
class Skeleton;
/**
* Handle Pipboy:
* 1. On wrist UI override.
* 2. Hand interaction with on-wrist Pipboy.
* 3. Flashlight on-wrist / head location toggle.
*/
class Pipboy
{
public:
explicit Pipboy(Skeleton* skelly);
static bool isPlayerLookingAtPipboy(bool isPipboyOpen);
bool isOpen() const
{
return _isOpen;
}
bool isOperatingWithFinger() const
{
return _physicalHandler.isOperating();
}
void openClose(bool open);
void resetOnDisable();
void swapModel();
void onFrameUpdate();
private:
void exitPowerArmorBugFixHack(bool set);
void hideShowPipboyOnArm() const;
static void restoreDefaultPipboyModelIfNeeded();
void updateSetupPipboyNodes();
void updateSetupAttaboyNodes();
void showHideCorrectPipboyMesh(const std::string& itemHide, const std::string& itemShow) const;
void setupPipboyRootNif() const;
static void detachReplacedPipboyRootNif();
void checkTurningOnByButton();
bool checkAttaboyActivation();
void checkTurningOffByButton();
void checkTurningOnByLookingAt();
void checkTurningOffByLookingAway();
static void storeLastPipboyPage();
void holdPipboyScreenInPlace(RE::NiAVObject* pipboyScreen);
void dampenPipboyScreen();
void dampenPipboyScreenMovement(RE::NiAVObject* pipboyScreen);
bool isPlayerLookingAtPipboy() const;
void leftHandedModePipboy() const;
RE::NiNode* getPipboyModelOnArmNode() const;
Skeleton* _skelly;
Flashlight _flashlight;
PipboyPhysicalHandler _physicalHandler;
bool _isOpen = false;
bool _attaboyGrabHapticActivated = false;
// see exitPowerArmorBugFixHack method
bool _exitPowerArmorFixFirstFrame = true;
// handle auto open/close
uint64_t _startedLookingAtPip = 0;
uint64_t _lastLookingAtPip = 0;
// handle dampening of pipboy screen to reduce movement
std::deque<RE::NiPoint3> _pipboyScreenPrevFrame;
RE::NiTransform _pipboyScreenStableFrame;
// Fallout London VR Attaboy handling of grabbing from the belt
RE::NiNode* _attaboyOnBeltNode;
// static field to preserve the last pipboy page when existing PA
inline static PipboyPage _lastPipboyPage = PipboyPage::STATUS;
// used to restore the original Pipboy if settings change from on-wrist Pipboy to other
inline static RE::NiNode* _originalPipboyRootNifOnlyNode = nullptr;
inline static RE::NiNode* _newPipboyRootNifOnlyNode = nullptr;
};
}