Skip to content

Commit

Permalink
feat: add sink functions to ui
Browse files Browse the repository at this point in the history
  • Loading branch information
qudix committed Sep 30, 2023
1 parent 6f55335 commit c01b52e
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions CommonLibSF/include/RE/U/UI.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ namespace RE
public:
SF_RTTI_VTABLE(UI);

template <class T>
[[nodiscard]] auto GetEventSource()
{
return static_cast<BSTEventSource<T>*>(this);
}

inline static UI* GetSingleton()
{
static REL::Relocation<UI**> singleton{ REL::ID(878339) };
Expand All @@ -47,6 +53,18 @@ namespace RE
return func(this, a_name);
}

template <class T>
void RegisterSink(BSTEventSink<T>* a_sink)
{
GetEventSource<T>()->RegisterSink(a_sink);
}

template <class T>
void UnregisterSink(BSTEventSink<T>* a_sink)
{
GetEventSource<T>()->UnregisterSink(a_sink);
}

std::uint8_t pad178[0x278]; // 178
BSTArray<Scaleform::Ptr<IMenu>> menuStack; // 3F0
};
Expand Down

0 comments on commit c01b52e

Please sign in to comment.