Skip to content

Commit

Permalink
Merge pull request #136 from digital-apple/dev
Browse files Browse the repository at this point in the history
RE BGSSaveLoadFileEntry
  • Loading branch information
powerof3 authored Sep 28, 2024
2 parents 3a18e4d + 35ac1c0 commit 8a13dcc
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 18 deletions.
53 changes: 35 additions & 18 deletions include/RE/B/BGSSaveLoadManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,41 @@ namespace RE
class BGSSaveLoadFileEntry
{
public:
enum class SaveType : std::uint32_t
{
kAutosave = 0x0,
kSave = 0x1,
kQuicksave = 0x2
};

// members
BSFixedString fileName; // 00
BSFixedString playerName; // 08
BSFixedString playerTitle; // 10
BSFixedString location; // 18
BSFixedString playTime; // 20
BSFixedString raceName; // 28
std::uint32_t unk30; // 30
std::uint32_t unk34; // 34
std::uint32_t unk38; // 38
std::uint32_t unk3C; // 3C
std::uint32_t unk40; // 40
std::uint32_t unk44; // 44
std::uint64_t unk48; // 48
std::uint64_t unk50; // 50
std::uint64_t unk58; // 58
std::uint64_t unk60; // 60
std::uint64_t unk68; // 68
std::uint64_t unk70; // 70
BSFixedString fileName; // 00
BSFixedString characterName; // 08
BSFixedString characterTitle; // 10
BSFixedString currentLocation; // 18
BSFixedString playTime; // 20
BSFixedString characterRace; // 28
std::int32_t saveVersion; // 30
std::uint32_t saveNumber; // 34
std::uint32_t characterLevel; // 38
float currentExperience; // 3C
float requiredExperience; // 40
std::uint32_t screenshotWidth; // 44
std::uint32_t screenshotHeight; // 48
std::uint32_t unk4C; // 4C
REX::W32::FILETIME fileTime; // 50
REX::W32::FILETIME saveTime; // 58
std::int32_t unk60; // 60
bool loaded; // 64
bool unk65; // 65
bool unk66; // 66
std::uint8_t unk67; // 67
std::uint8_t unk68; // 68
bool unk69; // 69
std::uint16_t pad6A; // 6A
std::uint32_t characterID; // 6C
stl::enumeration<SaveType, std::uint32_t> saveType; // 70
std::uint32_t pad74; // 74
};
static_assert(sizeof(BGSSaveLoadFileEntry) == 0x78);

Expand Down Expand Up @@ -89,6 +105,7 @@ namespace RE
void Save(const char* a_fileName);
void Load(const char* a_fileName);
void Load(const char* a_fileName, bool a_checkForMods);
bool PopulateSaveList();

bool LoadMostRecentSaveGame();

Expand Down
7 changes: 7 additions & 0 deletions src/RE/B/BGSSaveLoadManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ namespace RE
Load_Impl(a_fileName, -1, 0, a_checkForMods);
}

void BGSSaveLoadManager::PopulateSaveList()
{
using func_t = decltype(&BGSSaveLoadManager::PopulateSaveList);
static REL::Relocation<func_t> func{ RELOCATION_ID(34850, 35760) };
return func(this);
}

bool BGSSaveLoadManager::LoadMostRecentSaveGame()
{
using func_t = decltype(&BGSSaveLoadManager::LoadMostRecentSaveGame);
Expand Down

0 comments on commit 8a13dcc

Please sign in to comment.