CommonLibSSE NG
JournalMenu.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/B/BSTEvent.h"
4 #include "RE/I/IMenu.h"
9 
10 namespace RE
11 {
12  class BSSystemEvent;
13 
14  // menuDepth = 5
15  // flags = kPausesGame | kUsesMenuContext | kFreezeFrameBackground | kRequiresUpdate | kTopmostRenderedMenu | kUpdateUsesCursor | kAllowSaving
16  // kDisablePauseMenu if game load prevented
17  // context = kJournal
18  class JournalMenu :
19  public IMenu, // 00
20 #ifndef SKYRIM_CROSS_VR
21  public MenuEventHandler, // 30
22  public BSTEventSink<BSSystemEvent> // 40
23 #else
24  public MenuEventHandler // 30
25 #endif
26  {
27  public:
28  inline static constexpr auto RTTI = RTTI_JournalMenu;
29  inline static constexpr auto VTABLE = VTABLE_JournalMenu;
30  constexpr static std::string_view MENU_NAME = "Journal Menu";
31 
32  struct RUNTIME_DATA
33  {
34 #define RUNTIME_DATA_CONTENT \
35  Journal_QuestsTab questsTab; /* 00 */ \
36  Journal_StatsTab statsTab; /* 38 */ \
37  Journal_SystemTab systemTab; /* 50 */ \
38  std::uint64_t unkD0; /* 88 */ \
39  std::uint64_t unkD8; /* 90 */ \
40  std::uint64_t unkE0; /* 98 */
41 
43  };
44  static_assert(sizeof(RUNTIME_DATA) == 0xA0);
45 
46  ~JournalMenu() override; // 00
47 
48  // override (IMenu)
49  void Accept(CallbackProcessor* a_processor) override; // 01
50  UI_MESSAGE_RESULTS ProcessMessage(UIMessage& a_message) override; // 04
51  void AdvanceMovie(float a_interval, std::uint32_t a_currentTime) override; // 05
52  void PostDisplay() override; // 06
53 
54 #ifndef SKYRIM_CROSS_VR
55  // override (MenuEventHandler)
56  bool CanProcess(InputEvent* a_event) override; // 01
57  bool ProcessThumbstick(ThumbstickEvent* a_event) override; // 03
58 
59  // override (BSTEventSink<BSSystemEvent>)
60  BSEventNotifyControl ProcessEvent(const BSSystemEvent* a_event, BSTEventSource<BSSystemEvent>* a_eventSource) override; // 01
61 #endif
62 
63  [[nodiscard]] MenuEventHandler* AsMenuEventHandler() noexcept
64  {
65  return &REL::RelocateMember<MenuEventHandler>(this, 0x30, 0x40);
66  }
67 
68  [[nodiscard]] const MenuEventHandler* AsMenuEventHandler() const noexcept
69  {
70  return const_cast<JournalMenu*>(this)->AsMenuEventHandler();
71  }
72 
74  {
75  return &REL::RelocateMember<BSTEventSink<BSSystemEvent>>(this, 0x40, 0x50);
76  }
77 
78  [[nodiscard]] const BSTEventSink<BSSystemEvent>* AsBSSystemEventSink() const noexcept
79  {
80  return const_cast<JournalMenu*>(this)->AsBSSystemEventSink();
81  }
82 
83  [[nodiscard]] inline RUNTIME_DATA& GetRuntimeData() noexcept
84  {
85  return REL::RelocateMember<RUNTIME_DATA>(this, 0x48, 0x58);
86  }
87 
88  [[nodiscard]] inline const RUNTIME_DATA& GetRuntimeData() const noexcept
89  {
90  return REL::RelocateMember<RUNTIME_DATA>(this, 0x48, 0x58);
91  }
92 
93  // members
94 #ifndef SKYRIM_CROSS_VR
95  RUNTIME_DATA_CONTENT // 48, 58
96 #endif
97  };
98 #ifndef ENABLE_SKYRIM_VR
99  static_assert(sizeof(JournalMenu) == 0xE8);
100 #elif !defined(ENABLE_SKYRIM_AE) && !defined(ENABLE_SKYRIM_SE)
101  static_assert(sizeof(JournalMenu) == 0xF8);
102 #endif
103 }
104 #undef RUNTIME_DATA_CONTENT
#define RUNTIME_DATA_CONTENT
Definition: JournalMenu.h:34
Definition: BSTEvent.h:143
Definition: BSTEvent.h:19
Definition: FxDelegateHandler.h:19
Definition: IMenu.h:55
Definition: InputEvent.h:25
Definition: JournalMenu.h:26
UI_MESSAGE_RESULTS ProcessMessage(UIMessage &a_message) override
BSTEventSink< BSSystemEvent > * AsBSSystemEventSink() noexcept
Definition: JournalMenu.h:73
void AdvanceMovie(float a_interval, std::uint32_t a_currentTime) override
const RUNTIME_DATA & GetRuntimeData() const noexcept
Definition: JournalMenu.h:88
~JournalMenu() override
MenuEventHandler * AsMenuEventHandler() noexcept
Definition: JournalMenu.h:63
const MenuEventHandler * AsMenuEventHandler() const noexcept
Definition: JournalMenu.h:68
bool ProcessThumbstick(ThumbstickEvent *a_event) override
constexpr static std::string_view MENU_NAME
Definition: JournalMenu.h:30
static constexpr auto RTTI
Definition: JournalMenu.h:28
BSEventNotifyControl ProcessEvent(const BSSystemEvent *a_event, BSTEventSource< BSSystemEvent > *a_eventSource) override
RUNTIME_DATA & GetRuntimeData() noexcept
Definition: JournalMenu.h:83
bool CanProcess(InputEvent *a_event) override
static constexpr auto VTABLE
Definition: JournalMenu.h:29
void PostDisplay() override
void Accept(CallbackProcessor *a_processor) override
const BSTEventSink< BSSystemEvent > * AsBSSystemEventSink() const noexcept
Definition: JournalMenu.h:78
Definition: MenuEventHandler.h:14
Definition: ThumbstickEvent.h:8
Definition: UIMessage.h:28
Definition: AbsorbEffect.h:6
UI_MESSAGE_RESULTS
Definition: IMenu.h:48
constexpr std::array< REL::VariantID, 3 > VTABLE_JournalMenu
Definition: Offsets_VTABLE.h:4193
constexpr REL::VariantID RTTI_JournalMenu(689011, 396866, 0x1f49738)
BSEventNotifyControl
Definition: BSTEvent.h:12
Definition: JournalMenu.h:33