mirror of
https://github.com/alliedmodders/hl2sdk.git
synced 2026-10-10 20:03:08 +08:00
Change FnCustomData_t to FnGetEnumInfoHandle_t
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
#include "Color.h"
|
||||
#include "vectorws.h"
|
||||
#include "playerslot.h"
|
||||
#include "schemasystem/schematypes.h"
|
||||
|
||||
#include <cstdint>
|
||||
#include <cinttypes>
|
||||
@@ -631,7 +632,7 @@ using FnTypedFilterCallbackProvider_t = bool(*)(CConVar<T> *cvar, CSplitScreenSl
|
||||
using FnGenericFilterCallback_t = bool(*)(ConVarRefAbstract *ref, CSplitScreenSlot nSlot, const CVValue_t *pNewValue, const CVValue_t *pOldValue);
|
||||
using FnGenericFilterCallbackProvider_t = bool(*)(ConVarRefAbstract *ref, CSplitScreenSlot nSlot, const CVValue_t *pNewValue, const CVValue_t *pOldValue, ConVarUserInfoSet_t *userinfo_data, FnGenericFilterCallback_t cb);
|
||||
|
||||
using FnCustomData_t = void *(*)();
|
||||
using FnGetEnumInfoHandle_t = SchemaMetaInfoHandle_t<CSchemaEnumInfo> (*)();
|
||||
|
||||
struct ConVarValueInfo_t
|
||||
{
|
||||
@@ -647,7 +648,7 @@ struct ConVarValueInfo_t
|
||||
m_fnCallBack( nullptr ),
|
||||
m_fnProviderFilterCallBack( nullptr ),
|
||||
m_fnFilterCallBack( nullptr ),
|
||||
m_fnCustomData( nullptr ),
|
||||
m_fnGetEnumInfoHandle( nullptr ),
|
||||
m_eVarType( type ),
|
||||
m_CompletionCallBack()
|
||||
{}
|
||||
@@ -726,8 +727,7 @@ public:
|
||||
// AMNOTE: Currently the only usage is lb_debug_tiles, lb_debug_silhouette and sc_visualize_sceneobjects
|
||||
// which holds a reference to a enum schema binding, it's a string type under the hood and is converted from int
|
||||
// to a enum value string via the change callbacks.
|
||||
// So not sure if this is a concrete enum binding prop or any data prop.
|
||||
FnCustomData_t m_fnCustomData;
|
||||
FnGetEnumInfoHandle_t m_fnGetEnumInfoHandle;
|
||||
|
||||
EConVarType m_eVarType;
|
||||
|
||||
@@ -921,7 +921,7 @@ public:
|
||||
m_iCompletionCBIndex = 0;
|
||||
m_GameInfoFlags = 0;
|
||||
m_UserInfoByteIndex = 0;
|
||||
m_fnCustomData = nullptr;
|
||||
m_fnGetEnumInfoHandle = nullptr;
|
||||
}
|
||||
|
||||
const char *GetName( void ) const { return m_pszName; }
|
||||
@@ -953,7 +953,8 @@ public:
|
||||
return GetCvarTypeTraits( m_eVarType );
|
||||
}
|
||||
|
||||
FnCustomData_t GetCustomDataFn() const { return m_fnCustomData; }
|
||||
bool HasEnumInfo() const { return m_fnGetEnumInfoHandle != nullptr; }
|
||||
SchemaMetaInfoHandle_t<CSchemaEnumInfo> GetEnumInfo() const { return HasEnumInfo() ? m_fnGetEnumInfoHandle() : SchemaMetaInfoHandle_t<CSchemaEnumInfo> {}; }
|
||||
|
||||
int GetDataByteSize() const { return TypeTraits()->m_ByteSize; }
|
||||
bool IsPrimitiveType() const { return TypeTraits()->m_IsPrimitive; }
|
||||
@@ -1041,7 +1042,7 @@ private:
|
||||
int m_UserInfoByteIndex;
|
||||
|
||||
// Copied directly as is from ConVarValueInfo_t
|
||||
FnCustomData_t m_fnCustomData;
|
||||
FnGetEnumInfoHandle_t m_fnGetEnumInfoHandle;
|
||||
|
||||
// At convar registration this is trimmed to better match convar type being used
|
||||
// or if it was initialized as EConVarType_Invalid it would be of this size
|
||||
|
||||
Reference in New Issue
Block a user