forked from UE4SS-RE/UE4SSCPPTemplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dllmain_template.cpp
48 lines (40 loc) · 1.31 KB
/
dllmain_template.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
#include <Mod/CppUserModBase.hpp>
#include <DynamicOutput/DynamicOutput.hpp>
#include <Unreal/UObjectGlobals.hpp>
#include <Unreal/UObject.hpp>
using namespace RC;
using namespace RC::Unreal;
class MyAwesomeMod : public CppUserModBase
{
public:
MyAwesomeMod() : CppUserModBase()
{
ModName = STR("MyAwesomeMod");
ModVersion = STR("1.0");
ModDescription = STR("This is my awesome mod");
ModAuthors = STR("UE4SS Team");
// Do not change this unless you want to target a UE4SS version
// other than the one you're currently building with somehow.
//ModIntendedSDKVersion = STR("2.6");
Output::send<LogLevel::Verbose>(STR("MyAwesomeMod says hello\n"));
}
~MyAwesomeMod() override {}
auto on_update() -> void override {}
auto on_unreal_init() -> void override
{
auto Object = UObjectGlobals::StaticFindObject<UObject*>(nullptr, nullptr, STR("/Script/CoreUObject.Object"));
Output::send<LogLevel::Verbose>(STR("Object Name: {}\n"), Object->GetFullName());
}
};
#define MY_AWESOME_MOD_API __declspec(dllexport)
extern "C"
{
MY_AWESOME_MOD_API CppUserModBase* start_mod()
{
return new MyAwesomeMod();
}
MY_AWESOME_MOD_API void uninstall_mod(CppUserModBase* mod)
{
delete mod;
}
}