CommonLibSSE NG
LockpickingMenu.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/B/BSSoundHandle.h"
4 #include "RE/B/BSTEvent.h"
5 #include "RE/I/IMenu.h"
7 #include "RE/N/NiMatrix3.h"
8 #include "RE/N/NiPoint3.h"
9 
10 namespace RE
11 {
12  class MenuOpenCloseEvent;
13  class NiAVObject;
14  class NiControllerManager;
15  class NiControllerSequence;
16  class TESObjectREFR;
17 
18  // menuDepth = 3
19  // flags = kPausesGame | kDisablePauseMenu | kRequiresUpdate
20  // context = kLockpicking
22  public IMenu, // 00
23 #ifndef SKYRIM_CROSS_VR
24  public MenuEventHandler, // 30
25  public BSTEventSink<MenuOpenCloseEvent> // 40
26 #else
27  public MenuEventHandler // 30
28 #endif
29  {
30  public:
31  inline static constexpr auto RTTI = RTTI_LockpickingMenu;
32  inline static constexpr auto VTABLE = VTABLE_LockpickingMenu;
33  constexpr static std::string_view MENU_NAME = "Lockpicking Menu";
34 
35  struct RUNTIME_DATA
36  {
37 #define RUNTIME_DATA_CONTENT \
38  void* lockpickShiv; /* 00 */ \
39  void* lockpick; /* 08 */ \
40  NiMatrix3 pickRotation; /* 10 */ \
41  NiPoint3 lockRotCenter; /* 34 */ \
42  NiControllerManager* lockController; /* 40 */ \
43  NiControllerSequence* lockIntro; /* 48 */ \
44  NiControllerSequence* lockRotate; /* 50 */ \
45  NiControllerManager* pickController; /* 58 */ \
46  NiControllerSequence* pickIntro; /* 60 */ \
47  NiControllerSequence* pickDamage; /* 68 */ \
48  NiControllerSequence* pickBreak; /* 70 */ \
49  NiControllerSequence* currentPickSequence; /* 78 */ \
50  float pickKeyTime; /* 80 */ \
51  std::uint32_t unk0CC; /* 84 */ \
52  NiControllerSequence* currentLockSequence; /* 88 */ \
53  float lockKeyTime; /* 90 */ \
54  float pickAngle; /* 94 */ \
55  float lockAngle; /* 98 */ \
56  float damagePickAngle; /* 9C */ \
57  float pickBreakSeconds; /* A0 */ \
58  BSSoundHandle pickTensionSound; /* A4 */ \
59  float unk0F8; /* B0 */ \
60  float sweetSpotAngle; /* B4 */ \
61  float partialPickAngle; /* B8 */ \
62  std::uint32_t numBrokenPicks; /* BC */ \
63  bool init3DElements; /* C0 */ \
64  bool animating; /* C1 */ \
65  bool unk10A; /* C2 */ \
66  bool menuCleared; /* C3 */ \
67  bool animationFinished; /* C4 */ \
68  bool isLockpickingCrime; /* C5 */ \
69  std::uint8_t unk10E; /* C6 */ \
70  std::uint8_t pad10F; /* C7 */
71 
73  };
74  static_assert(sizeof(RUNTIME_DATA) == 0xC8);
75 
76  ~LockpickingMenu() override; // 00
77 
78  // override (IMenu)
79  UI_MESSAGE_RESULTS ProcessMessage(UIMessage& a_message) override; // 04
80 
81 #ifndef SKYRIM_CROSS_VR
82  // override (MenuEventHandler)
83  bool CanProcess(InputEvent* a_event) override; // 01
84  bool ProcessThumbstick(ThumbstickEvent* a_event) override; // 03
85  bool ProcessMouseMove(MouseMoveEvent* a_event) override; // 04
86  bool ProcessButton(ButtonEvent* a_event) override; // 05
87 
88  // override (BSTEventSink<MenuOpenCloseEvent>)
90 #endif
91 
92  [[nodiscard]] static TESObjectREFR* GetTargetReference();
93 
94  [[nodiscard]] MenuEventHandler* AsMenuEventHandler() noexcept
95  {
96  return &REL::RelocateMember<MenuEventHandler>(this, 0x30, 0x40);
97  }
98 
99  [[nodiscard]] const MenuEventHandler* AsMenuEventHandler() const noexcept
100  {
101  return const_cast<LockpickingMenu*>(this)->AsMenuEventHandler();
102  }
103 
105  {
106  return &REL::RelocateMember<BSTEventSink<MenuOpenCloseEvent>>(this, 0x40, 0x50);
107  }
108 
109  [[nodiscard]] const BSTEventSink<MenuOpenCloseEvent>* AsMenuOpenCloseEventSink() const noexcept
110  {
111  return const_cast<LockpickingMenu*>(this)->AsMenuOpenCloseEventSink();
112  }
113 
114  [[nodiscard]] inline RUNTIME_DATA& GetRuntimeData() noexcept
115  {
116  return REL::RelocateMember<RUNTIME_DATA>(this, 0x48, 0x58);
117  }
118 
119  [[nodiscard]] inline const RUNTIME_DATA& GetRuntimeData() const noexcept
120  {
121  return REL::RelocateMember<RUNTIME_DATA>(this, 0x48, 0x58);
122  }
123 
124  // members
125 #ifndef SKYRIM_CROSS_VR
126  RUNTIME_DATA_CONTENT // 48, 58
127 #endif
128  };
129 #ifndef ENABLE_SKYRIM_VR
130  static_assert(sizeof(LockpickingMenu) == 0x110);
131 #elif !defined(ENABLE_SKYRIM_AE) && !defined(ENABLE_SKYRIM_SE)
132  static_assert(sizeof(LockpickingMenu) == 0x120);
133 #endif
134 }
135 #undef RUNTIME_DATA_CONTENT
#define RUNTIME_DATA_CONTENT
Definition: LockpickingMenu.h:37
Definition: BSTEvent.h:143
Definition: ButtonEvent.h:11
Definition: IMenu.h:55
Definition: InputEvent.h:25
Definition: LockpickingMenu.h:29
~LockpickingMenu() override
const BSTEventSink< MenuOpenCloseEvent > * AsMenuOpenCloseEventSink() const noexcept
Definition: LockpickingMenu.h:109
bool ProcessThumbstick(ThumbstickEvent *a_event) override
bool ProcessButton(ButtonEvent *a_event) override
bool CanProcess(InputEvent *a_event) override
UI_MESSAGE_RESULTS ProcessMessage(UIMessage &a_message) override
MenuEventHandler * AsMenuEventHandler() noexcept
Definition: LockpickingMenu.h:94
BSTEventSink< MenuOpenCloseEvent > * AsMenuOpenCloseEventSink() noexcept
Definition: LockpickingMenu.h:104
static TESObjectREFR * GetTargetReference()
bool ProcessMouseMove(MouseMoveEvent *a_event) override
RUNTIME_DATA & GetRuntimeData() noexcept
Definition: LockpickingMenu.h:114
BSEventNotifyControl ProcessEvent(const MenuOpenCloseEvent *a_event, BSTEventSource< MenuOpenCloseEvent > *a_eventSource) override
static constexpr auto VTABLE
Definition: LockpickingMenu.h:32
const RUNTIME_DATA & GetRuntimeData() const noexcept
Definition: LockpickingMenu.h:119
static constexpr auto RTTI
Definition: LockpickingMenu.h:31
constexpr static std::string_view MENU_NAME
Definition: LockpickingMenu.h:33
const MenuEventHandler * AsMenuEventHandler() const noexcept
Definition: LockpickingMenu.h:99
Definition: MenuEventHandler.h:14
Definition: MenuOpenCloseEvent.h:8
Definition: MouseMoveEvent.h:8
Definition: TESObjectREFR.h:113
Definition: ThumbstickEvent.h:8
Definition: UIMessage.h:28
Definition: AbsorbEffect.h:6
constexpr REL::VariantID RTTI_LockpickingMenu(688864, 396716, 0x1f46f50)
UI_MESSAGE_RESULTS
Definition: IMenu.h:48
constexpr std::array< REL::VariantID, 3 > VTABLE_LockpickingMenu
Definition: Offsets_VTABLE.h:4060
BSEventNotifyControl
Definition: BSTEvent.h:12
Definition: LockpickingMenu.h:36