-
Notifications
You must be signed in to change notification settings - Fork 2
/
papyrus.h
47 lines (39 loc) · 1.23 KB
/
papyrus.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#pragma once
uintptr_t oldAddress;
namespace Papyrus
{
class DisableLevelUpMenu
{
public:
void forceLvlUp()
{
RE::PlayerCharacter::GetSingleton()->skills->AdvanceLevel(false);
}
static inline bool disableLevelUpMenu(RE::StaticFunctionTag*)
{
//oldAddress = SKSE::GetTrampoline().write_call<5>(REL::ID(52510).address() + 0x1012, &forceLvlUp); //AE
oldAddress = SKSE::GetTrampoline().write_call<5>(REL::ID(51638).address() + 0xf8e, &forceLvlUp); //SSE
return true;
}
static inline bool enableLevelUpMenu(RE::StaticFunctionTag*)
{
if (oldAddress) {
//SKSE::GetTrampoline().write_call<5>(REL::ID(52510).address() + 0x1012, oldAddress); //AE
SKSE::GetTrampoline().write_call<5>(REL::ID(51638).address() + 0xf8e, oldAddress); //SSE
return true;
}
}
static inline bool RegisterFuncs(RE::BSScript::IVirtualMachine* a_vm)
{
a_vm->RegisterFunction("disableLevelUpMenu", "NoLevelUpMenu", disableLevelUpMenu);
a_vm->RegisterFunction("enableLevelUpMenu", "NoLevelUpMenu", enableLevelUpMenu);
logger::info("Registered funcs for NoLevelUpMenu.");
return true;
}
};
inline bool Register(RE::BSScript::IVirtualMachine* a_vm)
{
DisableLevelUpMenu::RegisterFuncs(a_vm);
return true;
}
}