Enderal SE https://mod.pub/enderal-se/38-enderal-se
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
879 B
35 lines
879 B
#pragma once
|
|
|
|
#include "HeroMenuPatch.h"
|
|
|
|
class TweenMenuPatch final : public RE::TweenMenu
|
|
{
|
|
public:
|
|
static void Install();
|
|
|
|
private:
|
|
static void OpenMenu(RE::IMenu* tweenMenu, std::int32_t index)
|
|
{
|
|
using func_t = decltype(&OpenMenu);
|
|
// Checked: 1.5.97, 1.6.640, 1.6.659, 1.6.1130
|
|
REL::Relocation<func_t> func{ REL::VariantID(51845, 52718, 0x8FE7E0) };
|
|
return func(tweenMenu, index);
|
|
}
|
|
|
|
void AcceptEx(CallbackProcessor* a_cbReg)
|
|
{
|
|
_AcceptFn(this, a_cbReg);
|
|
|
|
fxDelegate->callbacks.Remove("OpenHighlightedMenu");
|
|
a_cbReg->Process("OpenHighlightedMenu", [](const RE::FxDelegateArgs& args) {
|
|
auto index = args[0].GetSInt();
|
|
if (index <= 1) {
|
|
HeroMenuPatch::OpenHeroMenu();
|
|
} else if (index <= 4) {
|
|
OpenMenu(RE::UI::GetSingleton()->GetMenu(MENU_NAME).get(), index);
|
|
}
|
|
});
|
|
}
|
|
|
|
inline static REL::Relocation<decltype(&Accept)> _AcceptFn;
|
|
};
|
|
|