CommonLibSSE NG
MagicMenu.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/G/GFxValue.h"
4 #include "RE/I/IMenu.h"
5 
6 namespace RE
7 {
8  struct BottomBar;
9  struct ItemCard;
10 
11  // menuDepth = 0
12  // flags = kPausesGame | kUsesMenuContext | kDisablePauseMenu | kUpdateUsesCursor | kInventoryItemMenu | kCustomRendering
13  // context = kItemMenu
14  class MagicMenu : public IMenu
15  {
16  public:
17  inline static constexpr auto RTTI = RTTI_MagicMenu;
18  constexpr static std::string_view MENU_NAME = "MagicMenu";
19 
20  struct RUNTIME_DATA
21  {
22 #define RUNTIME_DATA_CONTENT \
23  void* unk30; /* 00 - some variation of the item list */ \
24  ItemCard* itemCard; /* 08 */ \
25  BottomBar* bottomBar; /* 10 */ \
26  GFxValue root; /* 18 - "Menu_mc" */ \
27  bool pcControlsReady; /* 30 */ \
28  std::uint8_t pad61; /* 31 */ \
29  std::uint16_t pad62; /* 32 */ \
30  std::uint32_t pad64; /* 34 */
31 
33  };
34  static_assert(sizeof(RUNTIME_DATA) == 0x38);
35 
36  ~MagicMenu() override; // 00
37 
38  // override (IMenu)
39  void Accept(CallbackProcessor* a_processor) override; // 01
40  UI_MESSAGE_RESULTS ProcessMessage(UIMessage& a_message) override; // 04
41  void PostDisplay() override; // 06
42 
43  [[nodiscard]] inline RUNTIME_DATA& GetRuntimeData() noexcept
44  {
45  return REL::RelocateMember<RUNTIME_DATA>(this, 0x30, 0x40);
46  }
47 
48  [[nodiscard]] inline const RUNTIME_DATA& GetRuntimeData() const noexcept
49  {
50  return REL::RelocateMember<RUNTIME_DATA>(this, 0x30, 0x40);
51  }
52 
53  // members
54 #ifndef SKYRIM_CROSS_VR
55  RUNTIME_DATA_CONTENT // 30, 40
56 #endif
57  };
58 #ifndef ENABLE_SKYRIM_VR
59  static_assert(sizeof(MagicMenu) == 0x68);
60 #elif !defined(ENABLE_SKYRIM_AE) && !defined(ENABLE_SKYRIM_SE)
61  static_assert(sizeof(MagicMenu) == 0x78);
62 #endif
63 }
64 #undef RUNTIME_DATA_CONTENT
#define RUNTIME_DATA_CONTENT
Definition: MagicMenu.h:22
Definition: FxDelegateHandler.h:19
Definition: IMenu.h:55
Definition: MagicMenu.h:15
const RUNTIME_DATA & GetRuntimeData() const noexcept
Definition: MagicMenu.h:48
void Accept(CallbackProcessor *a_processor) override
constexpr static std::string_view MENU_NAME
Definition: MagicMenu.h:18
void PostDisplay() override
RUNTIME_DATA & GetRuntimeData() noexcept
Definition: MagicMenu.h:43
~MagicMenu() override
UI_MESSAGE_RESULTS ProcessMessage(UIMessage &a_message) override
static constexpr auto RTTI
Definition: MagicMenu.h:17
Definition: UIMessage.h:28
Definition: AbsorbEffect.h:6
UI_MESSAGE_RESULTS
Definition: IMenu.h:48
constexpr REL::VariantID RTTI_MagicMenu(688867, 396719, 0x1f46fd0)
Definition: MagicMenu.h:21