CommonLibVR
Loading...
Searching...
No Matches
WorldSpaceMenu.h
Go to the documentation of this file.
1#pragma once
2
3#ifdef SKYRIMVR
4
5# include "RE/B/BSTEvent.h"
6# include "RE/I/IMenu.h"
7# include "RE/N/NiNode.h"
8
9namespace RE
10{
11 class HudModeChangeEvent;
12
13 // Used in a global array, which is processed every MAIN_DRAW
14 // Cleared after each MAIN_DRAW
15 struct QueuedMenuNodeUpdate
16 {
17 public:
18 // members
19 RE::NiNode* menuNode; // 00 - set to WorldSpaceMenu->unk48
20 bool hideMenu; // 08 - false also unhides the menu if its already hidden
21 uint32_t unk0C; // 0C
22 uint32_t unk10; // 10 - set to WorldSpaceMenu->unk30, applied somehow to every child in the menunode
23 uint32_t unk14; // 14
24 };
25 static_assert(sizeof(QueuedMenuNodeUpdate) == 0x18);
26
27 // menuDepth = 4
28 // context = 22
29 class WorldSpaceMenu :
30 public IMenu, // 00
31 public BSTEventSink<HudModeChangeEvent> // 40
32 {
33 public:
34 inline static constexpr auto RTTI = RTTI_WorldSpaceMenu;
35
36 WorldSpaceMenu(bool a_registerHudModeChangeEvent, bool a_matchAsTopMenu, bool a_queueUpdateFixup);
37
38 ~WorldSpaceMenu() override; // 00
39
40 // override
41 virtual void PostCreate() override; // 02
42 virtual UI_MESSAGE_RESULTS ProcessMessage(UIMessage& a_message) override; // 04
43 virtual void Unk_09(UI_MENU_Unk09 a_unk) override; // 09
44
45 // add
46 virtual void SetupMenuNode(); // 0B - Sets up menuNode
47 virtual RE::NiNode* GetMenuParentNode() = 0; // 0C - purecall, menuNode is attached to this in PostCreate()
48 virtual void SetTransform() = 0; // 0D - purecall, set rotation,translation, etc. called in PostCreate()
49
50 bool MessageMatchesMenu(RE::UIMessage* a_message);
51
52 void SetupMenuNodeWithNif(const char* nif, bool unk);
53
54 // members
55 RE::NiPointer<RE::NiNode> menuNode; // 48 - Created automatically in SetupMenuNode()
56 bool registerForHudModeChangeEvent; // 50 - Set/Used in WorldSpaceMenu constructor
57 bool matchAsTopMenu{ false }; // 51 - Only used when calling MessageMatchesMenu so far
58 bool queueUpdateFixup{ false }; // 52 - Update menuNode immediately, or on next MAIN_DRAW when calling Unk_09
59 std::uint8_t pad53{ 0 };
60 std::uint32_t pad54{ 0 };
61
62 private:
64 };
65 static_assert(sizeof(WorldSpaceMenu) == 0x58);
66}
67
68#endif
#define KEEP_FOR_RE()
Definition PCH.h:517
Definition NiNode.h:12
Definition NiSmartPointer.h:9
Definition UIMessage.h:28
Definition AbsorbEffect.h:6
UI_MESSAGE_RESULTS
Definition IMenu.h:49
constexpr REL::Offset RTTI_WorldSpaceMenu(0x01EFE318)