-
Notifications
You must be signed in to change notification settings - Fork 5
/
GECKUtility.h
445 lines (400 loc) · 11 KB
/
GECKUtility.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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
#pragma once
#include "NiObjects.h"
extern void(__cdecl* SaveWindowPositionToINI)(HWND, const char*);
extern HWND g_mainWindowToolbar;
struct ObjectPalette
{
enum
{
kListView = 1018,
kComboBox = 1021
};
struct Object
{
char* name; // 00
UInt16 unk04; // 04
UInt16 unk06; // 06
int formID; // 08
int conformToSlope; // 0C
float sinkMin; // 10
float sinkMax; // 14
float scaleMin; // 18
float scaleMax; // 1C
float xMin; // 20
float xMax; // 24
float yMin; // 28
float yMax; // 2C
float zMin; // 30
float zMax; // 34
};
ObjectPalette::Object* current; // 00
tList<ObjectPalette::Object> list; // 04
UInt32 sPaletteFileNameSetting; // 0C
char* paletteName; // 10
static ObjectPalette* GetSingleton();
static HWND GetWindow();
};
struct RenderWindow
{
struct SelectedData
{
static SelectedData* GetSelected();
static SelectedData* GetClipboard();
struct List
{
TESObjectREFR* ref;
List* prev;
List* next;
};
List* selectedForms;
UInt32 numItems;
NiPoint3 pos;
float maxDistFromCenter;
};
static HWND GetWindow();
static bool GetMousePos(NiPoint3* aPosOut, NiPoint3* aRotOut = nullptr);
static TESObjectCELL* GetCurrentCell();
static bool InLandscapeEditingMode();
};
struct ObjectsView
{
static HWND GetWindow();
static HWND GetListView();
static HWND GetTreeView();
static void Refresh();
struct TreeViewItem
{
UInt32 nodeId;
UInt32 rootNodeId;
char fullPath[MAX_PATH];
char nodeName[MAX_PATH];
};
};
struct CellView
{
static HWND GetWindow();
};
struct HistoryManager
{
enum UndoType
{
kUndoType_ColorLand = 0x5,
kUndoType_PaintLand = 0x6,
};
struct Element
{
UInt32 count000;
UInt32 unk004;
TESForm* form;
UInt32 undoType;
NiPoint3 rotation;
NiPoint3 refPos;
TESObjectCELL* parentCell;
UInt32 unk02C;
UInt32 unk030;
UInt32 unk034;
UInt32 unk038;
UInt32 unk03C;
UInt32 unk040;
UInt32 undoPaintLandData;
void* portalRefData;
void* occlusionPlaneData;
NiPoint3* primitivePlaneBoundsX;
UInt32 primitivePlaneBoundsY;
UInt32 primitivePlaneBoundsZ;
HistoryManager::Element* ptr06C;
UInt32 prev;
};
HistoryManager::Element* element;
HistoryManager::Element* current;
static HistoryManager* GetSingleton();
void ClearHistoryForCurrentElement();
void AddAction(int aiActionType, RenderWindow::SelectedData* apSelectedForms);
void Undo();
};
struct RenderData
{
NiWindow* niWindow;
NiNode* pNode;
NiCamera* pCamera;
static RenderData* GetSingleton();
};
// functions for getting and setting the render window camera
void GetCameraViewMatrix(NiMatrix33* out);
void SetCameraViewMatrix(NiMatrix33* newView);
void GetCameraPos(NiPoint3* outPosition);
void SetCameraPos(NiPoint3* newPos);
void GetCamera(NiPoint3* outPosition, NiMatrix33* outDirection);
void SetCamera(NiPoint3* pos, NiMatrix33* direction);
void SetTimeOfDay(float time);
void ToggleRenderWindowAllowCellLoads(bool toggle);
bool GetIsRenderWindowAllowCellLoads();
void SetIsShowWater(bool state);
bool GetIsShowWater();
bool GetIsShowPortalsAndRooms();
void SetIsShowPortalsAndRooms(bool state);
long GetPreviousRenderWindowSize();
int GetPreviousRenderWindowWidth();
int GetPreviousRenderWindowHeight();
void RefreshLightMarkers();
bool GetIsShowLightMarkers();
void SetIsShowLightMarkers(bool state);
void RefreshSoundMarkers();
bool GetIsShowSoundMarkers();
void SetIsShowSoundMarkers(bool state);
void SetFlycamMode(int state);
int GetFlycamMode();
class NavMeshEditorData;
class NiTriShape;
class PathingSolution;
class NavMesh;
class NavMeshEditEdge;
class NavMeshEditVertex;
class NavMeshEditTriangle;
class NavMeshEditObject
{
public:
virtual void* GetRTTI();
NiTriShape* triShape;
NavMesh* navMesh;
void* triShapeIdx;
};
class NavMeshEditVertex : public NavMeshEditObject
{
public:
BSSimpleArray<NavMeshEditTriangle> triangleArray;
BSSimpleArray<NavMeshEditEdge> edgeArray;
UInt16 vertexId;
UInt32 unk34;
};
class NavMeshEditTriangle : public NavMeshEditObject
{
public:
NavMeshEditVertex* vertices[3];
NavMeshEditEdge* edges[3];
UInt16 idx;
UInt32 unk2C;
};
class NavMeshEditEdge : public NavMeshEditObject
{
public:
BSSimpleArray<NavMeshEditVertex> vertexArray;
BSSimpleArray<NavMeshEditTriangle> triangleArray;
};
struct NavMeshManager
{
struct UndoStack
{
struct NavMeshUndoData
{
BSSimpleArray<void> navMeshModifyUndoArray;
BSSimpleArray<void> navMeshMoveUndoArray;
BSSimpleArray<NavMesh> navMeshArray;
UInt8 byte30;
};
NavMeshUndoData* items[30];
UInt32 numItems;
};
struct VertexTriangleEdgeArrays
{
BSSimpleArray<NavMeshEditVertex*> vertices;
BSSimpleArray<NavMeshEditTriangle*> triangles;
BSSimpleArray<NavMeshEditEdge*> edges;
};
UInt32 unk000;
UInt8 isSelectVertices;
UInt8 isSelectTriangles;
UInt8 isSelectEdges;
UInt8 byte007;
VertexTriangleEdgeArrays arrayData;
UInt32 unk038;
UInt32 unk03C;
NiPoint3 pt040;
NiPoint3 pt04C;
NavMeshManager::UndoStack undoStack;
UInt32 unk0D4;
UInt32 unk0D8;
UInt32 unk0DC;
UInt32 unk0E0;
UInt32 unk0E4;
UInt32 unk0E8;
UInt32 unk0EC;
UInt32 unk0F0;
UInt32 unk0F4;
UInt32 unk0F8;
UInt32 unk0FC;
UInt32 unk100;
UInt32 unk104;
UInt32 unk108;
UInt32 unk10C;
UInt32 unk110;
UInt32 unk114;
UInt32 unk118;
UInt32 unk11C;
UInt32 unk120;
PathingSolution* pPathingSolution;
UInt32 unk128;
UInt32 flags;
UInt32 unk130;
UInt8 byte134;
UInt8 byte135;
UInt8 byte136;
UInt8 bSingleCellViewMode;
UInt32 unk138;
UInt32 unk13C;
BSSimpleArray<void> pointArray140;
BSSimpleArray<void> navMeshWarningDataArray;
UInt32 unk160;
UInt8 byte164;
void Undo();
static NavMeshManager* GetSingleton();
static bool IsActive();
};
enum WindowMessages
{
BSMsg_HandleDrop = 0x407,
BSMsg_AcceptsDropType = 0x408,
};
struct OpenWindows
{
static tList<HWND>* GetWindowList();
};
struct RenderWindowHotkey
{
enum eKeys
{
kRenderHotkey_ToggleFlyCam = 0x0,
kRenderHotkey_ToggleBatchDialog = 0x1,
kRenderHotkey_ToggleOrthographicMode = 0x2,
kRenderHotkey_Navmesh_FinalizeCell = 0x3,
kRenderHotkey_ShowHideSelectedObjectS = 0x4,
kRenderHotkey_ShowHideEnableStateParents = 0x5,
kRenderHotkey_ShowHideEnableStateOppositeParents = 0x6,
kRenderHotkey_Navmesh_FindCover = 0x7,
kRenderHotkey_Navmesh_OpenStandardGenerationDialog = 0x8,
kRenderHotkey_FreezeCamera = 0x9,
kRenderHotkey_Navmesh_OpenAdvancedGenerationDialog = 0xA,
kRenderHotkey_ToggleDebugGeometry = 0xB,
kRenderHotkey_Navmesh_AddATriangleOrQuad = 0xC,
kRenderHotkey_ToggleBrightLights = 0xD,
kRenderHotkey_FindBadBound = 0xE,
kRenderHotkey_CreateMultiboundRef = 0xF,
kRenderHotkey_ShowLandBorders = 0x10,
kRenderHotkey_CycleThroughViews = 0x11,
kRenderHotkey_ToggleSelectionCulling = 0x12,
kRenderHotkey_ToggleNonLandCulling = 0x13,
kRenderHotkey_Copy = 0x14,
kRenderHotkey_DropCamera = 0x15,
kRenderHotkey_Navmesh_ClearSelection = 0x16,
kRenderHotkey_CloneCopyAndPaste = 0x17,
kRenderHotkey_ClearSelection = 0x18,
kRenderHotkey_ToggleEditColors = 0x19,
kRenderHotkey_ToggleNavmeshEdit = 0x1A,
kRenderHotkey_Navmesh_OpenEdgePropertiesDialog = 0x1B,
kRenderHotkey_Navmesh_SelectTriangleByIndex = 0x1C,
kRenderHotkey_Navmesh_DropVertices = 0x1D,
kRenderHotkey_SearchAndReplace = 0x1E,
kRenderHotkey_DropSelection = 0x1F,
kRenderHotkey_RaiseSelection = 0x20,
kRenderHotkey_Navmesh_ToggleEdgeSelectMode = 0x21,
kRenderHotkey_Navmesh_UnhideAllNavmeshes = 0x22,
kRenderHotkey_Navmesh_HideSelectedNavmeshes = 0x23,
kRenderHotkey_ToggleMeshEditingMode = 0x24,
kRenderHotkey_Navmesh_InverseFloodFill = 0x25,
kRenderHotkey_OpenTextureUseDialog = 0x26,
kRenderHotkey_GetObjectData = 0x27,
kRenderHotkey_LoadCellForSelectedObject = 0x28,
kRenderHotkey_ToggleLandCulling = 0x29,
kRenderHotkey_ToggleLightRadius = 0x2A,
kRenderHotkey_Navmesh_MergeSelectedVertices = 0x2B,
kRenderHotkey_Navmesh_MergeSelectedVerticesAlt = 0x2C,
kRenderHotkey_MoveClipboardReferences = 0x2D,
kRenderHotkey_ToggleMarkers = 0x2E,
kRenderHotkey_Navmesh_ToggleSingleCellViewMode = 0x2F,
kRenderHotkey_Navmesh_ToggleWater = 0x30,
kRenderHotkey_Navmesh_ToggleNoLargeCreature = 0x31,
kRenderHotkey_Navmesh_TogglePreferred = 0x32,
kRenderHotkey_PortalMode = 0x33,
kRenderHotkey_SaveLocalMapSnapshot = 0x34,
kRenderHotkey_ToggleLocationSnap = 0x35,
kRenderHotkey_ToggleRotationSnap = 0x36,
kRenderHotkey_ToggleReferenceSnap = 0x37,
kRenderHotkey_Navmesh_DeleteSelection = 0x38,
kRenderHotkey_RenameSoundFiles = 0x39,
kRenderHotkey_ScaleSelected = 0x3A,
kRenderHotkey_Navmesh_SwapEdge = 0x3B,
kRenderHotkey_Navmesh_ToggleSelectableTriangles = 0x3C,
kRenderHotkey_PlaceCameraAboveSelection = 0x3D,
kRenderHotkey_ToggleOcclusionPlanes = 0x3E,
kRenderHotkey_Navmesh_ToggleSelectableVertices = 0x3F,
kRenderHotkey_Paste = 0x40,
kRenderHotkey_PasteInPlace = 0x41,
kRenderHotkey_Navmesh_ChangeDrawMode = 0x42,
kRenderHotkey_ToggleWaterCulling = 0x43,
kRenderHotkey_ToggleWireframe = 0x44,
kRenderHotkey_SwapEditorWater = 0x45,
kRenderHotkey_GroupStaticRefs = 0x46,
kRenderHotkey_COUNT = 0x47,
};
enum eRenderWindowHotkeyCategory : UInt32
{
kRenderHotkeyCategory_General = 0x0,
kRenderHotkeyCategory_Navmesh = 0x1,
kRenderHotkeyCategory_Camera = 0x2,
kRenderHotkeyCategory_Visibility = 0x3,
kRenderHotkeyCategory_Clipboard = 0x4,
};
enum RenderWindowHotkeyFlag : unsigned __int8
{
kRenderWindowPreferenceFlag_NONE = 0,
kRenderWindowPreferenceFlag_Shift = 0x1,
kRenderWindowPreferenceFlag_Ctrl = 0x2,
kRenderWindowPreferenceFlag_Alt = 0x4,
kRenderWindowPreferenceFlag_Z = 0x8,
kRenderWindowPreferenceFlag_Navmesh = 0x40,
kRenderWindowPreferenceFlag_LowPriority = 0x80, // loses conflicts to combos that don't have this flag
};
struct __declspec(align(2)) KeyCombo
{
union
{
struct
{
UInt8 key;
UInt8 flags;
};
unsigned short data;
};
KeyCombo(UInt8 key, UInt8 flags) : key(key), flags(flags) {};
};
const char* sName;
const char* sInternalName;
eRenderWindowHotkeyCategory uiCategory;
KeyCombo kDefaultCombo;
KeyCombo kCombo;
UInt32 bIsEditAllowed;
RenderWindowHotkey(const char* name,
const char* internalName = "",
UInt8 defaultKey = 0,
RenderWindowHotkeyFlag defaultFlags = kRenderWindowPreferenceFlag_NONE,
eRenderWindowHotkeyCategory category = kRenderHotkeyCategory_General,
UInt32 bIsEditAllowed = 1)
: sName(name), sInternalName(internalName), uiCategory(category),
bIsEditAllowed(bIsEditAllowed), kDefaultCombo(defaultKey, defaultFlags), kCombo(defaultKey, defaultFlags) {};
static RenderWindowHotkey* GetArray() { return (RenderWindowHotkey*)0xE8C9A0; };
};
STATIC_ASSERT(sizeof(RenderWindowHotkey) == 0x14);
void AddFormsToListView(HWND listView, tList<TESForm>* forms, bool(__cdecl* filterFn)(TESForm*, void*) = nullptr, void* filterData = nullptr);
void OpenForm(TESForm* form, HWND parentHwnd = nullptr);
void RunCallbackOnAllCellRefs(void (*callback)(TESObjectREFR*));
BOOL __stdcall _CreateProcessA(LPSTR exePath, LPPROCESS_INFORMATION lpProcessInformation);
void* Window_GetExtraData(HWND hWnd, int code);
union Color
{
UInt32 rgba;
struct
{
UInt8 a, b, g, r;
};
};
LRESULT __cdecl TESCSMain__WriteToStatusBar(unsigned int statusBarId, const char* msg);