This repository has been archived by the owner on Apr 18, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConsole.hpp
77 lines (65 loc) · 1.54 KB
/
Console.hpp
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
#pragma once
#include "VT.hpp"
class ConVar
{
public:
float GetFloat()
{
typedef float(__thiscall *o_GetFloat)(void*);
return VT::vfunc<o_GetFloat>(this, 12)(this);
}
int GetInt()
{
typedef int(__thiscall *o_GetInt)(void*);
return VT::vfunc<o_GetInt>(this, 13)(this);
}
void SetValue(const char* value)
{
typedef void(__thiscall *o_SetValue)(void*, const char*);
VT::vfunc<o_SetValue>(this, 14)(this, value);
}
void SetValue(float value)
{
typedef void(__thiscall *o_SetValue)(void*, float);
VT::vfunc<o_SetValue>(this, 15)(this, value);
}
void SetValue(int value)
{
typedef void(__thiscall *o_SetValue)(void*, int);
VT::vfunc<o_SetValue>(this, 16)(this, value);
}
char unk0[0x4];
ConVar *pNext;
int bRegistered;
char *pszName;
char *pszHelpString;
int nFlags;
char unk1[0x4];
ConVar *pParent;
char *pszDefaultValue;
char *strString;
int StringLength;
float fValue;
int nValue;
int bHasMin;
float fMinVal;
int bHasMax;
float fMaxVal;
void *fnChangeCallback;
};
class Console
{
public:
ConVar *FindVar(const char *var)
{
typedef ConVar*(__thiscall *o_FindVar)(void*, const char*);
return VT::vfunc<o_FindVar>(this, 15)(this, var);
}
template<typename ...A>
void const ConsoleColorPrintf(const Color &c, const char *fmt, const A &...args)
{
typedef void(__cdecl *o_ConsoleColorPrintf)(void*, const Color&, const char*, ...);
VT::vfunc<o_ConsoleColorPrintf>(this, 25)(this, c, fmt, args...);
}
};
extern Console *p_Console;