-
Notifications
You must be signed in to change notification settings - Fork 3
/
Defination.h
456 lines (389 loc) · 11.8 KB
/
Defination.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
446
447
448
449
450
451
452
453
454
455
456
#pragma once
#include "F4SE/GameMenus.h"
#include "F4SE/GameData.h"
#include "F4SE/GameReferences.h"
#include "F4SE/GameExtraData.h"
#include "F4SE/GameRTTI.h"
#include "F4SE/GameInput.h"
template<typename T>
inline void Register(GFxValue * dst, const char * name, T value)
{
}
template<>
inline void Register(GFxValue * dst, const char * name, SInt32 value)
{
GFxValue fxValue;
fxValue.SetInt(value);
dst->SetMember(name, &fxValue);
}
template<>
inline void Register(GFxValue * dst, const char * name, UInt32 value)
{
GFxValue fxValue;
fxValue.SetUInt(value);
dst->SetMember(name, &fxValue);
}
template<>
inline void Register(GFxValue * dst, const char * name, double value)
{
GFxValue fxValue;
fxValue.SetNumber(value);
dst->SetMember(name, &fxValue);
}
template<>
inline void Register(GFxValue * dst, const char * name, bool value)
{
GFxValue fxValue;
fxValue.SetBool(value);
dst->SetMember(name, &fxValue);
}
inline void RegisterString(GFxValue * dst, GFxMovieRoot * view, const char * name, const char * str)
{
GFxValue fxValue;
view->CreateString(&fxValue, str);
dst->SetMember(name, &fxValue);
}
class ButtonHintBar : public BSGFxShaderFXTarget
{
public:
UInt64 unkB0[(0xD8 - 0xB0) >> 3];
};
STATIC_ASSERT(sizeof(ButtonHintBar) == 0xD8);
struct ViewCasterUpdateEvent
{
UInt32 crosshairHandler; // 00 RefHandler
UInt32 unk04; // 04
UInt32 unk08; // 08
UInt32 unk0C; // 0C
UInt64 unk10; // 10
UInt64 unk18; // 18
UInt32 unk20; // 20
UInt32 unk24; // 24
bool unk28; // 28
UInt32 unk2C; // 2C
bool isNPC; // 30 ?
float unk34; // 34
bool canInteractive; // 38
};
STATIC_ASSERT(sizeof(ViewCasterUpdateEvent) == 0x40);
class ViewCasterUpdateEventSource// : public BSTEventSink<BSTValueRequestEvent<ViewCasterUpdateEvent>> //
{
public:
//void ** vtbl; //02D27530
DEFINE_MEMBER_FUNCTION(GetCrosshairRefHandle, UInt32 *, 0x9DDC60, UInt32& refHandle); // called by readyweaponhandler::processbuttonevent.
};
extern RelocPtr<ViewCasterUpdateEventSource *> g_viewCasterUpdateEventSource;
//0x168
class TESKey : public TESBoundObject
{
public:
enum { kTypeID = kFormType_KEYM };
TESFullName fullName; // 68
BGSModelMaterialSwap materialSwap; // 78
TESIcon icon; // B8
TESValueForm value; // C8
TESWeightForm weight; // D8
BGSDestructibleObjectForm destructible; // E8
BGSMessageIcon messageIcon; // F8
BGSPickupPutdownSounds pickupSounds; // 110
BGSKeywordForm keyword; // 128
BGSFeaturedItemMessage featuredMessage; // 148
UInt64 unk158[2]; // 158
};
STATIC_ASSERT(sizeof(TESKey) == 0x168);
class TESObjectBOOK : public TESBoundObject
{
public:
enum { kTypeID = kFormType_BOOK };
enum // type - these are technically flags
{
kType_None = 0,
kType_Skill = 1 << 0, // 01
kType_CantBeTaken = 1 << 1, // 02
kType_Spell = 1 << 2, // 04 takes priority over skill
kType_Read = 1 << 3, // 08 set once the book is equipped by the player, along with the CHANGE_BOOK_READ (0x40) change flag
kType_AddPerk = 1 << 4
};
TESFullName fullName;
BGSModelMaterialSwap materialSwap;
TESIcon icon;
TESValueForm value;
TESWeightForm weight;
TESDescription description; // E8
BGSDestructibleObjectForm destructible;
BGSMessageIcon messageIcon;
BGSPickupPutdownSounds pickupSounds;
BGSKeywordForm keyword;
BGSFeaturedItemMessage featuredMessage;
UInt8 flags; // 0x170
BGSPerk * unk178;
UInt64 unk180;
void * unk188; // TESObjectSTAT
TESDescription description2;
};
STATIC_ASSERT(sizeof(TESObjectBOOK) == 0x1A8);
STATIC_ASSERT(offsetof(TESObjectBOOK, description) == 0xE8);
//0x108
class BGSNote : public TESBoundObject
{
public:
enum { kTypeID = kFormType_NOTE };
enum
{
kNote_SECN = 1,
kNote_GAME,
kNote_TERM
};
TESWeightForm weight; // 68
TESValueForm value; // 78
TESModel model; // 88
TESFullName fullName; // B8
TESIcon icon; // C8
BGSPickupPutdownSounds pickupSounds; // D8
BSFixedString swfName; // F0 //program name,maybe BSFixedString;
UInt32 linkedFormID; // F8 terminal or scene.
UInt32 unkFC; // FC padding
UInt8 holotapeType; // 100 scene: 1 swf: 2 terminal: 3
};
STATIC_ASSERT(sizeof(BGSNote) == 0x108);
class PipboyManager : public BSTEventSink<BSAnimationGraphEvent>,
public BSInputEventUser
{
public:
UInt64 singleton[2]; // 18
DEFINE_MEMBER_FUNCTION(PlayHolotape, void, 0xC1D140, BGSNote*, bool stop); // false. play with animation, without animation in power armor mode.
};
extern RelocPtr<PipboyManager *> g_pipboyManager;//59F81A0
class PlayerInputHandler : public BSInputEventUser
{
};
//0x28
class ReadyWeaponHandler : public PlayerInputHandler
{
public:
//void ** vtbl; //02D5FA48
void * unk10;
bool unk18;
UInt32 unk1C;
bool unk20;
};
//0x20
class ExtraCount : public BSExtraData
{
public:
enum{ kExtraTypeID = kExtraData_Count };
ExtraCount();
virtual ~ExtraCount();
SInt16 count;
};
class ExtraReferenceHandle : public BSExtraData
{
public:
enum { kExtraTypeID = kExtraData_ReferenceHandle };
ExtraReferenceHandle();
virtual ~ExtraReferenceHandle();
UInt32 handle; // 08
};
//0x38
class BGSBaseAlias;
class TESPackage;
class ExtraAliasInstanceArray : public BSExtraData
{
public:
enum { kExtraTypeID = kExtraData_AliasInstanceArray };
ExtraAliasInstanceArray();
virtual ~ExtraAliasInstanceArray();
struct AliasInfo //need confirm.
{
TESQuest * quest;
BGSBaseAlias * alias;
tArray<TESPackage*> * packages;
};
tArray<AliasInfo*> aliases; // 18
UInt32 unk30;
UInt32 unk34;
};
STATIC_ASSERT(sizeof(ExtraAliasInstanceArray) == 0x38);
struct ObjectInstanceData
{
TESForm * form;
TBO_InstanceData * data;
};
struct DamageInfo
{
UInt32 type;
float damage;
};
struct ResistInfo
{
UInt32 type;
float resist;
};
struct InventoryItemStack
{
UInt64 unk00;
UInt64 unk08;
UInt64 unk10;
ExtraDataList * extraList;
};
struct InventoryItem
{
TESForm * form;
InventoryItemStack * stack;
};
template<typename T>
struct SimpleCollector
{
UInt64 unk00;
T * info;
UInt32 unk10;
UInt64 count;
};
class HUDRollover : public HUDComponentBase
{
public:
BSGFxShaderFXTarget RolloverName_tf; // 0x0F8
ButtonHintBar ButtonHintBar_mc; // 0x1A8
BSGFxShaderFXTarget LegendaryIcon_mc; // 0x280
BSGFxShaderFXTarget TaggedForSearchIcon_mc; // 0x330
UInt64 unk3E0[(0x5A8 - 0x3E0) >> 3]; // 0x3E0
DEFINE_MEMBER_FUNCTION(UpdateElements, void, 0xAB1840, BSFixedString &); //called by updatecomponents;
DEFINE_MEMBER_FUNCTION(ClearElements, void, 0xAB1AA0); //called by updatecomponents;
};
STATIC_ASSERT(sizeof(HUDRollover) == 0x5A8);
// 0x7F8
// ctor A89F00
class HUDQuickContainer : public HUDComponentBase
{
public:
struct ItemData
{
BSFixedString name; //maybe...
UInt32 count;
UInt64 flags;
};
//void ** vtbl; // 02D2E518
BSGFxShaderFXTarget ListHeaderAndBracket_mc; // 0x0F8
BSGFxShaderFXTarget BracketPairHolder_mc; // 0x1A8
BSGFxShaderFXTarget ListItems_mc; // 0x258
ButtonHintBar ButtonHintBar_mc; // 0x308
UInt64 ItemDataA[(0x418 - 0x3E0) >> 3]; // 0x3E0
UInt64 AButton[(0x4B0 - 0x418) >> 3]; // 0x418
UInt64 XButton[(0x548 - 0x4B0) >> 3]; // 0x4B0
UInt64 YButton[(0x5E0 - 0x548) >> 3]; // 0x548
UInt64 unk5E0[(0x710 - 0x5E0) >> 3]; // 0x5E0
//QuickContainerStateEvent int __fastcall sub_AA0D40(__int64 a1) source
UInt32 flags; // 0x710
ItemData itemData[5]; // 0x718 union?
UInt32 dataLen; // 0x790
UInt64 unk798[(0x7A8 - 0x798) >> 3]; // 0x798
BSFixedString refName; // 0x7A8
UInt64 unk7B0; // 0x7B0
SInt32 selectedIndex; // 0x7B8
UInt64 unk7C0; // 0x7C0
bool isDirty; // 0x7C8
UInt32 unk7CC; // 0x7CC
bool unk7D0; // 0x7D0
UInt64 unk7D8[(0x7F8 - 0x7D8) >> 3]; // 0x7D8
/*
26 +0D0 ptr: 0x0000020D134973C0: ?$BSTValueEventSink@VControlsRemappedEvent@@@@ *ptr: 0x00007ff6b59be500 | 0.000000, -0.000001: <no rtti>
27 +0D8 ptr: 0x0000020D134973C8: <no rtti> *ptr: 0x0000000000000000 | 0.000000, 0.000000: (null)
28 +0E0 ptr: 0x0000020D134973D0: <no rtti> *ptr: 0x0000000000000000 | 0.000000, 0.000000: (null)
*/
};
STATIC_ASSERT(sizeof(HUDQuickContainer) == 0x7F8);
STATIC_ASSERT(offsetof(HUDQuickContainer, refName) == 0x7A8);
extern RelocAddr<void *> g_HUDQuickContainerVTBL;
// 02D2EA78
class HUDQuickContainerDataModel : public BSInputEventUser
{
public:
//A92680
union DataOrPointer
{
SInt16 index;
SInt16 * indexs;
};
struct Entry
{
UInt32 index;
UInt32 unk04;
UInt32 flags;
UInt32 unk0C;
DataOrPointer stackIndex;
UInt64 unk18;
};
UInt64 eventSinks[(0x40 - 0x10) >> 3]; // 0x010
UInt64 unk040[(0xD0 - 0x40) >> 3]; // 0x040
UInt32 refHandle; // 0x0D0
UInt64 unk0D8[(0xF0 - 0xD8) >> 3]; // 0x0D8
UInt32 unk0F0; // 0x0F0
UInt32 type; // 0x0F4
UInt64 unk0F8[(0x210 - 0x0F8) >> 3]; // 0x0F8
Entry * entry; // 0x210
UInt64 unk218; // 0x218
UInt32 dataLen; // 0x220
UInt32 unk224; // 0x224
UInt8 unk228; // 0x228
UInt64 unk230[(0x270 - 0x230) >> 3]; // 0x230
UInt32 unk270; // 0x270
SInt32 selectedIndex; // 0x274
UInt64 unk278; // 0x278
UInt8 unk280; // 0x280
bool isPickUpKeyDown; // 0x281
//...
DEFINE_MEMBER_FUNCTION(PickUpItem, void, 0xA921C0);
};
STATIC_ASSERT(sizeof(HUDQuickContainerDataModel) == 0x288);
STATIC_ASSERT(offsetof(HUDQuickContainerDataModel, isPickUpKeyDown) == 0x281);
STATIC_ASSERT(sizeof(HUDQuickContainerDataModel::Entry) == 0x20);
STATIC_ASSERT(offsetof(HUDQuickContainerDataModel, unk224) == 0x224);
STATIC_ASSERT(offsetof(HUDQuickContainerDataModel, refHandle) == 0x0D0);
STATIC_ASSERT(offsetof(HUDQuickContainerDataModel, type) == 0x0F4);
//AB5F70
/*
VTBL: 02D2F838 OFFSET : 0010 CLASS : . ? AVHUDRolloverModel@@
>> DEPTH: 4 OFFSET : 0000 CLASS : . ? AVHUDRolloverModel@@
>> DEPTH: 0 OFFSET : 0020 CLASS : . ? AVUIDebugLogger_NoOp@nsUIDebug@@
>> DEPTH: 0 OFFSET : 0000 CLASS : . ? AV ? $BSTEventSink@UTESCommandModeEnterEvent@@@@
>> DEPTH: 0 OFFSET : 0008 CLASS : . ? AV ? $BSTEventSink@UTESCommandModeExitEvent@@@@
>> DEPTH: 0 OFFSET : 0010 CLASS : . ? AVBSInputEventUser@@
*/
class HUDRolloverModel
{
public:
UInt64 unk00[0x20 >> 3]; // 0x000
HUDQuickContainerDataModel quickContainerDataModel; // 0x020
//....
};
//A51780
class HUDDataModel
{
public:
UInt64 singleton[0x18 >> 3]; // 0x000
HUDRolloverModel rolloverModel; // 0x018 + 0x020
//...
inline HUDQuickContainerDataModel * GetQCData()
{
return &rolloverModel.quickContainerDataModel;
}
};
struct HUDModeEvent
{
tArray<BSFixedString> * modes;
};
class HUDModeEventSource
{
public:
UInt64 singleton[2];
BSTEventDispatcher<HUDModeEvent> source;
};
//extern RelocAddr<HUDQuickContainerDataModel *> g_qucikContainerDataModel; //5A81318
extern RelocPtr<HUDDataModel *> g_HUDDataModel;
extern RelocPtr<HUDModeEventSource *> g_HUDModeEventSource; //5A7F200
typedef void(*_PlayHolotape)(BGSNote *);
extern RelocAddr<_PlayHolotape> PlayHolotape; // called by pipboy menu.
typedef void(*_DisplayBookMenu)(BSString & description, ExtraDataList *, TESObjectREFR * pRef, TESObjectBOOK*, NiPoint3 & pos, NiMatrix43 & rot, float scale, bool showTakeButton); //true;
extern RelocAddr<_DisplayBookMenu> DisplayBookMenu;
using _CalcInstanceData = ObjectInstanceData *(*)(ObjectInstanceData & out, TESForm *, TBO_InstanceData *);
extern RelocAddr<_CalcInstanceData> CalcInstanceData; ///V1.10.26