CommonLibVR
MenuControls.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/B/BSTArray.h"
4 #include "RE/B/BSTEvent.h"
5 #include "RE/B/BSTSingleton.h"
6 #include "RE/B/BSTSmartPointer.h"
8 
9 namespace RE
10 {
11  class InputEvent;
12  class MenuEventHandler;
13  class MenuModeChangeEvent;
14  struct ClickHandler;
15  struct ConsoleOpenHandler;
16  struct DirectionHandler;
17  struct FavoritesHandler;
18  struct MenuOpenHandler;
19  struct ScreenshotHandler;
20 
21  class MenuControls :
22  public BSTEventSink<InputEvent*>, // 00
23  public BSTSingletonSDM<MenuControls>, // 10
24  public BSTEventSink<MenuModeChangeEvent> // 08
25  {
26  public:
27  struct QueuedReg
28  {
29  public:
30  QueuedReg(MenuEventHandler* a_handler, bool a_add);
31  ~QueuedReg() = default;
32 
33  // members
35  bool add; // 08
36  std::uint8_t pad08; // 09
37  std::uint16_t pad09; // 0A
38  std::uint32_t pad0A; // 0C
39  };
40  static_assert(sizeof(QueuedReg) == 0x10);
41 
42  ~MenuControls() override; // 00
43 
44  // override (BSTEventSink<InputEvent*>)
45  BSEventNotifyControl ProcessEvent(InputEvent* const* a_event, BSTEventSource<InputEvent*>* a_eventSource) override; // 01
46 
47  // override (BSTEventSink<MenuModeChangeEvent>)
49 
51 
52  void AddHandler(MenuEventHandler* a_handler);
53  [[nodiscard]] constexpr bool InBeastForm() const noexcept { return beastForm; }
55  void RemoveHandler(MenuEventHandler* a_handler);
58 
59  // members
60  std::uint8_t pad11; // 11
61  std::uint16_t pad12; // 12
62  std::uint32_t pad14; // 14
65  ClickHandler* clickHandler; // 48
67  ConsoleOpenHandler* consoleOpenHandler; // 58
72 #ifdef SKYRIMVR
73  std::uint64_t occlusionCullingToggleHandler; // 80
74 #endif
75  bool isProcessing; // 80
76  bool beastForm; // 81
77  bool remapMode; // 82
78  std::uint8_t unk83; // 83
79  std::uint32_t unk84; // 84
80  private:
81  KEEP_FOR_RE()
82  };
83  static_assert(offsetof(MenuControls, handlers) == 0x18);
84 
85 #ifndef SKYRIMVR
86  static_assert(sizeof(MenuControls) == 0x88);
87  static_assert(offsetof(MenuControls, remapMode) == 0x82);
88 #else
89  static_assert(offsetof(MenuControls, remapMode) == 0x8A);
90  static_assert(sizeof(MenuControls) == 0x90);
91 #endif
92 
93 }
#define KEEP_FOR_RE()
Definition: PCH.h:713
Definition: BSTArray.h:378
Definition: BSTEvent.h:143
Definition: InputEvent.h:25
Definition: MenuControls.h:25
DirectionHandler * directionHandler
Definition: MenuControls.h:66
bool beastForm
Definition: MenuControls.h:76
std::uint8_t unk83
Definition: MenuControls.h:78
std::uint8_t pad11
Definition: MenuControls.h:60
BSTArray< MenuEventHandler * > handlers
Definition: MenuControls.h:63
MenuOpenHandler * menuOpenHandler
Definition: MenuControls.h:69
QuickSaveLoadHandler * quickSaveLoadHandler
Definition: MenuControls.h:68
std::uint32_t pad14
Definition: MenuControls.h:62
BSEventNotifyControl ProcessEvent(const MenuModeChangeEvent *a_event, BSTEventSource< MenuModeChangeEvent > *a_eventSource) override
void RemoveHandler(MenuEventHandler *a_handler)
void RegisterHandler(MenuEventHandler *a_handler)
BSTArray< QueuedReg > regBuffer
Definition: MenuControls.h:64
ClickHandler * clickHandler
Definition: MenuControls.h:65
bool isProcessing
Definition: MenuControls.h:75
void UnregisterHandler(MenuEventHandler *a_handler)
std::uint32_t unk84
Definition: MenuControls.h:79
bool remapMode
Definition: MenuControls.h:77
bool QueueScreenshot()
FavoritesHandler * favoritesHandler
Definition: MenuControls.h:70
ConsoleOpenHandler * consoleOpenHandler
Definition: MenuControls.h:67
std::uint16_t pad12
Definition: MenuControls.h:61
void AddHandler(MenuEventHandler *a_handler)
~MenuControls() override
BSEventNotifyControl ProcessEvent(InputEvent *const *a_event, BSTEventSource< InputEvent * > *a_eventSource) override
constexpr bool InBeastForm() const noexcept
Definition: MenuControls.h:53
static MenuControls * GetSingleton()
ScreenshotHandler * screenshotHandler
Definition: MenuControls.h:71
Definition: MenuEventHandler.h:14
Definition: MenuModeChangeEvent.h:8
Definition: QuickSaveLoadHandler.h:14
Definition: AbsorbEffect.h:6
BSEventNotifyControl
Definition: BSTEvent.h:12
Definition: BSTSingleton.h:50
Definition: DirectionHandler.h:8
Definition: FavoritesHandler.h:8
Definition: MenuControls.h:28
MenuEventHandler * handler
Definition: MenuControls.h:34
std::uint32_t pad0A
Definition: MenuControls.h:38
std::uint8_t pad08
Definition: MenuControls.h:36
std::uint16_t pad09
Definition: MenuControls.h:37
bool add
Definition: MenuControls.h:35
QueuedReg(MenuEventHandler *a_handler, bool a_add)
Definition: MenuOpenHandler.h:8
Definition: ScreenshotHandler.h:8