Skip to content

Commit 1119aee

Browse files
committed
feat: RE::MainMenu
1 parent 2bf6566 commit 1119aee

4 files changed

Lines changed: 61 additions & 0 deletions

File tree

include/RE/Fallout.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -885,6 +885,7 @@
885885
#include "RE/M/MagicItem.h"
886886
#include "RE/M/MagicTarget.h"
887887
#include "RE/M/Main.h"
888+
#include "RE/M/MainMenu.h"
888889
#include "RE/M/MapMarkerData.h"
889890
#include "RE/M/MarkerIconTypes.h"
890891
#include "RE/M/MeleeThrowHandler.h"

include/RE/IDs.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1719,6 +1719,11 @@ namespace RE::ID
17191719
inline constexpr REL::ID ConnectSpline{ 2195073 };
17201720
}
17211721

1722+
namespace StartMenuBase
1723+
{
1724+
inline constexpr REL::ID GetMenuDifficultyLevel{ REL::ID(2224540) };
1725+
}
1726+
17221727
namespace SubtitleManager
17231728
{
17241729
inline constexpr REL::ID Singleton{ 4796374 };

include/RE/M/MainMenu.h

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#pragma once
2+
3+
#include "RE/B/BSScaleformExternalTexture.h"
4+
#include "RE/B/BSTHashMap.h"
5+
#include "RE/S/StartMenuBase.h"
6+
7+
namespace RE
8+
{
9+
class MainMenu :
10+
public StartMenuBase,
11+
public BSTEventSink<MenuOpenCloseEvent>
12+
{
13+
public:
14+
static constexpr auto RTTI{ RTTI::MainMenu };
15+
static constexpr auto VTABLE{ VTABLE::MainMenu };
16+
static constexpr auto MENU_NAME{ "MainMenu"sv };
17+
18+
enum class MAIN_MENU_EXIT_CONDITION : std::int32_t
19+
{
20+
kNoExit = 0x00,
21+
kNewGame = 0x01,
22+
kContinue = 0x02,
23+
kLoadGame = 0x03,
24+
};
25+
26+
virtual ~MainMenu(); // 00
27+
28+
// members
29+
MAIN_MENU_EXIT_CONDITION mainMenuExitCondition; // 230
30+
BSTSet<std::uint32_t> ownedDLC; // 238
31+
std::uint64_t creationTime; // 268
32+
std::int32_t queuedLoadIndex; // 270
33+
bool choseContinue; // 274
34+
bool queueStartNewGame; // 275
35+
bool queueContinueGame; // 276
36+
bool creditScreen; // 277
37+
bool userEngaged; // 278
38+
bool mainBinkShown; // 279
39+
bool allowSkip; // 27A
40+
bool debounceMainListPress; // 27B
41+
bool nativeConsolePanelIsOpen; // 27C
42+
bool shouldDebounceMainListPress; // 27D
43+
BSScaleformExternalTexture gamerIconTexture; // 280
44+
BSScaleformExternalTexture dlcImageTextures[14]; // 298
45+
};
46+
static_assert(sizeof(MainMenu) == 0x3E8);
47+
}

include/RE/S/StartMenuBase.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include "RE/B/BSTOptional.h"
44
#include "RE/D/DifficultyLevel.h"
55
#include "RE/G/GameMenuBase.h"
6+
#include "RE/P/PlayerCharacter.h"
67

78
namespace RE
89
{
@@ -22,6 +23,13 @@ namespace RE
2223
virtual void SaveSettings_Derived(); // 17
2324
virtual void SetMenuColor(); // 18
2425

26+
DifficultyLevel GetMenuDifficultyLevel()
27+
{
28+
using func_t = decltype(&StartMenuBase::GetMenuDifficultyLevel);
29+
static REL::Relocation<func_t> func{ ID::StartMenuBase::GetMenuDifficultyLevel };
30+
return func(this);
31+
}
32+
2533
// members
2634
std::unique_ptr<BSGFxShaderFXTarget> mainPanel; // 0E0
2735
std::unique_ptr<BSGFxShaderFXTarget> versionText; // 0E8

0 commit comments

Comments
 (0)