1
0
Fork 0
forked from fte/fteqw

*** empty log message ***

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1587 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Lance 2005-11-26 05:43:26 +00:00
parent 9355c7dda5
commit 1c04088ac0
3 changed files with 469 additions and 0 deletions

317
plugins/ezscript/ezscript.c Normal file
View file

@ -0,0 +1,317 @@
// GPL'd, really needed?
#include "../plugin.h"
//#include <time.h>
//#include <ctype.h>
/*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?
{
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)
{
char cmd[256];
char param[256];
Cmd_Argv(0, cmd, sizeof(cmd));
Cmd_Argv(1, param, sizeof(param));
if ( (!strcmp("loadsky", cmd)) || (!strcmp("r_skyname", cmd)) )
{
char cvar[20] = "r_skybox";
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);
return 1;
}
else if ( (!strcmp("r_skycolor", cmd)) || (!strcmp("fps_skycolor", cmd)) )
{
char cvar[20] = "r_fastskycolour"; // note the england spelling, spike is a englander
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);
return 1;
}
else if (!strcmp("fps_sky", cmd))
{
char cvar[20] = "r_fastsky";
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);
return 1;
}
else if (!strcmp("gl_consolefont", cmd))
{
char cvar[20] = "gl_font";
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);
return 1;
}
else if (!strcmp("gl_bounceparticles", cmd))
{
char cvar[20] = "r_bouncysparks";
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);
return 1;
}
else if (!strcmp("gl_loadlitfiles", cmd))
{
char cvar[20] = "r_loadlit";
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);
return 1;
}
else if (!strcmp("gl_weather_rain", cmd))
{
char cvar[20] = "r_part_rain";
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);
return 1;
}
else if (!strcmp("cl_bonusflash", cmd))
{
char cvar[20] = "v_bonusflash";
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);
return 1;
}
else if ( (!strcmp("gl_gamma", cmd)) || (!strcmp("sw_gamma", cmd)) )
{
char cvar[20] = "gamma";
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);
return 1;
}
else if ( (!strcmp("gl_contrast", cmd)) || (!strcmp("sw_contrast", cmd)) )
{
char cvar[20] = "gamma";
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);
return 1;
}
else if (!strcmp("s_khz", cmd))
{
char cvar[20] = "snd_khz";
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);
return 1;
}
else if (!strcmp("s_loadas8bit", cmd))
{
char cvar[20] = "loadas8bit";
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);
return 1;
}
else if (!strcmp("s_mixahead", cmd))
{
char cvar[20] = "_snd_mixahead";
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);
return 1;
}
else if (!strcmp("s_noextraupdate", cmd))
{
char cvar[20] = "snd_noextraupdate";
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);
return 1;
}
else if (!strcmp("s_nosound", cmd))
{
char cvar[20] = "nosound";
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);
return 1;
}
else if (!strcmp("s_precache", cmd))
{
char cvar[20] = "precache";
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);
return 1;
}
else if (!strcmp("s_show", cmd))
{
char cvar[20] = "snd_show";
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);
return 1;
}
else if (!strcmp("s_swapstereo", cmd))
{
char cvar[20] = "snd_leftisright";
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);
return 1;
}
else if (!strcmp("s_ambientlevel", cmd))
{
char cvar[20] = "ambient_level";
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);
return 1;
}
else if (!strcmp("s_ambientfade", cmd))
{
char cvar[20] = "ambient_fade";
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);
return 1;
}
else if (!strcmp("tp_triggers", cmd))
{
char cvar[20] = "cl_triggers";
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);
return 1;
}
else if (!strcmp("teamskin", cmd))
{
char cvar[20] = "cl_teamskin";
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);
return 1;
}
else if (!strcmp("enemyskin", cmd))
{
char cvar[20] = "cl_enemyskin";
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);
return 1;
}
else if (!strcmp("scr_consize", cmd))
{ char cvar[20] = "con_height";
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);
return 1;
}
else if (!strcmp("cl_predictPlayers", cmd)) // why capital P i dont know
{
char cvar[20] = "cl_predict_players"; //lets not forget there is a cl_predict_players2
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);
return 1;
}
else if (!strcmp("sshot_format", cmd))
{
char cvar[20] = "scr_sshot_type";
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);
return 1;
}
else if (!strcmp("cl_solidPlayers", cmd))
{
char cvar[20] = "cl_solid_players";
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);
return 1;
}
else if (!strcmp("fps_muzzleflash", cmd))
{
char cvar[20] = "cl_muzzleflash";
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);
return 1;
}
return 0;
}
void ezScript_InitCommands(void) // not really needed actually
{
//skyboxes
Cmd_AddCommand("loadsky");
Cmd_AddCommand("r_skyname");
Cmd_AddCommand("r_skycolor");
Cmd_AddCommand("fps_sky");
Cmd_AddCommand("fps_skycolor");
//gl stuff
Cmd_AddCommand("gl_consolefont");
Cmd_AddCommand("gl_bounceparticles");
Cmd_AddCommand("gl_loadlitfiles");
Cmd_AddCommand("gl_weather_rain");
//misc
Cmd_AddCommand("cl_bonusflash");
//gamma
Cmd_AddCommand("gl_gamma");
Cmd_AddCommand("sw_gamma");
Cmd_AddCommand("gl_contrast");
Cmd_AddCommand("sw_contrast");
//sound
Cmd_AddCommand("s_khz");
Cmd_AddCommand("s_loadas8bit");
Cmd_AddCommand("s_mixahead");
Cmd_AddCommand("s_noextraupdate");
Cmd_AddCommand("s_nosound");
Cmd_AddCommand("s_precache");
Cmd_AddCommand("s_show");
Cmd_AddCommand("s_swapstereo");
Cmd_AddCommand("s_ambientlevel");
Cmd_AddCommand("s_ambientfade");
//teamplay
Cmd_AddCommand("tp_triggers");
Cmd_AddCommand("teamskin");
Cmd_AddCommand("enemyskin");
//console
Cmd_AddCommand("scr_consize");
//misc
Cmd_AddCommand("cl_predictPlayers");
Cmd_AddCommand("sshot_format");
Cmd_AddCommand("cl_solidPlayers");
Cmd_AddCommand("fps_muzzleflash");
}
int Plug_Init(int *args)
{
if (Plug_Export("ExecuteCommand", Plug_ExecuteCommand))
{
Con_Printf("ezScript Plugin Build 1 by Moodles Loaded\n");
}
else
{
Con_Printf("ezScript Plugin failed\n");
}
ezScript_InitCommands();
return 1;
}

View file

@ -0,0 +1,123 @@
# Microsoft Developer Studio Project File - Name="ezscript" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=ezscript - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "ezscript.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "ezscript.mak" CFG="ezscript - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "ezscript - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "ezscript - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "ezscript - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "EZSCRIPT_EXPORTS" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "EZSCRIPT_EXPORTS" /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x809 /d "NDEBUG"
# ADD RSC /l 0x809 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
# ADD LINK32 kernel32.lib wsock32.lib /nologo /dll /machine:I386 /out:"Release/ezscriptx86.dll"
!ELSEIF "$(CFG)" == "ezscript - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 1
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "EZSCRIPT_EXPORTS" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "EZSCRIPT_EXPORTS" /FR /YX /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x809 /d "_DEBUG"
# ADD RSC /l 0x809 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib wsock32.lib /nologo /dll /debug /machine:I386 /out:"c:\games\quake\id1\plugins\ezscriptx86.dll" /pdbtype:sept
!ENDIF
# Begin Target
# Name "ezscript - Win32 Release"
# Name "ezscript - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\ezscript.c
# End Source File
# Begin Source File
SOURCE=..\plugin.c
# End Source File
# Begin Source File
SOURCE=..\qvm_api.c
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=..\plugin.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# Begin Source File
SOURCE=..\plugin.def
# End Source File
# End Target
# End Project

View file

@ -0,0 +1,29 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "ezscript"=.\ezscript.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################