Skip to content

Commit

Permalink
feat: add IsPlayerCharacterInChargen and IsMenuOpen (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
TommInfinite authored Sep 19, 2023
1 parent d9de5ea commit 48e0bb8
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CommonLibSF/include/RE/A/Actor.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ namespace RE
return *singleton;
}

inline static bool IsPlayerCharacterInChargen()
{
auto PC = PlayerCharacter();
return *(stl::adjust_pointer<bool>(PC, 0xF24));
}

// add
virtual void Unk_130(); // 130
virtual void Unk_131(); // 131
Expand Down
1 change: 1 addition & 0 deletions CommonLibSF/include/RE/Starfield.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,4 @@
#include "RE/T/TESResponse.h"
#include "RE/T/TESSpellList.h"
#include "RE/T/TESTopicInfo.h"
#include "RE/U/UI.h"
21 changes: 21 additions & 0 deletions CommonLibSF/include/RE/U/UI.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
namespace RE
{
class UI
{
public:
inline static UI* GetSingleton()
{
static REL::Relocation<UI**> singleton{ REL::Offset(0x056EE0D0) };
return *singleton;
}

bool IsMenuOpen(const BSFixedString& a_name)
{
using func_t = decltype(&UI::IsMenuOpen);
REL::Relocation<func_t> func{ REL::Offset(0x02E7095C) };
return func(this, a_name);
}

};

}

0 comments on commit 48e0bb8

Please sign in to comment.