Skip to content

Commit 0f40916

Browse files
committed
Update after latest CS2 & Dota2 updates
1 parent 46e9b82 commit 0f40916

3 files changed

Lines changed: 85 additions & 77 deletions

File tree

src/pulse_metadata.h

Lines changed: 66 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,52 @@
44

55
#include <sstream>
66

7+
struct SoundEvent_t
8+
{
9+
uint64 m_unk001;
10+
CUtlString m_SoundName;
11+
};
12+
713
struct SchemaMetadataEntryData_t;
814

9-
#if SOURCE_ENGINE == SE_CS2
15+
#if SOURCE_ENGINE != SE_DEADLOCK
1016
enum PulseValueType_t : int32
1117
{
1218
PVAL_INVALID = -1,
19+
PVAL_VOID = -1,
1320
PVAL_BOOL = 0,
1421
PVAL_INT = 1,
1522
PVAL_FLOAT = 2,
1623
PVAL_STRING = 3,
17-
PVAL_VEC3 = 4,
18-
PVAL_TRANSFORM = 5,
19-
PVAL_COLOR_RGB = 6,
20-
PVAL_EHANDLE = 7,
21-
PVAL_RESOURCE = 8,
22-
PVAL_SNDEVT_GUID = 9,
23-
PVAL_SNDEVT_NAME = 10,
24-
PVAL_ENTITY_NAME = 11,
25-
PVAL_OPAQUE_HANDLE = 12,
26-
PVAL_TYPESAFE_INT = 13,
27-
PVAL_CURSOR_FLOW = 14,
28-
PVAL_ANY = 15,
29-
PVAL_SCHEMA_ENUM = 16,
30-
PVAL_PANORAMA_PANEL_HANDLE = 17,
31-
PVAL_TEST_HANDLE = 18,
32-
PVAL_COUNT = 19,
24+
PVAL_VEC2 = 4,
25+
PVAL_VEC3 = 5,
26+
PVAL_QANGLE = 6,
27+
PVAL_VEC3_WORLDSPACE = 7,
28+
PVAL_VEC4 = 8,
29+
PVAL_TRANSFORM = 9,
30+
PVAL_TRANSFORM_WORLDSPACE = 10,
31+
PVAL_COLOR_RGB = 11,
32+
PVAL_GAMETIME = 12,
33+
PVAL_EHANDLE = 13,
34+
PVAL_RESOURCE = 14,
35+
PVAL_RESOURCE_NAME = 15,
36+
PVAL_SNDEVT_GUID = 16,
37+
PVAL_SNDEVT_NAME = 17,
38+
PVAL_ENTITY_NAME = 18,
39+
PVAL_OPAQUE_HANDLE = 19,
40+
PVAL_TYPESAFE_INT = 20,
41+
PVAL_MODEL_MATERIAL_GROUP = 21,
42+
PVAL_CURSOR_FLOW = 22,
43+
PVAL_VARIANT = 23,
44+
PVAL_UNKNOWN = 24,
45+
PVAL_SCHEMA_ENUM = 25,
46+
PVAL_PANORAMA_PANEL_HANDLE = 26,
47+
PVAL_TEST_HANDLE = 27,
48+
PVAL_ARRAY = 28,
49+
PVAL_TYPESAFE_INT64 = 29,
50+
PVAL_COUNT = 30,
3351
};
34-
#elif SOURCE_ENGINE != SE_CS2
52+
#elif SOURCE_ENGINE == SE_DEADLOCK
3553
enum PulseValueType_t : int32
3654
{
3755
PVAL_INVALID = -1,
@@ -73,7 +91,6 @@ struct PulseParamType
7391

7492
switch(m_Type)
7593
{
76-
#if SOURCE_ENGINE != SE_CS2
7794
case PVAL_ARRAY:
7895
{
7996
if(m_SubType && m_SubType->IsValid())
@@ -92,16 +109,19 @@ struct PulseParamType
92109
case PVAL_VEC3_WORLDSPACE: ss << "vec3_world"; break;
93110
case PVAL_TRANSFORM_WORLDSPACE: ss << "transform_world"; break;
94111
case PVAL_GAMETIME: ss << "game_time"; break;
95-
#endif
96112

97113
case PVAL_BOOL: ss << "bool"; break;
98114
case PVAL_INT: ss << "int"; break;
99115
case PVAL_FLOAT: ss << "float"; break;
100116
case PVAL_STRING: ss << "string"; break;
117+
118+
#if SOURCE_ENGINE == SE_CS2 || SOURCE_ENGINE == SE_DOTA
119+
case PVAL_VEC2: ss << "vec2"; break;
120+
case PVAL_VEC4: ss << "vec4"; break;
121+
#endif
122+
101123
case PVAL_VEC3: ss << "vec3"; break;
102-
#if SOURCE_ENGINE != SE_CS2
103124
case PVAL_QANGLE: ss << "qangle"; break;
104-
#endif
105125
case PVAL_TRANSFORM: ss << "transform"; break;
106126
case PVAL_COLOR_RGB: ss << "color"; break;
107127
case PVAL_EHANDLE: ss << "ehandle<" << (m_LibraryClass ? m_LibraryClass : "" ) << ">"; break;
@@ -112,7 +132,12 @@ struct PulseParamType
112132
case PVAL_OPAQUE_HANDLE:ss << (m_LibraryClass ? m_LibraryClass : "schema" ) << "*"; break;
113133
case PVAL_TYPESAFE_INT: ss << (m_LibraryClass ? m_LibraryClass : "!int"); break;
114134
case PVAL_CURSOR_FLOW: ss << "cursor"; break;
135+
#if SOURCE_ENGINE == SE_CS2 || SOURCE_ENGINE == SE_DOTA
136+
case PVAL_VARIANT: ss << "variant"; break;
137+
case PVAL_UNKNOWN: ss << "unknown"; break;
138+
#else
115139
case PVAL_ANY: ss << "any"; break;
140+
#endif
116141
case PVAL_SCHEMA_ENUM: ss << "enum {" << m_LibraryClass << "}"; break;
117142
case PVAL_PANORAMA_PANEL_HANDLE: ss << "panorama_panel_handle"; break;
118143
case PVAL_TEST_HANDLE: ss << "testhandle<" << (m_LibraryClass ? m_LibraryClass : "") << ">"; break;
@@ -143,26 +168,13 @@ struct PulseParamType
143168
META_CONPRINTF( "Found valid library class (%s) field for type (%d).\n", m_LibraryClass, m_Type );
144169
}
145170
}
146-
147-
#if SOURCE_ENGINE == SE_CS2
148-
if(m_IsArray)
149-
{
150-
ss << "[]";
151-
}
152-
#endif
153171

154172
return ss.str();
155173
}
156174

157-
#if SOURCE_ENGINE == SE_CS2
158-
bool m_IsArray;
159-
PulseValueType_t m_Type;
160-
const char *m_LibraryClass;
161-
#else
162175
PulseValueType_t m_Type;
163176
PulseParamType *m_SubType;
164177
const char *m_LibraryClass;
165-
#endif
166178
};
167179

168180
class CPulseFunctionParam
@@ -186,7 +198,13 @@ class CPulseFunctionParam
186198
case PVAL_FLOAT: return std::to_string( DefaultValue<float>() );
187199
case PVAL_STRING: return DefaultValue<CUtlString>().Get();
188200
case PVAL_SCHEMA_ENUM: return std::to_string( DefaultValue<int64>() );
201+
#if SOURCE_ENGINE == SE_CS2 || SOURCE_ENGINE == SE_DOTA
202+
case PVAL_VARIANT: return std::to_string( *DefaultValue<int64 *>() );
203+
case PVAL_EHANDLE: return std::to_string( DefaultValue<int32>() );
204+
case PVAL_SNDEVT_NAME: return std::string( "\"" ) + DefaultValue<SoundEvent_t *>()->m_SoundName.Get() + "\"";
205+
#else
189206
case PVAL_ANY: return std::to_string( *DefaultValue<int64 *>() );
207+
#endif
190208

191209
case PVAL_VEC3:
192210
{
@@ -214,23 +232,6 @@ class CPulseFunctionParam
214232
}
215233
}
216234

217-
#if SOURCE_ENGINE == SE_CS2
218-
public:
219-
CKV3MemberName m_Name;
220-
221-
PulseParamType m_TypeDesc;
222-
223-
void *m_DefaultValue;
224-
PulseParamType m_DefaultValueTypeDesc;
225-
226-
private:
227-
void *m_unk003;
228-
229-
public:
230-
uint16 m_StaticMetadataCount;
231-
SchemaMetadataEntryData_t *m_StaticMetadata;
232-
233-
#else
234235
public:
235236
CKV3MemberName m_Name;
236237

@@ -250,7 +251,6 @@ class CPulseFunctionParam
250251

251252
private:
252253
void *m_unk005;
253-
#endif
254254
};
255255

256256
class CPulseDomainFunction
@@ -290,28 +290,26 @@ class CPulseLibraryEventFunction : public CPulseDomainFunction
290290
class CPulseLibraryBinding
291291
{
292292
public:
293+
#if SOURCE_ENGINE == SE_DOTA
294+
void *m_unk001;
295+
#endif
293296
CUtlString m_Name;
294297

295-
#if SOURCE_ENGINE == SE_DOTA || SOURCE_ENGINE == SE_DEADLOCK
296298
int m_Flags;
297299

298300
int m_FunctionCount;
299301
CPulseLibraryFunction *m_Functions;
300302

301303
int m_EventFunctionCount;
302304
CPulseLibraryEventFunction *m_EventFunctions;
303-
#else
304-
305-
CUtlString m_Description;
306-
307-
int m_FunctionCount;
308-
CPulseLibraryFunction *m_Functions;
309-
#endif
310305
};
311306

312307
class CPulseDomainInfo
313308
{
314309
public:
310+
#if SOURCE_ENGINE == SE_DOTA
311+
void *m_unk001;
312+
#endif
315313
CUtlString m_Name;
316314
CUtlString m_FriendlyName;
317315
CUtlString m_Description;
@@ -366,6 +364,8 @@ METADATA_TAG( MPulseCellMethodBindings, CPulseLibraryBinding * );
366364
METADATA_TAG( MPulseInstanceDomainInfo, CPulseDomainInfo * );
367365
METADATA_TAG( MPulseDomainHookInfo, CPulseHookInfo * );
368366
METADATA_TAG( MPulseCellOutflowHookInfo, CPulseHookInfo * );
367+
METADATA_TAG( MPulseTypeQueriesForScopeSingleton, void * );
368+
METADATA_TAG( MPulseCell_WithNoDefaultOutflow, empty_t );
369369

370370
METADATA_TAG( MSourceTSDomain, empty_t );
371371
METADATA_TAG( MCellForDomain, const char * );
@@ -377,13 +377,9 @@ METADATA_TAG( MPulseRequirementCommit, empty_t );
377377
METADATA_TAG( MPulseRequirementCheck, empty_t );
378378
METADATA_TAG( MPulseDomainOptInValueType, int );
379379

380-
#if SOURCE_ENGINE == SE_CS2
381-
METADATA_TAG( MPulseProvideFeatureTag, const char * );
382-
METADATA_TAG( MPulseDomainOptInFeatureTag, const char * );
383-
#else
384380
METADATA_TAG( MPulseProvideFeatureTag, int );
385381
METADATA_TAG( MPulseDomainOptInFeatureTag, int );
386-
#endif
382+
METADATA_TAG( MPulseDomainOptInVariableKeysSource, int64 * );
387383

388384
METADATA_TAG( MPulseEditorIsControlFlowNode, empty_t );
389385
METADATA_TAG( MPulseEditorHeaderIcon, const char * );
@@ -392,6 +388,8 @@ METADATA_TAG( MPulseEditorHeaderExpr, const char * );
392388
METADATA_TAG( MPulseEditorSubHeaderText, const char * );
393389
METADATA_TAG( MPulseEditorCanvasItemPreset, const char * );
394390
METADATA_TAG( MPulseEditorCanvasItemSpecKV3, const char * );
391+
METADATA_TAG( MPulseSelectorAllowRequirementCriteria, const char * );
392+
METADATA_TAG( MPulseSelectorHasSpecificity, empty_t );
395393
METADATA_TAG( MPulseExpressionAlias, const char * );
396394
METADATA_TAG( MPulseCellWithCustomDocNode, empty_t );
397395
METADATA_TAG( MPulseCellOutflow_IsDefault, empty_t );
@@ -406,7 +404,9 @@ METADATA_TAG( MPulseInstanceFunction, const char * );
406404
METADATA_TAG( MPulseInstanceStep, const char * );
407405
METADATA_TAG( MPulseLibraryFunction, const char * );
408406
METADATA_TAG( MPulseLibraryStep, const char * );
407+
METADATA_TAG( MPulseDomainScopeInfo, int * );
409408
METADATA_TAG( MPulseDomainHiddenInTool, empty_t );
409+
METADATA_TAG( MPulseDomainDebuggerCanCreateInstance, empty_t );
410410
METADATA_TAG( MPulseDomainOptInGameBlackboard, const char * );
411411
METADATA_TAG( MPulseDomainIsGameBlackboard, empty_t );
412412
METADATA_TAG( MPulseFunctionHiddenInTool, empty_t );

src/schema_metadata.h

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,14 @@ struct CSchemaSendProxyRecipientsFilter
9090
int m_FilterIndex;
9191
};
9292

93+
#if SOURCE_ENGINE == SE_CS2 || SOURCE_ENGINE == SE_DOTA
94+
struct ClassKV3Defaults
95+
{
96+
KeyValues3 *m_Defaults;
97+
KeyValues3 *m_unk001;
98+
};
99+
#endif
100+
93101
class KeyValues3;
94102
class IGapTypeQueryRegistrationForScope;
95103

@@ -99,7 +107,11 @@ using FnPropertyAttrExtraInfo = CUtlString (*)(CUtlString &, void *);
99107
using FnPropertyElementName = void (*)(void *, CUtlString &);
100108
using FnParticleCustomFieldDefaultValue = bool (*)(KeyValues3 *, KeyValues3 *);
101109
using FnLeafSuggestionProvider = void (*)(void *);
110+
#if SOURCE_ENGINE == SE_CS2 || SOURCE_ENGINE == SE_DOTA
111+
using FnGetKV3Defaults = ClassKV3Defaults *(*)();
112+
#else
102113
using FnGetKV3Defaults = KeyValues3 *(*)();
114+
#endif
103115

104116
template <typename T>
105117
struct SchemaMetadataField : public SchemaMetadataEntryData_t
@@ -154,10 +166,10 @@ template<> inline std::string SchemaMetadataField<CSchemaNetworkOverride>::ToStr
154166
template<> inline std::string SchemaMetadataField<FnGetKV3Defaults>::ToString() const
155167
{
156168
#if SOURCE_ENGINE == SE_CS2
157-
if(!Value())
169+
if(!Value() || !Value()())
158170
return "";
159171

160-
KeyValues3 *kv = Value()();
172+
KeyValues3 *kv = Value()()->m_Defaults;
161173
if(!kv)
162174
return "";
163175

@@ -258,6 +270,7 @@ METADATA_TAG( MNetworkVarsAtomic, empty_t );
258270
METADATA_TAG( MNetworkEnable, empty_t );
259271
METADATA_TAG( MNetworkDisable, empty_t );
260272
METADATA_TAG( MNetworkPolymorphic, empty_t );
273+
METADATA_TAG( MNetworkOutOfPVSUpdates, int * );
261274
METADATA_TAG( MNetworkChangeAccessorFieldPathIndex, empty_t );
262275

263276
METADATA_TAG( MResourceTypeForInfoType, const char[8] );
@@ -276,6 +289,7 @@ METADATA_TAG( MPropertyArrayElementNameKey, const char * );
276289
METADATA_TAG( MPropertyCustomFGDType, const char * );
277290
METADATA_TAG( MPropertySuppressBaseClassField, const char * );
278291
METADATA_TAG( MPropertyAttributeSuggestionName, const char * );
292+
METADATA_TAG( MPropertyProvidesEditContextString, const char * );
279293
METADATA_TAG( MPropertyCustomEditor, const char * );
280294
METADATA_TAG( MPropertyEditClassAsString, CSchemaPropertyEditClassAsString );
281295
METADATA_TAG( MPropertyAttrChangeCallback, FnPropertyAttrChangeCb );
@@ -286,6 +300,7 @@ METADATA_TAG( MPropertyLeafSuggestionProviderFn, FnLeafSuggestionProvider );
286300
METADATA_TAG( MPropertySuppressEnumerator, empty_t );
287301
METADATA_TAG( MPropertyFlattenIntoParentRow, empty_t );
288302
METADATA_TAG( MPropertyAutoRebuildOnChange, empty_t );
303+
METADATA_TAG( MPropertyPolymorphicClass, empty_t );
289304
METADATA_TAG( MPropertyAutoExpandSelf, empty_t );
290305
METADATA_TAG( MPropertyColorPlusAlpha, empty_t );
291306
METADATA_TAG( MPropertySuppressField, empty_t );
@@ -337,3 +352,5 @@ METADATA_TAG( MParticleReplacementOp, const char * );
337352
METADATA_TAG( MParticleMinVersion, int );
338353
METADATA_TAG( MParticleMaxVersion, int );
339354
METADATA_TAG( MParticleDomainTag, const char * );
355+
356+
METADATA_TAG( M_LEGACY_OptInToSchemaPropertyDomain, empty_t );

src/schemareader.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44

55
#include "plugin.h"
66

7-
#include "memblockallocator.h"
8-
#include "commonmacros.h"
9-
107
CSchemaSystem *SchemaReader::SchemaSystem()
118
{
129
static CSchemaSystem *s_SchemaSystem = nullptr;
@@ -567,10 +564,6 @@ inline void SchemaReader::ReadPulseDomains( KeyValues3 *root, std::map<std::stri
567564
{
568565
if(auto binding = meta_binding->Value())
569566
{
570-
#if SOURCE_ENGINE != SE_CS2
571-
// META_CONPRINTF( "BINDING VAL: %s %d | funcv2: %d (funcsv1: %d)\n", binding->m_Name.Get(), binding->m_unk001, binding->m_FunctionV2Count, binding->m_FunctionCount );
572-
#endif
573-
574567
auto iter = domains.find( binding->m_Name.Get() );
575568
KeyValues3 *domain;
576569

@@ -610,9 +603,7 @@ inline void SchemaReader::ReadPulseDomains( KeyValues3 *root, std::map<std::stri
610603
}
611604

612605
ReadPulseDomianFunctions( functions, binding->m_Functions, binding->m_FunctionCount );
613-
#if SOURCE_ENGINE != SE_CS2
614606
ReadPulseDomianFunctions( functions, binding->m_EventFunctions, binding->m_EventFunctionCount );
615-
#endif
616607
}
617608
}
618609
}

0 commit comments

Comments
 (0)