From ae586b599a9f1bc27313b7fc8888450bc4fb322c Mon Sep 17 00:00:00 2001 From: Lance Date: Fri, 14 Apr 2006 01:37:40 +0000 Subject: [PATCH] Added ezscript_silentmode, with the spam default off. Uncommented ezScript_InitCvars & ezScript_CvarUpdate, the .qvm has magically lost 3kb too.. even though more code was added. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2201 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- plugins/ezscript/ezscript.c | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/plugins/ezscript/ezscript.c b/plugins/ezscript/ezscript.c index e46e65986..870dc23b9 100644 --- a/plugins/ezscript/ezscript.c +++ b/plugins/ezscript/ezscript.c @@ -1,27 +1,31 @@ -// GPL'd, really needed? - - #include "../plugin.h" -//#include -//#include +//#define RELEASE "__DATE__" -/*void ezScript_InitCvars(void) +#define ezscriptcvars "ezScript Console Variables" +vmcvar_t ezscript_silentmode = {"ezscript_silentmode", "1", ezscriptcvars, 0}; +#undef ezscriptcvars + +vmcvar_t *cvarlist[] ={ + &ezscript_silentmode +}; + +void ezScript_InitCvars(void) { vmcvar_t *v; int i; for (v = cvarlist[0],i=0; i < sizeof(cvarlist)/sizeof(cvarlist[0]); v++, i++) v->handle = Cvar_Register(v->name, v->string, v->flags, v->group); -}*/ +} -/*int ezScript_CvarUpdate(void) // perhaps void instead? +int ezScript_CvarUpdate(void) { vmcvar_t *v; int i; for (v = cvarlist[0],i=0; i < sizeof(cvarlist)/sizeof(cvarlist[0]); v++, i++) v->modificationcount = Cvar_Update(v->handle, v->modificationcount, v->string, &v->value); return 0; -}*/ +} int Plug_ExecuteCommand(int *args) { @@ -88,7 +92,11 @@ int Plug_ExecuteCommand(int *args) Cmd_Argv(1, param, sizeof(param)); Cvar_SetString(cvar,param); - Con_Printf("-------------------------------------\n^7ezScript: ^1%s^7 is a ^3Fuh/ez/Z/More quakeworld ^7cvar, sending '^6%s^7' to ^2%s^7\n-------------------------------------\n",cmd,param,cvar); + + ezScript_CvarUpdate(); + + if (ezscript_silentmode.value == 0) { Con_Printf("-------------------------------------\n^7ezScript: ^1%s^7 is a ^3Fuh/ez/Z/More quakeworld ^7cvar, sending '^6%s^7' to ^2%s^7\n-------------------------------------\n",cmd,param,cvar); } + } return 1; } @@ -159,7 +167,8 @@ int Plug_Init(int *args) return false; } - Con_Printf("ezScript Plugin Build 1 by Moodles Loaded\n"); + Con_Printf(va("ezScript Plugin %s Loaded\n",RELEASE)); + ezScript_InitCvars(); ezScript_InitCommands(); return true; } \ No newline at end of file