CommonLibSSE NG
Console.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/B/BSPointerHandle.h"
4 #include "RE/I/IMenu.h"
5 #include "RE/N/NiSmartPointer.h"
6 
7 namespace RE
8 {
9  class TESObjectREFR;
10 
11  // menuDepth = 12
12  // flags = kPausesGame | kAlwaysOpen | kUsesCursor | kAllowSaving
13  // context = kConsole
14  class Console : public IMenu
15  {
16  public:
17  inline static constexpr auto RTTI = RTTI_Console;
18  constexpr static std::string_view MENU_NAME = "Console";
19 
21  {
22 #define EXTENDED_CONSOLE_DATA_CONTENT \
23 private: \
24  [[maybe_unused]] std::uint32_t pad48; /* 48 */ \
25  [[maybe_unused]] std::uint8_t pad4c; /* 4c */ \
26 public: \
27  bool showAchievementWarning; /* 4d -- only used in ctor */ \
28  bool ctrlKeyHeld; /* 4e */ \
29  std::uint8_t pad4f; /* 4f */
30 
32  };
33 
34  struct RUNTIME_DATA
35  {
36 #define RUNTIME_DATA_CONTENT \
37  void* opcode; /* 00 */ \
38  std::uint64_t unk38; /* 08 */ \
39  std::uint64_t unk40; /* 10 */
40 
42  };
43 
45  {
46 #define RUNTIME_DATA_CONTENT2 \
47  std::uint64_t unk48; /* 18 */ \
48  std::uint64_t unk50; /* 20 */
49 
51  };
52 
53  ~Console() override; // 00
54 
55  // override (IMenu)
56  void Accept(CallbackProcessor* a_processor) override; // 01
57  UI_MESSAGE_RESULTS ProcessMessage(UIMessage& a_message) override; // 04
58 
61 
65 
66  [[nodiscard]] inline RUNTIME_DATA& GetRuntimeData() noexcept
67  {
68  return REL::RelocateMember<RUNTIME_DATA>(this, 0x30, 0x40);
69  }
70 
71  [[nodiscard]] inline const RUNTIME_DATA& GetRuntimeData() const noexcept
72  {
73  return REL::RelocateMember<RUNTIME_DATA>(this, 0x30, 0x40);
74  }
75 
76  [[nodiscard]] inline RUNTIME_DATA2& GetRuntimeData2() noexcept
77  {
78  return REL::RelocateMember<RUNTIME_DATA2>(this, 0x48, 0x60);
79  }
80 
81  [[nodiscard]] inline const RUNTIME_DATA2& GetRuntimeData2() const noexcept
82  {
83  return REL::RelocateMember<RUNTIME_DATA2>(this, 0x48, 0x60);
84  }
85 
86  [[nodiscard]] inline EXTENDED_CONSOLE_DATA* TryGetExtendedConsoleData() noexcept
87  {
88  if (REL::Module::IsAE()) {
89  return nullptr;
90  }
91  return &REL::RelocateMember<EXTENDED_CONSOLE_DATA>(this, 0, 0x58);
92  }
93 
94  [[nodiscard]] inline const EXTENDED_CONSOLE_DATA* TryGetExtendedConsoleData() const noexcept
95  {
96  if (REL::Module::IsAE()) {
97  return nullptr;
98  }
99  return &REL::RelocateMember<EXTENDED_CONSOLE_DATA>(this, 0, 0x58);
100  }
101 
102  // members
103 #ifndef SKYRIM_CROSS_VR
107 #endif
108 
109  protected:
110  void
112  };
113 }
114 #undef RUNTIME_DATA_CONTENT
115 #undef RUNTIME_DATA_CONTENT2
116 #undef EXTENDED_CONSOLE_DATA_CONTENT
#define RUNTIME_DATA_CONTENT2
Definition: Console.h:46
#define RUNTIME_DATA_CONTENT
Definition: Console.h:36
#define EXTENDED_CONSOLE_DATA_CONTENT
Definition: Console.h:22
static SKYRIM_REL bool IsAE() noexcept
Definition: Module.h:238
Definition: Console.h:15
const RUNTIME_DATA2 & GetRuntimeData2() const noexcept
Definition: Console.h:81
void SetSelectedRef_Impl(ObjectRefHandle &a_handle)
const RUNTIME_DATA & GetRuntimeData() const noexcept
Definition: Console.h:71
static constexpr auto RTTI
Definition: Console.h:17
RUNTIME_DATA & GetRuntimeData() noexcept
Definition: Console.h:66
RUNTIME_DATA2 & GetRuntimeData2() noexcept
Definition: Console.h:76
const EXTENDED_CONSOLE_DATA * TryGetExtendedConsoleData() const noexcept
Definition: Console.h:94
void Accept(CallbackProcessor *a_processor) override
static ObjectRefHandle GetSelectedRefHandle()
void SetSelectedRef(ObjectRefHandle a_handle)
constexpr static std::string_view MENU_NAME
Definition: Console.h:18
EXTENDED_CONSOLE_DATA * TryGetExtendedConsoleData() noexcept
Definition: Console.h:86
static NiPointer< TESObjectREFR > GetSelectedRef()
~Console() override
void SetSelectedRef(NiPointer< TESObjectREFR > a_refPtr)
void SetSelectedRef(TESObjectREFR *a_ref)
UI_MESSAGE_RESULTS ProcessMessage(UIMessage &a_message) override
Definition: FxDelegateHandler.h:19
Definition: IMenu.h:55
Definition: NiSmartPointer.h:9
Definition: TESObjectREFR.h:113
Definition: UIMessage.h:28
Definition: AbsorbEffect.h:6
constexpr REL::VariantID RTTI_Console(688803, 396655, 0x1f46028)
UI_MESSAGE_RESULTS
Definition: IMenu.h:48
Definition: Console.h:21
Definition: Console.h:45
Definition: Console.h:35