CommonLibSSE NG
Loading...
Searching...
No Matches
HUDMenu.h
Go to the documentation of this file.
1#pragma once
2
3#include "RE/B/BSTArray.h"
4#include "RE/B/BSTEvent.h"
5#include "RE/G/GFxValue.h"
6#include "RE/I/IMenu.h"
8
9namespace RE
10{
11 class ActorValueMeter;
12 class HudModeChangeEvent;
13 class HUDObject;
14 class ShoutMeter;
15 class UserEventEnabledEvent;
16 struct BSRemoteGamepadEvent;
17
18 // menuDepth = 2
19 // flags = kAlwaysOpen | kRequiresUpdate | kAllowSaving | kCustomRendering | kAssignCursorToRenderer
20 // context = kNone
21 class HUDMenu :
22#if !defined(ENABLE_SKYRIM_AE) && !defined(ENABLE_SKYRIM_SE)
23 public WorldSpaceMenu, // 00
24 public BSTEventSink<UserEventEnabledEvent>, // 58
25 public BSTEventSink<BSRemoteGamepadEvent> // 60
26#elif !defined(ENABLE_SKYRIM_VR)
27 public IMenu, // 00
28 public BSTEventSink<UserEventEnabledEvent>, // 30
29 public BSTEventSink<BSRemoteGamepadEvent> // 38
30#else
31 public IMenu // 00
32#endif
33 {
34 public:
35 inline static constexpr auto RTTI = RTTI_HUDMenu;
36 inline static constexpr auto VTABLE = VTABLE_HUDMenu;
37 constexpr static std::string_view MENU_NAME = "HUD Menu";
38
40 {
41#define RUNTIME_DATA_CONTENT \
42 BSTArray<HUDObject*> objects; /* 00 */ \
43 ActorValueMeter* health; /* 18 */ \
44 ActorValueMeter* stamina; /* 20 */ \
45 ActorValueMeter* magicka; /* 28 */ \
46 ShoutMeter* shout; /* 30 */ \
47 GFxValue root; /* 38 - kDisplayObject - "_level0.HUDMovieBaseInstance" */ \
48 std::uint64_t unk90; /* 50 */
49
51 };
52
53 ~HUDMenu() override; // 00
54
55 // override (IMenu)
56 void Accept(CallbackProcessor* a_processor) override; // 01
57 UI_MESSAGE_RESULTS ProcessMessage(UIMessage& a_message) override; // 04
58 void AdvanceMovie(float a_interval, std::uint32_t a_currentTime) override; // 05
59 void RefreshPlatform() override; // 08
60
61#ifndef SKYRIM_CROSS_VR
62 // override (BSTEventSink<UserEventEnabledEvent>)
63 BSEventNotifyControl ProcessEvent(const UserEventEnabledEvent* a_event, BSTEventSource<UserEventEnabledEvent>* a_eventSource) override; // 01
64
65 // override (BSTEventSink<BSRemoteGamepadEvent>)
66 BSEventNotifyControl ProcessEvent(const BSRemoteGamepadEvent* a_event, BSTEventSource<BSRemoteGamepadEvent>* a_eventSource) override; // 01
67#endif
68
69 [[nodiscard]] WorldSpaceMenu* AsWorldSpaceMenu() noexcept
70 {
72 return nullptr;
73 }
74 return &REL::RelocateMember<WorldSpaceMenu>(this, 0, 0);
75 }
76
77 [[nodiscard]] const WorldSpaceMenu* AsWorldSpaceMenu() const noexcept
78 {
79 return const_cast<HUDMenu*>(this)->AsWorldSpaceMenu();
80 }
81
83 {
84 return &REL::RelocateMember<BSTEventSink<UserEventEnabledEvent>>(this, 0x30, 0x58);
85 }
86
88 {
89 return const_cast<HUDMenu*>(this)->AsUserEventEnabledEventSink();
90 }
91
93 {
94 return &REL::RelocateMember<BSTEventSink<BSRemoteGamepadEvent>>(this, 0x38, 0x60);
95 }
96
98 {
99 return const_cast<HUDMenu*>(this)->AsBSRemoteGamepadEventSink();
100 }
101
102 [[nodiscard]] inline RUNTIME_DATA& GetRuntimeData() noexcept
103 {
104 return REL::RelocateMember<RUNTIME_DATA>(this, 0x40, 0x70);
105 }
106
107 [[nodiscard]] inline const RUNTIME_DATA& GetRuntimeData() const noexcept
108 {
109 return REL::RelocateMember<RUNTIME_DATA>(this, 0x40, 0x70);
110 }
111
112 static void UpdateCrosshairMagicTarget(bool a_valid)
113 {
114 using func_t = decltype(&HUDMenu::UpdateCrosshairMagicTarget);
115 REL::Relocation<func_t> func{ RELOCATION_ID(50738, 51633) };
116 return func(a_valid);
117 }
118
119 // members
120#ifndef SKYRIM_CROSS_VR
121# if !defined(ENABLE_SKYRIM_AE) && !defined(ENABLE_SKYRIM_SE)
122 std::uint64_t pad68; // 68
123# endif
124 RUNTIME_DATA_CONTENT // 40, 70
125#endif
126 };
127#ifndef ENABLE_SKYRIM_VR
128 static_assert(sizeof(HUDMenu) == 0x98);
129#elif !defined(ENABLE_SKYRIM_AE) && !defined(ENABLE_SKYRIM_SE)
130 static_assert(sizeof(HUDMenu) == 0xC8);
131#endif
132}
133#undef RUNTIME_DATA_CONTENT
#define RUNTIME_DATA_CONTENT
Definition Actor.h:633
#define RELOCATION_ID(a_se, a_ae)
Definition PCH.h:794
#define SKYRIM_REL_CONSTEXPR
Definition Relocation.h:105
Definition BSTEvent.h:143
Definition BSTEvent.h:19
Definition FxDelegateHandler.h:19
Definition HUDMenu.h:33
~HUDMenu() override
const BSTEventSink< BSRemoteGamepadEvent > * AsBSRemoteGamepadEventSink() const noexcept
Definition HUDMenu.h:97
BSEventNotifyControl ProcessEvent(const UserEventEnabledEvent *a_event, BSTEventSource< UserEventEnabledEvent > *a_eventSource) override
UI_MESSAGE_RESULTS ProcessMessage(UIMessage &a_message) override
RUNTIME_DATA & GetRuntimeData() noexcept
Definition HUDMenu.h:102
static void UpdateCrosshairMagicTarget(bool a_valid)
Definition HUDMenu.h:112
std::uint64_t pad68
Definition HUDMenu.h:122
static constexpr auto VTABLE
Definition HUDMenu.h:36
const BSTEventSink< UserEventEnabledEvent > * AsUserEventEnabledEventSink() const noexcept
Definition HUDMenu.h:87
void RefreshPlatform() override
WorldSpaceMenu * AsWorldSpaceMenu() noexcept
Definition HUDMenu.h:69
void Accept(CallbackProcessor *a_processor) override
const WorldSpaceMenu * AsWorldSpaceMenu() const noexcept
Definition HUDMenu.h:77
void AdvanceMovie(float a_interval, std::uint32_t a_currentTime) override
static constexpr std::string_view MENU_NAME
Definition HUDMenu.h:37
BSTEventSink< BSRemoteGamepadEvent > * AsBSRemoteGamepadEventSink() noexcept
Definition HUDMenu.h:92
BSTEventSink< UserEventEnabledEvent > * AsUserEventEnabledEventSink() noexcept
Definition HUDMenu.h:82
static constexpr auto RTTI
Definition HUDMenu.h:35
BSEventNotifyControl ProcessEvent(const BSRemoteGamepadEvent *a_event, BSTEventSource< BSRemoteGamepadEvent > *a_eventSource) override
const RUNTIME_DATA & GetRuntimeData() const noexcept
Definition HUDMenu.h:107
Definition IMenu.h:55
Definition UIMessage.h:28
Definition WorldSpaceMenu.h:19
static SKYRIM_REL_VR bool IsVR() noexcept
Definition Relocation.h:821
Definition Relocation.h:1638
Definition AbsorbEffect.h:6
UI_MESSAGE_RESULTS
Definition IMenu.h:48
constexpr REL::VariantID RTTI_HUDMenu(688836, 396688, 0x1f46818)
BSEventNotifyControl
Definition BSTEvent.h:12
constexpr std::array< REL::VariantID, 4 > VTABLE_HUDMenu
Definition Offsets_VTABLE.h:4038
Definition HUDMenu.h:40