-
Notifications
You must be signed in to change notification settings - Fork 7
/
main.cpp
84 lines (64 loc) · 1.78 KB
/
main.cpp
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#include "skse64/PluginAPI.h"
#include "skse64_common/BranchTrampoline.h"
#include <shlobj.h>
#define _USE_MATH_DEFINES
#include <math.h>
#include "Hooks.h"
#include "Utils.h"
#include "Scaleform.h"
#include "Settings.h"
#include "Console.h"
#include "Menus.h"
#include "Camera.h"
#include "ObjectRef.h"
#include "Controls.h"
#include "ScaleformUtil.h"
#include "Event.h"
IDebugLog gLog;
PluginHandle g_pluginHandle = kPluginHandle_Invalid;
void * g_moduleHandle = nullptr;
extern "C"
{
bool SKSEPlugin_Query(const SKSEInterface * skse, PluginInfo * info)
{
gLog.OpenRelative(CSIDL_MYDOCUMENTS, "\\My Games\\Skyrim Special Edition\\SKSE\\SimpleLockOn.log");
info->infoVersion = PluginInfo::kInfoVersion;
info->name = "SimpleLockOn plugin";
info->version = 2;
g_pluginHandle = skse->GetPluginHandle();
if (skse->isEditor)
{
_MESSAGE("loaded in editor, marking as incompatible");
return false;
}
if (!g_branchTrampoline.Create(1024 * 64))
{
_ERROR("couldn't create branch trampoline. this is fatal. skipping remainder of init process.");
return false;
}
if (!g_localTrampoline.Create(1024 * 64, g_moduleHandle))
{
_ERROR("couldn't create codegen buffer. this is fatal. skipping remainder of init process.");
return false;
}
return true;
}
bool SKSEPlugin_Load(const SKSEInterface * skse)
{
_MESSAGE("Load");
Settings::Load();
Tralala::PlayerCameraGetAddress();
Tralala::ConsoleGetAddresses();
Tralala::ControlsGetAddresses();
Tralala::EventGetAddresses();
Tralala::MenusGetAddresses();
Tralala::ObjectRefGetAddresses();
Tralala::ScaleformUtilGetAddresses();
Tralala::UtilsGetAddresses();
MainHooks::GetAddresses();
MainHooks::Install();
ConsoleCommand::GetAddress();
ConsoleCommand::Register();
return true;
}
}