-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
47 lines (35 loc) · 1.38 KB
/
main.cpp
File metadata and controls
47 lines (35 loc) · 1.38 KB
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
#include "pch.h"
#include "cwe_api.h"
#include "SA2ModLoader.h"
#include "ModelInfo.h"
extern "C"
{
//registering data functions.
void (*RegisterDataFunc)(void* ptr);
//NJS Type texture name and texture list. As is for old documentation.
NJS_TEXNAME ExampleTex[10];
NJS_TEXLIST example_texlist = { arrayptrandlength(ExampleTex) };
//Define models
ModelInfo* MDLExampleAccessory;
//create a UID for your accessory
int ExampleAccessoryID;
//Black Market Item Attributes
BlackMarketItemAttributes BMExampleAccessory = { 1000, 500, 0, -1, -1, 0 };
void CWELoad(CWE_REGAPI* cwe_api)
{
//register your textures here (by filename.pak)
cwe_api->RegisterChaoTexlistLoad("ExampleAccessoryTex", &example_texlist);
//register your accessory here
ExampleAccessoryID = cwe_api->RegisterChaoAccessory(Generic1, MDLExampleAccessory->getmodel(), &example_texlist, &BMExampleAccessory, "Example Accessory", "Example Description");
}
__declspec(dllexport) void Init(const char* path)
{
HMODULE h = GetModuleHandle(L"CWE");
std::string pathStr = std::string(path) + "\\";
//Tell what models need to be associated to their variables here.
MDLExampleAccessory = new ModelInfo(pathStr + "ExampleAccessory.sa2mdl");
RegisterDataFunc = (void (*)(void* ptr))GetProcAddress(h, "RegisterDataFunc");
RegisterDataFunc(CWELoad);
}
__declspec(dllexport) ModInfo SA2ModInfo = { ModLoaderVer };
}