CommonLibVR
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"
7#ifdef SKYRIMVR
8# include "RE/W/WorldSpaceMenu.h"
9#endif
10
11namespace RE
12{
13 class ActorValueMeter;
14 class HUDObject;
15 class ShoutMeter;
16 class UserEventEnabledEvent;
17 struct BSRemoteGamepadEvent;
18
19#ifndef SKYRIMVR
20 // menuDepth = 2
21 // flags = kAlwaysOpen | kRequiresUpdate | kAllowSaving | kCustomRendering | kAssignCursorToRenderer
22 // context = kNone
23 class HUDMenu :
24 public IMenu, // 00
25 public BSTEventSink<UserEventEnabledEvent>, // 30
26 public BSTEventSink<BSRemoteGamepadEvent> // 38
27 {
28 public:
29 inline static constexpr auto RTTI = RTTI_HUDMenu;
30 inline static constexpr auto VTABLE = VTABLE_HUDMenu;
31 constexpr static std::string_view MENU_NAME = "HUD Menu";
32
33 ~HUDMenu() override; // 00
34
35 // override (IMenu)
36 void Accept(CallbackProcessor* a_processor) override; // 01
37 UI_MESSAGE_RESULTS ProcessMessage(UIMessage& a_message) override; // 04
38 void AdvanceMovie(float a_interval, std::uint32_t a_currentTime) override; // 05
39 void RefreshPlatform() override; // 08
40
41 // override (BSTEventSink<UserEventEnabledEvent>)
42 BSEventNotifyControl ProcessEvent(const UserEventEnabledEvent* a_event, BSTEventSource<UserEventEnabledEvent>* a_eventSource) override; // 01
43
44 // override (BSTEventSink<BSRemoteGamepadEvent>)
45 BSEventNotifyControl ProcessEvent(const BSRemoteGamepadEvent* a_event, BSTEventSource<BSRemoteGamepadEvent>* a_eventSource) override; // 01
46
47 static void FlashMeter(ActorValue a_actorValue)
48 {
49 using func_t = decltype(&HUDMenu::FlashMeter);
50 static REL::Relocation<func_t> func{ RELOCATION_ID(51907, 52845) };
51 return func(a_actorValue);
52 }
53
54 static void UpdateCrosshairMagicTarget(bool a_valid)
55 {
56 using func_t = decltype(&HUDMenu::UpdateCrosshairMagicTarget);
57 static REL::Relocation<func_t> func{ RELOCATION_ID(50738, 51633) };
58 return func(a_valid);
59 }
60
61 // members
67 GFxValue root; // 78 - kDisplayObject - "_level0.HUDMovieBaseInstance"
68 std::uint64_t unk90; // 90
69 private:
71 };
72 static_assert(sizeof(HUDMenu) == 0x98);
73#else
74 class HUDMenu :
75 public WorldSpaceMenu, // 00
76 public BSTEventSink<UserEventEnabledEvent>, // 58
77 public BSTEventSink<BSRemoteGamepadEvent> // 60
78 {
79 public:
80 inline static constexpr auto RTTI = RTTI_HUDMenu;
81 constexpr static std::string_view MENU_NAME = "HUD Menu";
82
83 ~HUDMenu() override; // 00
84
85 // override (IMenu)
86 void Accept(CallbackProcessor* a_processor) override; // 01
87 UI_MESSAGE_RESULTS ProcessMessage(UIMessage& a_message) override; // 04
88 void AdvanceMovie(float a_interval, std::uint32_t a_currentTime) override; // 05
89 void RefreshPlatform() override; // 08
90
91 // override (WorldSpaceMenu)
92 void SetupMenuNode() override; // 0B
93 RE::NiNode* GetMenuParentNode() override; // 0C
94 void SetTransform() override; // 0D
95
96 // override (BSTEventSink<HudModeChangeEvent>)
97 BSEventNotifyControl ProcessEvent(const HudModeChangeEvent* a_event, BSTEventSource<HudModeChangeEvent>* a_eventSource) override; // 01
98
99 // override (BSTEventSink<UserEventEnabledEvent>)
100 BSEventNotifyControl ProcessEvent(const UserEventEnabledEvent* a_event, BSTEventSource<UserEventEnabledEvent>* a_eventSource) override; // 01
101
102 // override (BSTEventSink<BSRemoteGamepadEvent>)
103 BSEventNotifyControl ProcessEvent(const BSRemoteGamepadEvent* a_event, BSTEventSource<BSRemoteGamepadEvent>* a_eventSource) override; // 01
104
105 static void FlashMeter(ActorValue a_actorValue)
106 {
107 using func_t = decltype(&HUDMenu::FlashMeter);
108 static REL::Relocation<func_t> func{ RELOCATION_ID(51907, 52845) };
109 return func(a_actorValue);
110 }
111
112 static void UpdateCrosshairMagicTarget(bool a_valid)
113 {
114 using func_t = decltype(&HUDMenu::UpdateCrosshairMagicTarget);
115 static REL::Relocation<func_t> func{ RELOCATION_ID(50738, 51633) };
116 return func(a_valid);
117 }
118
119 // members
120 std::uint64_t pad68; // 68
121 BSTArray<HUDObject*> objects; // 70
122 ActorValueMeter* health; // 88
123 ActorValueMeter* stamina; // 90
124 ActorValueMeter* magicka; // 98
125 ShoutMeter* shout; // A0
126 GFxValue root; // A8 - kDisplayObject - "_level0.HUDMovieBaseInstance"
127 std::uint64_t unk90; // C0
128 private:
130 };
131 static_assert(sizeof(HUDMenu) == 0xC8);
132#endif
133}
#define KEEP_FOR_RE()
Definition PCH.h:517
#define RELOCATION_ID(SE, AE)
Definition PCH.h:506
Definition Relocation.h:210
Definition ActorValueMeter.h:9
Definition BSTArray.h:378
Definition BSTEvent.h:143
Definition BSTEvent.h:19
Definition FxDelegateHandler.h:20
Definition GFxValue.h:92
Definition HUDMenu.h:27
~HUDMenu() override
ActorValueMeter * magicka
Definition HUDMenu.h:65
BSTArray< HUDObject * > objects
Definition HUDMenu.h:62
BSEventNotifyControl ProcessEvent(const UserEventEnabledEvent *a_event, BSTEventSource< UserEventEnabledEvent > *a_eventSource) override
UI_MESSAGE_RESULTS ProcessMessage(UIMessage &a_message) override
ShoutMeter * shout
Definition HUDMenu.h:66
static void UpdateCrosshairMagicTarget(bool a_valid)
Definition HUDMenu.h:54
static constexpr auto VTABLE
Definition HUDMenu.h:30
GFxValue root
Definition HUDMenu.h:67
void RefreshPlatform() override
void Accept(CallbackProcessor *a_processor) override
std::uint64_t unk90
Definition HUDMenu.h:68
void AdvanceMovie(float a_interval, std::uint32_t a_currentTime) override
static void FlashMeter(ActorValue a_actorValue)
Definition HUDMenu.h:47
static constexpr std::string_view MENU_NAME
Definition HUDMenu.h:31
ActorValueMeter * stamina
Definition HUDMenu.h:64
ActorValueMeter * health
Definition HUDMenu.h:63
static constexpr auto RTTI
Definition HUDMenu.h:29
BSEventNotifyControl ProcessEvent(const BSRemoteGamepadEvent *a_event, BSTEventSource< BSRemoteGamepadEvent > *a_eventSource) override
Definition IMenu.h:64
Definition NiNode.h:12
Definition ShoutMeter.h:8
Definition UIMessage.h:28
Definition AbsorbEffect.h:6
constexpr REL::ID RTTI_HUDMenu(static_cast< std::uint64_t >(688836))
ActorValue
Definition ActorValues.h:6
UI_MESSAGE_RESULTS
Definition IMenu.h:49
constexpr std::array< REL::ID, 3 > VTABLE_HUDMenu
Definition Offsets_VTABLE.h:11733
BSEventNotifyControl
Definition BSTEvent.h:12