-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy patharcdps_structs.h
96 lines (78 loc) · 3.49 KB
/
arcdps_structs.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
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
84
85
86
87
88
89
90
91
92
93
94
95
96
#pragma once
#include "arcdps_structs_slim.h"
#include <string>
#include <Windows.h>
bool is_player(const ag* new_player);
typedef uintptr_t (*WindowCallbackSignature)(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
typedef uintptr_t (*CombatCallbackSignature)(cbtevent* ev, ag* src, ag* dst, const char* skillname, uint64_t id, uint64_t revision);
typedef uintptr_t (*ImguiCallbackSignature)(uint32_t not_charsel_or_loading);
typedef uintptr_t (*OptionsEndCallbackSignature)();
typedef uintptr_t (*OptionsWindowsCallbackSignature)(const char* windowname);
typedef struct arcdps_exports {
uintptr_t size; /* size of exports table */
uint32_t sig; /* pick a number between 0 and uint32_t max that isn't used by other modules */
uint32_t imguivers; /* set this to IMGUI_VERSION_NUM. if you don't use imgui, 18000 (as of 2021-02-02) */
const char* out_name; /* name string */
const char* out_build; /* build string */
WindowCallbackSignature wnd_nofilter; /* wndproc callback, fn(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) */
CombatCallbackSignature combat; /* combat event callback, fn(cbtevent* ev, ag* src, ag* dst, char* skillname, uint64_t id, uint64_t revision) */
ImguiCallbackSignature imgui; /* id3dd9::present callback, before imgui::render, fn(uint32_t not_charsel_or_loading) */
OptionsEndCallbackSignature options_end; /* id3dd9::present callback, appending to the end of options window in arcdps, fn() */
CombatCallbackSignature combat_local; /* combat event callback like area but from chat log, fn(cbtevent* ev, ag* src, ag* dst, char* skillname, uint64_t id, uint64_t revision) */
WindowCallbackSignature wnd_filter; /* wndproc callback like above, input filered using modifiers */
OptionsWindowsCallbackSignature options_windows; /* called once per 'window' option checkbox, with null at the end, non-zero return disables drawing that option, fn(char* windowname) */
} arcdps_exports;
static_assert(sizeof(arcdps_exports) == 88);
typedef void* (*MallocSignature)(size_t);
typedef void (*FreeSignature)(void*);
typedef arcdps_exports* (*ModInitSignature)();
typedef uintptr_t (*ModReleaseSignature)();
struct ID3D11Device;
struct ImGuiContext;
/**
* `dxver`: The used directx version (either 9 or 11)
* `dxptr`: The pointer to the directx context. For dx9 `IDirect3DDevice9*`. For dx11 `IDXGISwapChain`.
*
* To get the Device from the Swapchain:
* ```C++
* ID3D11Device* pDevice;
* g_pSwapChain->GetDevice( __uuidof(pDevice), (void**)&pDevice);
* ```
*/
typedef ModInitSignature (*GetInitAddrSignature)(const char* arcversion, ImGuiContext* imguictx, void* dxptr, HMODULE arcdll, MallocSignature mallocfn, FreeSignature freefn, UINT dxver);
typedef ModReleaseSignature (*GetReleaseAddrSignature)();
// ARCPDS dll-exports
typedef uint64_t (*arc_export_func_u64)();
typedef void(*e3_func_ptr)(const char* str);
// Define these exports in your main.cpp
extern arc_export_func_u64 ARC_EXPORT_E6;
extern arc_export_func_u64 ARC_EXPORT_E7;
extern e3_func_ptr ARC_LOG_FILE;
extern e3_func_ptr ARC_LOG;
// additional enum for alignment
enum class Alignment {
Left,
Center,
Right,
Unaligned,
};
std::string to_string(Alignment alignment);
enum class Position {
Manual,
ScreenRelative,
WindowRelative,
};
std::string to_string(Position position);
enum class CornerPosition {
TopLeft,
TopRight,
BottomLeft,
BottomRight,
};
std::string to_string(CornerPosition position);
enum class SizingPolicy {
SizeToContent,
SizeContentToWindow,
ManualWindowSize,
};
std::string to_string(SizingPolicy sizingPolicy);