parent
467852f52e
commit
9f95c8e68e
10 changed files with 67 additions and 9 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,39 @@ |
||||
#pragma once |
||||
|
||||
inline void OpenMenu(RE::IMenu* tweenMenu, std::int32_t index) |
||||
{ |
||||
using func_t = decltype(&OpenMenu); |
||||
REL::Relocation<func_t> func{ REL::RelocationID(51845, 51845) }; |
||||
return func(tweenMenu, index); |
||||
} |
||||
|
||||
class TweenMenuPatch final : public RE::TweenMenu |
||||
{ |
||||
public: |
||||
static void Install() |
||||
{ |
||||
REL::Relocation<uintptr_t> vtbl(RE::VTABLE_TweenMenu[0]); |
||||
_AcceptFn = vtbl.write_vfunc(0x1, &AcceptEx); |
||||
} |
||||
|
||||
private: |
||||
|
||||
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) { |
||||
RE::BSTSmartPointer<RE::BSScript::IStackCallbackFunctor> stackCallback; |
||||
RE::BSScript::Internal::VirtualMachine::GetSingleton()->DispatchStaticCall("_00E_HeroMenu", "Show", RE::MakeFunctionArguments(), stackCallback); |
||||
} else if (index <= 4) { |
||||
OpenMenu(RE::UI::GetSingleton()->GetMenu(MENU_NAME).get(), index); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
using AcceptFn = decltype(&Accept); |
||||
inline static REL::Relocation<AcceptFn> _AcceptFn; |
||||
}; |
@ -0,0 +1,5 @@ |
||||
Scriptname _00E_HeroMenu Hidden |
||||
|
||||
function Show() Global |
||||
((Game.GetForm(0x10AA2) as Quest).GetAlias(0) as _00E_Game_SkillmenuSC).OpenSkillmenu() |
||||
endfunction |
Loading…
Reference in new issue