CommonLibSSE NG
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>)
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
72  bool isProcessing; // 80
73  bool beastForm; // 81
74  bool remapMode; // 82
75  std::uint8_t unk83; // 83
76  std::uint32_t unk84; // 84
77  };
78  static_assert(offsetof(MenuControls, handlers) == 0x18);
79  static_assert(offsetof(MenuControls, remapMode) == 0x82);
80  static_assert(sizeof(MenuControls) == 0x88);
81 }
Definition: BSTArray.h:377
Definition: BSTEvent.h:143
Definition: InputEvent.h:25
Definition: MenuControls.h:25
BSTSmartPointer< DirectionHandler > directionHandler
Definition: MenuControls.h:66
bool beastForm
Definition: MenuControls.h:73
std::uint8_t unk83
Definition: MenuControls.h:75
BSTSmartPointer< ScreenshotHandler > screenshotHandler
Definition: MenuControls.h:71
std::uint8_t pad11
Definition: MenuControls.h:60
BSTSmartPointer< FavoritesHandler > favoritesHandler
Definition: MenuControls.h:70
BSTArray< MenuEventHandler * > handlers
Definition: MenuControls.h:63
BSTSmartPointer< MenuOpenHandler > menuOpenHandler
Definition: MenuControls.h:69
std::uint32_t pad14
Definition: MenuControls.h:62
BSTSmartPointer< QuickSaveLoadHandler > quickSaveLoadHandler
Definition: MenuControls.h:68
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
bool isProcessing
Definition: MenuControls.h:72
BSTSmartPointer< ConsoleOpenHandler > consoleOpenHandler
Definition: MenuControls.h:67
void UnregisterHandler(MenuEventHandler *a_handler)
std::uint32_t unk84
Definition: MenuControls.h:76
bool remapMode
Definition: MenuControls.h:74
BSTSmartPointer< ClickHandler > clickHandler
Definition: MenuControls.h:65
bool QueueScreenshot()
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()
Definition: MenuEventHandler.h:14
Definition: MenuModeChangeEvent.h:8
Definition: AbsorbEffect.h:6
BSEventNotifyControl
Definition: BSTEvent.h:12
Definition: BSTSingleton.h:50
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)