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