CommonLibSSE (Parapets fork)
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"
7 
8 namespace RE
9 {
10  class InputEvent;
11  class MenuEventHandler;
12  class MenuModeChangeEvent;
13  struct ClickHandler;
14  struct ConsoleOpenHandler;
15  struct DirectionHandler;
16  struct FavoritesHandler;
17  struct MenuOpenHandler;
18  struct QuickSaveLoadHandler;
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>)
48  BSEventNotifyControl ProcessEvent(const MenuModeChangeEvent* a_event, BSTEventSource<MenuModeChangeEvent>* a_eventSource) override; // 01
49 
51 
52  void AddHandler(MenuEventHandler* a_handler);
53  [[nodiscard]] constexpr bool InBeastForm() const noexcept { return beastForm; }
55  void RemoveHandler(MenuEventHandler* a_handler);
57 
58  // members
59  std::uint8_t pad11; // 11
60  std::uint16_t pad12; // 12
61  std::uint32_t pad14; // 14
64  ClickHandler* clickHandler; // 48
66  ConsoleOpenHandler* consoleOpenHandler; // 58
67  QuickSaveLoadHandler* quickSaveLoadHandler; // 60
70  ScreenshotHandler* screenshotHandler; // 78
71 #ifdef SKYRIMVR
72  std::uint64_t unkVR80; // 80
73 #endif
74  bool isProcessing; // 80
75  bool beastForm; // 81
76  bool remapMode; // 82
77  std::uint8_t unk83; // 83
78  std::uint32_t unk84; // 84
79  };
80  static_assert(offsetof(MenuControls, handlers) == 0x18);
81 #ifndef SKYRIMVR
82  static_assert(offsetof(MenuControls, remapMode) == 0x82);
83  static_assert(sizeof(MenuControls) == 0x88);
84 #else
85  static_assert(sizeof(MenuControls) == 0x90);
86 #endif
87 }
Definition: BSTArray.h:377
Definition: BSTEvent.h:146
Definition: InputEvent.h:26
Definition: MenuControls.h:25
DirectionHandler * directionHandler
Definition: MenuControls.h:65
bool beastForm
Definition: MenuControls.h:75
std::uint8_t unk83
Definition: MenuControls.h:77
std::uint8_t pad11
Definition: MenuControls.h:59
BSTArray< MenuEventHandler * > handlers
Definition: MenuControls.h:62
MenuOpenHandler * menuOpenHandler
Definition: MenuControls.h:68
QuickSaveLoadHandler * quickSaveLoadHandler
Definition: MenuControls.h:67
std::uint32_t pad14
Definition: MenuControls.h:61
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:63
ClickHandler * clickHandler
Definition: MenuControls.h:64
bool isProcessing
Definition: MenuControls.h:74
void UnregisterHandler(MenuEventHandler *a_handler)
std::uint32_t unk84
Definition: MenuControls.h:78
bool remapMode
Definition: MenuControls.h:76
FavoritesHandler * favoritesHandler
Definition: MenuControls.h:69
ConsoleOpenHandler * consoleOpenHandler
Definition: MenuControls.h:66
std::uint16_t pad12
Definition: MenuControls.h:60
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:70
Definition: MenuEventHandler.h:17
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