Skip to content

Commit 79abc2b

Browse files
committed
con_inputMaxMatchesShown & gm_build_date dvars
1 parent 1e421d7 commit 79abc2b

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

components/game_mod/dllmain.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,6 @@ BOOL GameMod_Init()
102102
PatchMemory(0x00587633, (PBYTE)"\xE8", 1);
103103
PatchMemory(0x0058761C, (PBYTE)"\xEB", 1);
104104

105-
#if _DEBUG
106-
//
107-
// Set the max number of suggestions to show in the console autocomplete preview
108-
//
109-
unsigned int con_inputMaxMatchesShown = 32;
110-
PatchMemory(0x00B72F7C, (PBYTE)&con_inputMaxMatchesShown, 4);
111-
#endif
112-
113105
//
114106
// Disable error message boxes with developer_script
115107
//

components/game_mod/dvar.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
dvar_s* sm_quality;
44
dvar_s* r_noborder;
55
dvar_s* con_extcon;
6+
dvar_s* con_inputMaxMatchesShown;
7+
dvar_s* gm_build_date;
68

79
void R_RegisterCustomDvars()
810
{
@@ -56,9 +58,14 @@ void __declspec(naked) mfh_R_RegisterDvars()
5658
}
5759

5860
CG_RegisterDvars_t CG_RegisterDvars_o = NULL;
59-
void __cdecl CG_RegisterDvars(void)
61+
void __cdecl CG_RegisterDvars()
6062
{
6163
CG_RegisterDvars_o();
6264

6365
con_extcon = Dvar_RegisterInt("con_extcon", 0, 0, 1, 1, "Enable external console window");
64-
}
66+
con_inputMaxMatchesShown = Dvar_RegisterInt("con_inputMaxMatchesShown", 24, 1, 64, 1, "Maximum number of suggestions in the console autocomplete preview");
67+
gm_build_date = Dvar_RegisterString("gm_build_date", __TIMESTAMP__, 0x10 | 0x8, "Compile time for game_mod");
68+
69+
// Set the max number of suggestions to show in the console autocomplete preview
70+
PatchMemory(0x00B72F7C, (PBYTE)&con_inputMaxMatchesShown->current.value, 4);
71+
}

components/game_mod/dvar.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,15 @@ static Dvar_SetStringByName_t* Dvar_SetStringByName = (Dvar_SetStringByName_t*)0
109109
typedef void __cdecl Dvar_SetBool_t(dvar_s *dvar, bool value);
110110
static Dvar_SetBool_t* Dvar_SetBool = (Dvar_SetBool_t*)0x004B0C10;
111111

112+
typedef dvar_s *__cdecl Dvar_RegisterString_t(const char *dvarName, const char *value, unsigned __int16 flags, const char *description);
113+
static Dvar_RegisterString_t* Dvar_RegisterString = (Dvar_RegisterString_t*)0x0059B3B0;
114+
112115
typedef dvar_s *__cdecl Dvar_RegisterInt_t(const char *dvarName, int value, int min, int max, unsigned __int16 flags, const char *description);
113116
static Dvar_RegisterInt_t* Dvar_RegisterInt = (Dvar_RegisterInt_t*)0x00651910;
114117

115118
void mfh_R_RegisterDvars();
116119

117-
typedef void (__cdecl* CG_RegisterDvars_t)(void);
120+
typedef void (__cdecl* CG_RegisterDvars_t)();
118121
extern CG_RegisterDvars_t CG_RegisterDvars_o;
119122

120-
void __cdecl CG_RegisterDvars(void);
123+
void __cdecl CG_RegisterDvars();

0 commit comments

Comments
 (0)