Use Dvar_SetString

This commit is contained in:
Diavolo 2021-08-31 18:12:25 +02:00
parent 1bb3b20395
commit ff5bb1f264
No known key found for this signature in database
GPG Key ID: FA77F074E98D98A5
3 changed files with 9 additions and 4 deletions

View File

@ -88,7 +88,7 @@ namespace Components
{ {
if (this->dvar && this->dvar->type == Game::dvar_type::DVAR_TYPE_STRING) if (this->dvar && this->dvar->type == Game::dvar_type::DVAR_TYPE_STRING)
{ {
Game::Dvar_SetCommand(this->dvar->name, string); Game::Dvar_SetString(this->dvar, string);
} }
} }
void Dvar::Var::set(const std::string& string) void Dvar::Var::set(const std::string& string)

View File

@ -279,6 +279,8 @@ namespace Game
Dvar_SetFromStringByName_t Dvar_SetFromStringByName = Dvar_SetFromStringByName_t(0x4F52E0); Dvar_SetFromStringByName_t Dvar_SetFromStringByName = Dvar_SetFromStringByName_t(0x4F52E0);
Dvar_SetFromStringByNameFromSource_t Dvar_SetFromStringByNameFromSource = Dvar_SetFromStringByNameFromSource_t(0x4FC770); Dvar_SetFromStringByNameFromSource_t Dvar_SetFromStringByNameFromSource = Dvar_SetFromStringByNameFromSource_t(0x4FC770);
Dvar_SetStringByName_t Dvar_SetStringByName = Dvar_SetStringByName_t(0x44F060); Dvar_SetStringByName_t Dvar_SetStringByName = Dvar_SetStringByName_t(0x44F060);
Dvar_SetString_t Dvar_SetString = Dvar_SetString_t(0x4A9580);
SL_ConvertToString_t SL_ConvertToString = SL_ConvertToString_t(0x4EC1D0); SL_ConvertToString_t SL_ConvertToString = SL_ConvertToString_t(0x4EC1D0);
SL_GetString_t SL_GetString = SL_GetString_t(0x4CDC10); SL_GetString_t SL_GetString = SL_GetString_t(0x4CDC10);

View File

@ -235,15 +235,18 @@ namespace Game
typedef dvar_t* (__cdecl * Dvar_RegisterColor_t)(const char* name, float r, float g, float b, float a, int flags, const char* description); typedef dvar_t* (__cdecl * Dvar_RegisterColor_t)(const char* name, float r, float g, float b, float a, int flags, const char* description);
extern Dvar_RegisterColor_t Dvar_RegisterColor; extern Dvar_RegisterColor_t Dvar_RegisterColor;
typedef dvar_t*(__cdecl * Dvar_SetFromStringByName_t)(const char* cvar, const char* value); typedef dvar_t* (__cdecl * Dvar_SetFromStringByName_t)(const char* cvar, const char* value);
extern Dvar_SetFromStringByName_t Dvar_SetFromStringByName; extern Dvar_SetFromStringByName_t Dvar_SetFromStringByName;
typedef dvar_t*(__cdecl * Dvar_SetFromStringByNameFromSource_t)(const char* cvar, const char* value, DvarSetSource source); typedef dvar_t* (__cdecl * Dvar_SetFromStringByNameFromSource_t)(const char* cvar, const char* value, DvarSetSource source);
extern Dvar_SetFromStringByNameFromSource_t Dvar_SetFromStringByNameFromSource; extern Dvar_SetFromStringByNameFromSource_t Dvar_SetFromStringByNameFromSource;
typedef void(__cdecl * Dvar_SetStringByName_t)(const char* cvar, const char* value); typedef void (__cdecl * Dvar_SetStringByName_t)(const char* cvar, const char* value);
extern Dvar_SetStringByName_t Dvar_SetStringByName; extern Dvar_SetStringByName_t Dvar_SetStringByName;
typedef void (__cdecl * Dvar_SetString_t)(dvar_t* cvar, const char* value);
extern Dvar_SetString_t Dvar_SetString;
typedef void(__cdecl * Dvar_GetUnpackedColorByName_t)(const char* name, float* color); typedef void(__cdecl * Dvar_GetUnpackedColorByName_t)(const char* name, float* color);
extern Dvar_GetUnpackedColorByName_t Dvar_GetUnpackedColorByName; extern Dvar_GetUnpackedColorByName_t Dvar_GetUnpackedColorByName;