CommonLibSSE NG
StatsMenu.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/A/ActorValues.h"
4 #include "RE/B/BSTArray.h"
5 #include "RE/G/GFxValue.h"
6 #include "RE/I/IMenu.h"
8 #include "RE/N/NiPoint3.h"
9 
10 namespace RE
11 {
12  class BSEffectShaderProperty;
13  class BSFadeNode;
14  class BSScaleformMovieLoadTask;
15  class NiCamera;
16  class NiControllerManager;
17  class NiControllerSequence;
18  class NiNode;
19  class StatsNode;
20 
21  namespace BSResource
22  {
23  struct ID;
24  }
25 
26  // menuDepth = 3
27  // flags = kPausesGame | kUsesMenuContext | kDisablePauseMenu | kRequiresUpdate | kCustomRendering
28  // kUsesCursor if gamepad disabled
29  // context = kStats
30  class StatsMenu :
31 #ifndef SKYRIM_CROSS_VR
32  public IMenu, // 000
33  public MenuEventHandler // 030, 040
34 #else
35  public IMenu // 000
36 #endif
37  {
38  public:
39  inline static constexpr auto RTTI = RTTI_StatsMenu;
40  constexpr static std::string_view MENU_NAME = "StatsMenu";
41 
42  enum
43  {
44  kTotalTrees = 18
45  };
46 
47  struct UnkData
48  {
49  public:
50  enum class State
51  {
52  kResting = 0,
53  kEntering = 1,
54  kExiting = 2
55  };
56 
57  // members
60  std::uint32_t unk0C; // 0C
61  };
62  static_assert(sizeof(UnkData) == 0x10);
63 
64  struct RUNTIME_DATA
65  {
66 #define RUNTIME_DATA_CONTENT \
67  NiCamera* unk040; /* 000 */ \
68  float horizontalVelocity; /* 008 */ \
69  std::uint32_t unk04C; /* 00C */ \
70  BSTArray<ActorValue> skillTrees; /* 010 */ \
71  BSResource::ID* skydomeHash; /* 028 */ \
72  BSResource::ID* starsHash; /* 030 */ \
73  BSResource::ID* linesHash; /* 038 */ \
74  BSFadeNode* skydomeNode; /* 040 */ \
75  BSFadeNode* starsNode; /* 048 */ \
76  BSFadeNode* linesNode; /* 050 */ \
77  UnkData unk098[kTotalTrees]; /* 058 */ \
78  bool zoomed; /* 178 */ \
79  std::uint8_t unk1B9; /* 179 */ \
80  std::uint16_t unk1BA; /* 17A */ \
81  bool scrolling; /* 17C */ \
82  std::uint8_t unk1BD; /* 17D */ \
83  std::uint16_t unk1BE; /* 17E */ \
84  std::uint32_t selectedTree; /* 180 */ \
85  std::uint32_t unk1C4; /* 184 */ \
86  StatsNode* unk1C8; /* 188 */ \
87  std::uint32_t unk1D0; /* 190 */ \
88  std::uint32_t unk1D4; /* 194 */ \
89  std::uint32_t unk1D8; /* 198 */ \
90  std::uint32_t unk1DC; /* 19C */ \
91  std::uint64_t unk1E0; /* 1A0 */ \
92  std::uint32_t unk1E8; /* 1A8 */ \
93  NiPoint3 skillsLookAt; /* 1AC */ \
94  NiPoint3 starCameraOffset; /* 1B8 */ \
95  NiPoint3 starLookAt; /* 0C4 */ \
96  std::uint64_t unk210; /* 0D0 */ \
97  std::uint64_t unk218; /* 0D8 */ \
98  std::uint64_t unk220; /* 0E0 */ \
99  std::uint64_t unk228; /* 0E8 */ \
100  std::uint64_t unk230; /* 0F0 */ \
101  std::uint64_t unk238; /* 0F8 */ \
102  float unk240; /* 200 */ \
103  float unk244; /* 204 */ \
104  float unk248; /* 208 */ \
105  float unk24C; /* 20C */ \
106  float unk250; /* 210 */ \
107  float unk254; /* 214 */ \
108  float unk258; /* 218 */ \
109  float unk25C; /* 21C */ \
110  float unk260; /* 220 */ \
111  float unk264; /* 224 */ \
112  float unk268; /* 228 */ \
113  float unk26C; /* 22C */ \
114  float unk270; /* 230 */ \
115  float unk274; /* 234 */ \
116  std::uint32_t unk278; /* 238 */ \
117  float unk27C; /* 23C */ \
118  float horizontalAcceleration; /* 240 */ \
119  std::uint32_t unk284; /* 244 */ \
120  NiNode* cameraPosition; /* 248 */ \
121  NiControllerSequence* cameraIntro; /* 250 */ \
122  NiControllerSequence* cameraOutro; /* 258 */ \
123  NiControllerSequence* idle; /* 260 */ \
124  NiControllerManager* unk2A8; /* 268 */ \
125  std::uint64_t unk2B0; /* 270 */ \
126  std::uint64_t unk2B8; /* 278 */ \
127  BSTArray<StatsNode*> unk2C0; /* 280 */ \
128  BSTArray<GFxValue> unk2D8; /* 298 */ \
129  BSScaleformMovieLoadTask* unk2F0; /* 2B0 */ \
130  GFxValue unk2F8; /* 2B8 - StatsMenuBaseInstance.BeastSkillHolder */ \
131  std::uint32_t numSelectableTrees; /* 2D0 */ \
132  float unk314; /* 2D4 */ \
133  float unk318; /* 2D8 */ \
134  std::uint32_t flags; /* 2DC */ \
135  std::uint8_t unk320; /* 2E0 */ \
136  std::uint8_t unk321; /* 2E1 */ \
137  std::uint16_t unk322; /* 2E2 */ \
138  std::uint32_t unk324; /* 2E4 */
139 
141  };
142  static_assert(sizeof(RUNTIME_DATA) == 0x2E8);
143 
144  ~StatsMenu() override; // 00
145 
146  // override (IMenu)
147  void Accept(CallbackProcessor* a_processor) override; // 01
148  void Unk_03(void) override; // 03 - { unk321 = 1; }
149  UI_MESSAGE_RESULTS ProcessMessage(UIMessage& a_message) override; // 04
150  void PostDisplay() override; // 06
151 
152  // override (MenuEventHandler)
153 #ifndef SKYRIM_CROSS_VR
154  bool CanProcess(InputEvent* a_event) override; // 01
155  bool ProcessThumbstick(ThumbstickEvent* a_event) override; // 03
156  bool ProcessButton(ButtonEvent* a_event) override; // 05
157 #endif
158 
159  [[nodiscard]] MenuEventHandler* AsMenuEventHandler() noexcept
160  {
161  return &REL::RelocateMember<MenuEventHandler>(this, 0x30, 0x40);
162  }
163 
164  [[nodiscard]] const MenuEventHandler* AsMenuEventHandler() const noexcept
165  {
166  return const_cast<StatsMenu*>(this)->AsMenuEventHandler();
167  }
168 
169  [[nodiscard]] inline RUNTIME_DATA& GetRuntimeData() noexcept
170  {
171  return REL::RelocateMember<RUNTIME_DATA>(this, 0x40, 0x50);
172  }
173 
174  [[nodiscard]] inline const RUNTIME_DATA& GetRuntimeData() const noexcept
175  {
176  return REL::RelocateMember<RUNTIME_DATA>(this, 0x40, 0x50);
177  }
178 
179  // members
180 #ifndef SKYRIM_CROSS_VR
181  RUNTIME_DATA_CONTENT // 40, 50
182 #endif
183  };
184 #ifndef ENABLE_SKYRIM_VR
185  static_assert(sizeof(StatsMenu) == 0x328);
186 #elif !defined(ENABLE_SKYRIM_AE) && !defined(ENABLE_SKYRIM_SE)
187  static_assert(sizeof(StatsMenu) == 0x338);
188 #endif
189 }
190 #undef RUNTIME_DATA_CONTENT
#define RUNTIME_DATA_CONTENT
Definition: StatsMenu.h:66
Definition: BSEffectShaderProperty.h:10
Definition: ButtonEvent.h:11
Definition: FxDelegateHandler.h:19
Definition: IMenu.h:55
Definition: InputEvent.h:25
Definition: MenuEventHandler.h:14
Definition: StatsMenu.h:37
MenuEventHandler * AsMenuEventHandler() noexcept
Definition: StatsMenu.h:159
constexpr static std::string_view MENU_NAME
Definition: StatsMenu.h:40
bool ProcessThumbstick(ThumbstickEvent *a_event) override
const RUNTIME_DATA & GetRuntimeData() const noexcept
Definition: StatsMenu.h:174
UI_MESSAGE_RESULTS ProcessMessage(UIMessage &a_message) override
RUNTIME_DATA & GetRuntimeData() noexcept
Definition: StatsMenu.h:169
@ kTotalTrees
Definition: StatsMenu.h:44
void Unk_03(void) override
static constexpr auto RTTI
Definition: StatsMenu.h:39
~StatsMenu() override
void PostDisplay() override
bool ProcessButton(ButtonEvent *a_event) override
const MenuEventHandler * AsMenuEventHandler() const noexcept
Definition: StatsMenu.h:164
void Accept(CallbackProcessor *a_processor) override
bool CanProcess(InputEvent *a_event) override
Definition: ThumbstickEvent.h:8
Definition: UIMessage.h:28
Definition: AbsorbEffect.h:6
constexpr REL::VariantID RTTI_StatsMenu(688907, 396762, 0x1f477e0)
UI_MESSAGE_RESULTS
Definition: IMenu.h:48
Definition: StatsMenu.h:65
Definition: StatsMenu.h:48
State
Definition: StatsMenu.h:51
stl::enumeration< State, std::uint32_t > state
Definition: StatsMenu.h:59
std::uint32_t unk0C
Definition: StatsMenu.h:60
BSEffectShaderProperty * unk00
Definition: StatsMenu.h:58