CommonLibSSE NG
ContainerMenu.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/B/BSTArray.h"
4 #include "RE/G/GFxValue.h"
5 #include "RE/I/IMenu.h"
6 
7 namespace RE
8 {
9  struct BottomBar;
10  struct ItemCard;
11  struct ItemList;
12 
13  // menuDepth = 0
14  // flags = kPausesGame | kUsesMenuContext | kDisablePauseMenu | kUpdateUsesCursor | kInventoryItemMenu | kCustomRendering
15  // context = kItemMenu
16  class ContainerMenu : public IMenu
17  {
18  public:
19  inline static constexpr auto RTTI = RTTI_ContainerMenu;
20  constexpr static std::string_view MENU_NAME = "ContainerMenu";
21 
22  enum class ContainerMode : std::uint32_t
23  {
24  kLoot = 0,
25  kSteal = 1,
26  kPickpocket = 2,
27  kNPCMode = 3
28  };
29 
30  struct RUNTIME_DATA
31  {
32 #define RUNTIME_DATA_CONTENT \
33  GFxValue root; /* 00 - "Menu_mc" */ \
34  ItemList* itemList; /* 18 */ \
35  ItemCard* itemCard; /* 20 */ \
36  BottomBar* bottomBar; /* 28 */ \
37  BSTArray<void*> unk60; /* 30 */ \
38  BSTArray<void*> unk78; /* 48 */ \
39  std::uint64_t unk90; /* 60 */ \
40  std::uint64_t unk98; /* 68 */ \
41  std::uint64_t unkA0; /* 70 */ \
42  std::uint8_t unkA8; /* 78 */ \
43  std::uint8_t padA9; /* 79 */ \
44  std::uint16_t padAA; /* 7A */ \
45  std::uint32_t padAC; /* 7C */ \
46  std::int32_t value; /* 80 */ \
47  std::uint32_t unkB4; /* 84 */ \
48  std::uint8_t unkB8; /* 88 */ \
49  bool pcControlsReady; /* 89 */ \
50  std::uint16_t padBA; /* 8A */ \
51  std::uint32_t padBC; /* 8C */
52 
54  };
55  static_assert(sizeof(RUNTIME_DATA) == 0x90);
56 
57  ~ContainerMenu() override; // 00
58 
59  // override (IMenu)
60  void Accept(CallbackProcessor* a_processor) override; // 01
61  UI_MESSAGE_RESULTS ProcessMessage(UIMessage& a_message) override; // 04
62  void PostDisplay() override; // 06
63 
65  [[nodiscard]] static RefHandle GetTargetRefHandle();
66 
67  [[nodiscard]] GFxValue GetRoot() const noexcept;
68  [[nodiscard]] ItemList* GetItemList() const noexcept;
69 
70  [[nodiscard]] inline RUNTIME_DATA& GetRuntimeData() noexcept
71  {
72  return REL::RelocateMember<RUNTIME_DATA>(this, 0x30, 0x40);
73  }
74 
75  [[nodiscard]] inline const RUNTIME_DATA& GetRuntimeData() const noexcept
76  {
77  return REL::RelocateMember<RUNTIME_DATA>(this, 0x30, 0x40);
78  }
79 
80  // members
81 #ifndef SKYRIM_CROSS_VR
82  RUNTIME_DATA_CONTENT // 30, 40
83 #endif
84  };
85 #ifndef ENABLE_SKYRIM_VR
86  static_assert(sizeof(ContainerMenu) == 0xC0);
87 #elif !defined(ENABLE_SKYRIM_AE) && !defined(ENABLE_SKYRIM_SE)
88  static_assert(sizeof(ContainerMenu) == 0xD0);
89 #endif
90 }
91 #undef RUNTIME_DATA_CONTENT
#define RUNTIME_DATA_CONTENT
Definition: ContainerMenu.h:32
Definition: ContainerMenu.h:17
void PostDisplay() override
ContainerMode
Definition: ContainerMenu.h:23
ItemList * GetItemList() const noexcept
ContainerMode GetContainerMode()
constexpr static std::string_view MENU_NAME
Definition: ContainerMenu.h:20
static RefHandle GetTargetRefHandle()
UI_MESSAGE_RESULTS ProcessMessage(UIMessage &a_message) override
static constexpr auto RTTI
Definition: ContainerMenu.h:19
~ContainerMenu() override
GFxValue GetRoot() const noexcept
void Accept(CallbackProcessor *a_processor) override
const RUNTIME_DATA & GetRuntimeData() const noexcept
Definition: ContainerMenu.h:75
RUNTIME_DATA & GetRuntimeData() noexcept
Definition: ContainerMenu.h:70
Definition: FxDelegateHandler.h:19
Definition: GFxValue.h:92
Definition: IMenu.h:55
Definition: UIMessage.h:28
Definition: AbsorbEffect.h:6
UI_MESSAGE_RESULTS
Definition: IMenu.h:48
constexpr REL::VariantID RTTI_ContainerMenu(688806, 396658, 0x1f460b0)
std::uint32_t RefHandle
Definition: BSCoreTypes.h:6
Definition: ContainerMenu.h:31
Definition: ItemList.h:14