CommonLibVR
Loading...
Searching...
No Matches
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/S/Setting.h"
8#include "RE/U/UserEvents.h"
9
10namespace 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
24 kOnStack = 1 << 6,
25 kDisablePauseMenu = 1 << 7,
26 kRequiresUpdate = 1 << 8,
27 kTopmostRenderedMenu = 1 << 9,
28 kUpdateUsesCursor = 1 << 10,
29 kAllowSaving = 1 << 11,
31 kInventoryItemMenu = 1 << 13,
33 kCustomRendering = 1 << 15,
35 kApplicationMenu = 1 << 17,
36 kHasButtonBar = 1 << 18,
37 kIsTopButtonBar = 1 << 19,
39 kRendersUnderPauseMenu = 1 << 21,
40 kUsesBlurredBackground = 1 << 22,
41 kCompanionAppAllowed = 1 << 23,
42 kFreezeFramePause = 1 << 24,
46 };
47
49 {
50 kHandled = 0,
51 kIgnore = 1,
52 kPassOn = 2
53 };
54
55#ifdef SKYRIMVR
56 enum class UI_MENU_Unk09
57 {
58 kNone = static_cast<std::underlying_type_t<UI_MENU_Unk09>>(-1), // Entire enum needs more REing
59
60 };
61#endif
62
63 class IMenu : public FxDelegateHandler
64 {
65 public:
66 inline static constexpr auto RTTI = RTTI_IMenu;
67 inline static constexpr auto VTABLE = VTABLE_IMenu;
68
71
72 ~IMenu() override = default; // 00
73
74 // override (FxDelegateHandler)
75 void Accept(CallbackProcessor* a_processor) override; // 01 - { return; }
76
77 // add
78 virtual void PostCreate(); // 02 - { return; }
79 virtual void Unk_03(void); // 03 - { return; }
80 virtual UI_MESSAGE_RESULTS ProcessMessage(UIMessage& a_message); // 04
81 virtual void AdvanceMovie(float a_interval, std::uint32_t a_currentTime); // 05
82 virtual void PostDisplay(); // 06
83 virtual void PreDisplay(); // 07 - { return; } - only available if kRendersOffscreenTargets is set
84 virtual void RefreshPlatform(); // 08
85#ifdef SKYRIMVR
86 virtual void Unk_09(UI_MENU_Unk09 a_unk); // 09 - { unk30 = a_unk; }
87 virtual void Unk_0A(); // 0A - Does something with _root.ResetOnShow swf function
88#endif
89
90 [[nodiscard]] constexpr bool AdvancesUnderPauseMenu() const noexcept
91 {
92 return menuFlags.all(Flag::kAdvancesUnderPauseMenu);
93 }
94 [[nodiscard]] constexpr bool AllowSaving() const noexcept { return menuFlags.all(Flag::kAllowSaving); }
95 [[nodiscard]] constexpr bool AlwaysOpen() const noexcept { return menuFlags.all(Flag::kAlwaysOpen); }
96 [[nodiscard]] constexpr bool ApplicationMenu() const noexcept { return menuFlags.all(Flag::kApplicationMenu); }
97 [[nodiscard]] constexpr bool AssignCursorToRenderer() const noexcept { return menuFlags.all(Flag::kAssignCursorToRenderer); }
98 [[nodiscard]] constexpr bool CustomRendering() const noexcept { return menuFlags.all(Flag::kCustomRendering); }
99 [[nodiscard]] constexpr bool CompanionAppAllowed() const noexcept { return menuFlags.all(Flag::kCompanionAppAllowed); }
100 [[nodiscard]] constexpr bool DisablePauseMenu() const noexcept { return menuFlags.all(Flag::kDisablePauseMenu); }
101 [[nodiscard]] constexpr bool DontHideCursorWhenTopmost() const noexcept { return menuFlags.all(Flag::kDontHideCursorWhenTopmost); }
102 [[nodiscard]] constexpr bool FreezeFrameBackground() const noexcept { return menuFlags.all(Flag::kFreezeFrameBackground); }
103 [[nodiscard]] constexpr bool FreezeFramePause() const noexcept { return menuFlags.all(Flag::kFreezeFramePause); }
104 [[nodiscard]] constexpr bool HasButtonBar() const noexcept { return menuFlags.all(Flag::kHasButtonBar); }
105 [[nodiscard]] constexpr bool InventoryItemMenu() const noexcept { return menuFlags.all(Flag::kInventoryItemMenu); }
106 [[nodiscard]] constexpr bool IsTopButtonBar() const noexcept { return menuFlags.all(Flag::kIsTopButtonBar); }
107 [[nodiscard]] constexpr bool LargeScaleformRenderCacheMode() const noexcept { return menuFlags.all(Flag::kLargeScaleformRenderCacheMode); }
108 [[nodiscard]] constexpr bool Modal() const noexcept { return menuFlags.all(Flag::kModal); }
109 [[nodiscard]] constexpr bool OnStack() const noexcept { return menuFlags.all(Flag::kOnStack); }
110 [[nodiscard]] constexpr bool PausesGame() const noexcept { return menuFlags.all(Flag::kPausesGame); }
111 [[nodiscard]] constexpr bool RendersOffscreenTargets() const noexcept { return menuFlags.all(Flag::kRendersOffscreenTargets); }
112 [[nodiscard]] constexpr bool RendersUnderPauseMenu() const noexcept { return menuFlags.all(Flag::kRendersUnderPauseMenu); }
113 [[nodiscard]] constexpr bool RequiresUpdate() const noexcept { return menuFlags.all(Flag::kRequiresUpdate); }
114 [[nodiscard]] constexpr bool SkipRenderDuringFreezeFrameScreenshot() const noexcept { return menuFlags.all(Flag::kSkipRenderDuringFreezeFrameScreenshot); }
115 [[nodiscard]] constexpr bool TopmostRenderedMenu() const noexcept { return menuFlags.all(Flag::kTopmostRenderedMenu); }
116 [[nodiscard]] constexpr bool UpdateUsesCursor() const noexcept { return menuFlags.all(Flag::kUpdateUsesCursor); }
117 [[nodiscard]] constexpr bool UsesBlurredBackground() const noexcept { return menuFlags.all(Flag::kUsesBlurredBackground); }
118 [[nodiscard]] constexpr bool UsesCursor() const noexcept { return menuFlags.all(Flag::kUsesCursor); }
119 [[nodiscard]] constexpr bool UsesMenuContext() const noexcept { return menuFlags.all(Flag::kUsesMenuContext); }
120 [[nodiscard]] constexpr bool UsesMovementToDirection() const noexcept { return menuFlags.all(Flag::kUsesMovementToDirection); }
121
122 // members
123 GPtr<GFxMovieView> uiMovie{ nullptr }; // 10
124 std::int8_t depthPriority{ 3 }; // 18
125 std::uint8_t pad19{ 0 }; // 19
126 std::uint16_t pad20{ 0 }; // 1A
129 std::uint32_t pad24{ 0 }; // 24
130 GPtr<FxDelegate> fxDelegate{ nullptr }; // 28
131#ifdef SKYRIMVR
132 REX::EnumSet<UI_MENU_Unk09, std::uint32_t> unk30{ UI_MENU_Unk09::kNone };
133 std::byte unk34{ 1 };
134 BSFixedString menuName{ "N/A" }; // 38
135#endif
136 private:
138 };
139#ifndef SKYRIMVR
140 static_assert(sizeof(IMenu) == 0x30);
141#else
142 static_assert(sizeof(IMenu) == 0x40);
143#endif
144}
#define KEEP_FOR_RE()
Definition PCH.h:517
Definition EnumSet.h:9
constexpr bool all(Args... a_args) const noexcept
Definition EnumSet.h:99
Definition FxDelegateHandler.h:20
Definition FxDelegateHandler.h:12
Definition GPtr.h:7
Definition IMenu.h:64
~IMenu() override=default
constexpr bool UsesCursor() const noexcept
Definition IMenu.h:118
constexpr bool AlwaysOpen() const noexcept
Definition IMenu.h:95
constexpr bool RendersOffscreenTargets() const noexcept
Definition IMenu.h:111
static constexpr auto VTABLE
Definition IMenu.h:67
GPtr< FxDelegate > fxDelegate
Definition IMenu.h:130
constexpr bool UsesMenuContext() const noexcept
Definition IMenu.h:119
constexpr bool Modal() const noexcept
Definition IMenu.h:108
std::uint32_t pad24
Definition IMenu.h:129
constexpr bool UsesMovementToDirection() const noexcept
Definition IMenu.h:120
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:97
static constexpr auto RTTI
Definition IMenu.h:66
constexpr bool RendersUnderPauseMenu() const noexcept
Definition IMenu.h:112
virtual void PreDisplay()
constexpr bool UpdateUsesCursor() const noexcept
Definition IMenu.h:116
virtual void PostCreate()
constexpr bool LargeScaleformRenderCacheMode() const noexcept
Definition IMenu.h:107
constexpr bool OnStack() const noexcept
Definition IMenu.h:109
constexpr bool CustomRendering() const noexcept
Definition IMenu.h:98
constexpr bool PausesGame() const noexcept
Definition IMenu.h:110
REX::EnumSet< UI_MENU_FLAGS, std::uint32_t > menuFlags
Definition IMenu.h:127
virtual void AdvanceMovie(float a_interval, std::uint32_t a_currentTime)
constexpr bool UsesBlurredBackground() const noexcept
Definition IMenu.h:117
std::int8_t depthPriority
Definition IMenu.h:124
constexpr bool InventoryItemMenu() const noexcept
Definition IMenu.h:105
constexpr bool TopmostRenderedMenu() const noexcept
Definition IMenu.h:115
virtual void Unk_03(void)
GPtr< GFxMovieView > uiMovie
Definition IMenu.h:123
std::uint8_t pad19
Definition IMenu.h:125
constexpr bool FreezeFrameBackground() const noexcept
Definition IMenu.h:102
constexpr bool HasButtonBar() const noexcept
Definition IMenu.h:104
constexpr bool AdvancesUnderPauseMenu() const noexcept
Definition IMenu.h:90
std::uint16_t pad20
Definition IMenu.h:126
constexpr bool SkipRenderDuringFreezeFrameScreenshot() const noexcept
Definition IMenu.h:114
REX::EnumSet< Context, std::uint32_t > inputContext
Definition IMenu.h:128
constexpr bool IsTopButtonBar() const noexcept
Definition IMenu.h:106
constexpr bool AllowSaving() const noexcept
Definition IMenu.h:94
constexpr bool FreezeFramePause() const noexcept
Definition IMenu.h:103
constexpr bool DisablePauseMenu() const noexcept
Definition IMenu.h:100
constexpr bool ApplicationMenu() const noexcept
Definition IMenu.h:96
constexpr bool DontHideCursorWhenTopmost() const noexcept
Definition IMenu.h:101
constexpr bool RequiresUpdate() const noexcept
Definition IMenu.h:113
constexpr bool CompanionAppAllowed() const noexcept
Definition IMenu.h:99
virtual void RefreshPlatform()
Definition UIMessage.h:28
INPUT_CONTEXT_IDS::INPUT_CONTEXT_ID INPUT_CONTEXT_ID
Definition UserEvents.h:47
Definition AbsorbEffect.h:6
UI_MESSAGE_RESULTS
Definition IMenu.h:49
constexpr REL::ID RTTI_IMenu(static_cast< std::uint64_t >(686416))
UI_MENU_FLAGS
Definition IMenu.h:16
@ kSkipRenderDuringFreezeFrameScreenshot
constexpr std::array< REL::ID, 1 > VTABLE_IMenu
Definition Offsets_VTABLE.h:11808
detail::BSFixedString< char > BSFixedString
Definition BSFixedString.h:239
@ kNone
Definition PlayerCharacter.h:85
INPUT_CONTEXT_ID
Definition UserEvents.h:14