CommonLibSSE (powerof3)
IMenu.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/F/FxDelegate.h"
5 #include "RE/G/GFxMovieView.h"
6 #include "RE/G/GPtr.h"
7 #include "RE/U/UserEvents.h"
8 
9 namespace RE
10 {
11  class CallbackProcessor;
12  class UIMessage;
13 
14  enum class UI_MENU_FLAGS
15  {
16  kNone = 0,
17  kPausesGame = 1 << 0,
18  kAlwaysOpen = 1 << 1,
19  kUsesCursor = 1 << 2,
20  kUsesMenuContext = 1 << 3,
21  kModal = 1 << 4, // prevents lower movies with this flag from advancing
22  kFreezeFrameBackground = 1 << 5,
23  kOnStack = 1 << 6,
24  kDisablePauseMenu = 1 << 7,
25  kRequiresUpdate = 1 << 8,
26  kTopmostRenderedMenu = 1 << 9,
27  kUpdateUsesCursor = 1 << 10,
28  kAllowSaving = 1 << 11,
29  kRendersOffscreenTargets = 1 << 12,
30  kInventoryItemMenu = 1 << 13,
32  kCustomRendering = 1 << 15,
33  kAssignCursorToRenderer = 1 << 16,
34  kApplicationMenu = 1 << 17,
35  kHasButtonBar = 1 << 18,
36  kIsTopButtonBar = 1 << 19,
37  kAdvancesUnderPauseMenu = 1 << 20,
38  kRendersUnderPauseMenu = 1 << 21,
39  kUsesBlurredBackground = 1 << 22,
40  kCompanionAppAllowed = 1 << 23,
41  kFreezeFramePause = 1 << 24,
44  kUsesMovementToDirection = 1 << 27
45  };
46 
47  enum class UI_MESSAGE_RESULTS
48  {
49  kHandled = 0,
50  kIgnore = 1,
51  kPassOn = 2
52  };
53 
54  class IMenu : public FxDelegateHandler
55  {
56  public:
57  inline static constexpr auto RTTI = RTTI_IMenu;
58  inline static constexpr auto VTABLE = VTABLE_IMenu;
59 
62 
63  ~IMenu() override = default; // 00
64 
65  // override (FxDelegateHandler)
66  void Accept(CallbackProcessor* a_processor) override; // 01 - { return; }
67 
68  // add
69  virtual void PostCreate(); // 02 - { return; }
70  virtual void Unk_03(void); // 03 - { return; }
71  virtual UI_MESSAGE_RESULTS ProcessMessage(UIMessage& a_message); // 04
72  virtual void AdvanceMovie(float a_interval, std::uint32_t a_currentTime); // 05
73  virtual void PostDisplay(); // 06
74  virtual void PreDisplay(); // 07 - { return; } - only available if kRendersOffscreenTargets is set
75  virtual void RefreshPlatform(); // 08
76 
77  [[nodiscard]] constexpr bool AdvancesUnderPauseMenu() const noexcept { return menuFlags.all(Flag::kAdvancesUnderPauseMenu); }
78  [[nodiscard]] constexpr bool AllowSaving() const noexcept { return menuFlags.all(Flag::kAllowSaving); }
79  [[nodiscard]] constexpr bool AlwaysOpen() const noexcept { return menuFlags.all(Flag::kAlwaysOpen); }
80  [[nodiscard]] constexpr bool ApplicationMenu() const noexcept { return menuFlags.all(Flag::kApplicationMenu); }
81  [[nodiscard]] constexpr bool AssignCursorToRenderer() const noexcept { return menuFlags.all(Flag::kAssignCursorToRenderer); }
82  [[nodiscard]] constexpr bool CustomRendering() const noexcept { return menuFlags.all(Flag::kCustomRendering); }
83  [[nodiscard]] constexpr bool CompanionAppAllowed() const noexcept { return menuFlags.all(Flag::kCompanionAppAllowed); }
84  [[nodiscard]] constexpr bool DisablePauseMenu() const noexcept { return menuFlags.all(Flag::kDisablePauseMenu); }
85  [[nodiscard]] constexpr bool DontHideCursorWhenTopmost() const noexcept { return menuFlags.all(Flag::kDontHideCursorWhenTopmost); }
86  [[nodiscard]] constexpr bool FreezeFrameBackground() const noexcept { return menuFlags.all(Flag::kFreezeFrameBackground); }
87  [[nodiscard]] constexpr bool FreezeFramePause() const noexcept { return menuFlags.all(Flag::kFreezeFramePause); }
88  [[nodiscard]] constexpr bool HasButtonBar() const noexcept { return menuFlags.all(Flag::kHasButtonBar); }
89  [[nodiscard]] constexpr bool InventoryItemMenu() const noexcept { return menuFlags.all(Flag::kInventoryItemMenu); }
90  [[nodiscard]] constexpr bool IsTopButtonBar() const noexcept { return menuFlags.all(Flag::kIsTopButtonBar); }
91  [[nodiscard]] constexpr bool LargeScaleformRenderCacheMode() const noexcept { return menuFlags.all(Flag::kLargeScaleformRenderCacheMode); }
92  [[nodiscard]] constexpr bool Modal() const noexcept { return menuFlags.all(Flag::kModal); }
93  [[nodiscard]] constexpr bool OnStack() const noexcept { return menuFlags.all(Flag::kOnStack); }
94  [[nodiscard]] constexpr bool PausesGame() const noexcept { return menuFlags.all(Flag::kPausesGame); }
95  [[nodiscard]] constexpr bool RendersOffscreenTargets() const noexcept { return menuFlags.all(Flag::kRendersOffscreenTargets); }
96  [[nodiscard]] constexpr bool RendersUnderPauseMenu() const noexcept { return menuFlags.all(Flag::kRendersUnderPauseMenu); }
97  [[nodiscard]] constexpr bool RequiresUpdate() const noexcept { return menuFlags.all(Flag::kRequiresUpdate); }
98  [[nodiscard]] constexpr bool SkipRenderDuringFreezeFrameScreenshot() const noexcept { return menuFlags.all(Flag::kSkipRenderDuringFreezeFrameScreenshot); }
99  [[nodiscard]] constexpr bool TopmostRenderedMenu() const noexcept { return menuFlags.all(Flag::kTopmostRenderedMenu); }
100  [[nodiscard]] constexpr bool UpdateUsesCursor() const noexcept { return menuFlags.all(Flag::kUpdateUsesCursor); }
101  [[nodiscard]] constexpr bool UsesBlurredBackground() const noexcept { return menuFlags.all(Flag::kUsesBlurredBackground); }
102  [[nodiscard]] constexpr bool UsesCursor() const noexcept { return menuFlags.all(Flag::kUsesCursor); }
103  [[nodiscard]] constexpr bool UsesMenuContext() const noexcept { return menuFlags.all(Flag::kUsesMenuContext); }
104  [[nodiscard]] constexpr bool UsesMovementToDirection() const noexcept { return menuFlags.all(Flag::kUsesMovementToDirection); }
105 
106  // members
107  GPtr<GFxMovieView> uiMovie{ nullptr }; // 10
108  std::int8_t depthPriority{ 3 }; // 18
109  std::uint8_t pad19{ 0 }; // 19
110  std::uint16_t pad20{ 0 }; // 1A
113  std::uint32_t pad24{ 0 }; // 24
114  GPtr<FxDelegate> fxDelegate{ nullptr }; // 28
115  };
116  static_assert(sizeof(IMenu) == 0x30);
117 }
constexpr bool all(Args... a_args) const noexcept requires(std
Definition: EnumSet.h:99
Definition: FxDelegateHandler.h:20
Definition: FxDelegateHandler.h:12
Definition: GPtr.h:7
Definition: IMenu.h:55
~IMenu() override=default
constexpr bool UsesCursor() const noexcept
Definition: IMenu.h:102
constexpr bool AlwaysOpen() const noexcept
Definition: IMenu.h:79
constexpr bool RendersOffscreenTargets() const noexcept
Definition: IMenu.h:95
static constexpr auto VTABLE
Definition: IMenu.h:58
GPtr< FxDelegate > fxDelegate
Definition: IMenu.h:114
constexpr bool UsesMenuContext() const noexcept
Definition: IMenu.h:103
constexpr bool Modal() const noexcept
Definition: IMenu.h:92
std::uint32_t pad24
Definition: IMenu.h:113
constexpr bool UsesMovementToDirection() const noexcept
Definition: IMenu.h:104
virtual void PostDisplay()
virtual UI_MESSAGE_RESULTS ProcessMessage(UIMessage &a_message)
void Accept(CallbackProcessor *a_processor) override
constexpr bool AssignCursorToRenderer() const noexcept
Definition: IMenu.h:81
static constexpr auto RTTI
Definition: IMenu.h:57
constexpr bool RendersUnderPauseMenu() const noexcept
Definition: IMenu.h:96
virtual void PreDisplay()
constexpr bool UpdateUsesCursor() const noexcept
Definition: IMenu.h:100
virtual void PostCreate()
constexpr bool LargeScaleformRenderCacheMode() const noexcept
Definition: IMenu.h:91
constexpr bool OnStack() const noexcept
Definition: IMenu.h:93
constexpr bool CustomRendering() const noexcept
Definition: IMenu.h:82
constexpr bool PausesGame() const noexcept
Definition: IMenu.h:94
REX::EnumSet< UI_MENU_FLAGS, std::uint32_t > menuFlags
Definition: IMenu.h:111
virtual void AdvanceMovie(float a_interval, std::uint32_t a_currentTime)
constexpr bool UsesBlurredBackground() const noexcept
Definition: IMenu.h:101
std::int8_t depthPriority
Definition: IMenu.h:108
constexpr bool InventoryItemMenu() const noexcept
Definition: IMenu.h:89
constexpr bool TopmostRenderedMenu() const noexcept
Definition: IMenu.h:99
virtual void Unk_03(void)
GPtr< GFxMovieView > uiMovie
Definition: IMenu.h:107
std::uint8_t pad19
Definition: IMenu.h:109
constexpr bool FreezeFrameBackground() const noexcept
Definition: IMenu.h:86
constexpr bool HasButtonBar() const noexcept
Definition: IMenu.h:88
constexpr bool AdvancesUnderPauseMenu() const noexcept
Definition: IMenu.h:77
std::uint16_t pad20
Definition: IMenu.h:110
constexpr bool SkipRenderDuringFreezeFrameScreenshot() const noexcept
Definition: IMenu.h:98
REX::EnumSet< Context, std::uint32_t > inputContext
Definition: IMenu.h:112
constexpr bool IsTopButtonBar() const noexcept
Definition: IMenu.h:90
constexpr bool AllowSaving() const noexcept
Definition: IMenu.h:78
constexpr bool FreezeFramePause() const noexcept
Definition: IMenu.h:87
constexpr bool DisablePauseMenu() const noexcept
Definition: IMenu.h:84
constexpr bool ApplicationMenu() const noexcept
Definition: IMenu.h:80
constexpr bool DontHideCursorWhenTopmost() const noexcept
Definition: IMenu.h:85
constexpr bool RequiresUpdate() const noexcept
Definition: IMenu.h:97
constexpr bool CompanionAppAllowed() const noexcept
Definition: IMenu.h:83
virtual void RefreshPlatform()
Definition: UIMessage.h:28
INPUT_CONTEXT_IDS::INPUT_CONTEXT_ID INPUT_CONTEXT_ID
Definition: UserEvents.h:41
Definition: AbsorbEffect.h:6
UI_MESSAGE_RESULTS
Definition: IMenu.h:48
constexpr REL::ID RTTI_IMenu(static_cast< std::uint64_t >(686416))
UI_MENU_FLAGS
Definition: IMenu.h:15
@ kSkipRenderDuringFreezeFrameScreenshot
constexpr std::array< REL::ID, 1 > VTABLE_IMenu
Definition: Offsets_VTABLE.h:11808
INPUT_CONTEXT_ID
Definition: UserEvents.h:14