Plugins: Add example plugins.txt config, add support for inline comments,
move searchpath to gamedir/plugins/
This commit is contained in:
parent
7a9d50b4c9
commit
31ae020cba
11 changed files with 29 additions and 40 deletions
7
platform/plugins.txt
Normal file
7
platform/plugins.txt
Normal file
|
@ -0,0 +1,7 @@
|
|||
// Uncomment the ones you'd like to use
|
||||
//banner.dat
|
||||
//chatfilter.dat
|
||||
//chatsounds.dat
|
||||
//connectsounds.dat
|
||||
//ircbridge.dat
|
||||
//voxannouncer.dat
|
|
@ -1,31 +0,0 @@
|
|||
{
|
||||
climb 0x00004000
|
||||
vehicleclip 0x00008000
|
||||
}
|
||||
{
|
||||
leakssteam 0x00080000
|
||||
leakswater 0x00100000
|
||||
fl_r1 0x00200000
|
||||
fl_r2 0x00400000
|
||||
fl_r3 0x00800000
|
||||
fl_r4 0x01000000
|
||||
fl_r5 0x02000000
|
||||
fl_r6 0x04000000
|
||||
fl_r7 0x08000000
|
||||
|
||||
alien 0x10000000
|
||||
flesh 0x20000000
|
||||
foliage 0x30000000
|
||||
computer 0x40000000
|
||||
dirt 0x50000000
|
||||
vent 0x60000000
|
||||
grate 0x70000000
|
||||
metal 0x80000000
|
||||
glass 0x90000000
|
||||
sand 0xA0000000
|
||||
slosh 0xB0000000
|
||||
snow 0xC0000000
|
||||
tile 0xD0000000
|
||||
wood 0xE0000000
|
||||
concrete 0xF0000000
|
||||
}
|
|
@ -61,7 +61,7 @@ EFX_Load(string efx_file)
|
|||
int i;
|
||||
|
||||
if (!efx_file) {
|
||||
return;
|
||||
return 0;
|
||||
}
|
||||
|
||||
i = g_efx_count;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
CC=fteqcc
|
||||
|
||||
all:
|
||||
mkdir -p ../../platform/plugins
|
||||
$(CC) chatsounds.src
|
||||
$(CC) chatfilter.src
|
||||
$(CC) connectsounds.src
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#pragma target fte
|
||||
#pragma PROGS_DAT "../../platform/p_banner.dat"
|
||||
#pragma PROGS_DAT "../../platform/plugins/banner.dat"
|
||||
#define QWSSQC
|
||||
|
||||
#includelist
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#pragma target fte
|
||||
#pragma PROGS_DAT "../../platform/p_chatfilter.dat"
|
||||
#pragma PROGS_DAT "../../platform/plugins/chatfilter.dat"
|
||||
#define QWSSQC
|
||||
|
||||
#includelist
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#pragma target fte
|
||||
#pragma PROGS_DAT "../../platform/p_chatsounds.dat"
|
||||
#pragma PROGS_DAT "../../platform/plugins/chatsounds.dat"
|
||||
#define QWSSQC
|
||||
|
||||
#includelist
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#pragma target fte
|
||||
#pragma PROGS_DAT "../../platform/p_connectsounds.dat"
|
||||
#pragma PROGS_DAT "../../platform/plugins/connectsounds.dat"
|
||||
#define QWSSQC
|
||||
|
||||
#includelist
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#pragma target fte
|
||||
#pragma PROGS_DAT "../../platform/p_ircbridge.dat"
|
||||
#pragma PROGS_DAT "../../platform/plugins/ircbridge.dat"
|
||||
#define QWSSQC
|
||||
|
||||
#includelist
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#pragma target fte
|
||||
#pragma PROGS_DAT "../../platform/p_voxannouncer.dat"
|
||||
#pragma PROGS_DAT "../../platform/plugins/voxannouncer.dat"
|
||||
#define QWSSQC
|
||||
|
||||
#includelist
|
||||
|
|
|
@ -49,6 +49,12 @@ Plugin_Init(void)
|
|||
/* count valid progs */
|
||||
g_plugincount = 0;
|
||||
while ((tmp = fgets(pdb))) {
|
||||
int argc = tokenize_console(tmp);
|
||||
|
||||
/* check for valid entries/comments */
|
||||
if (argc <= 0)
|
||||
continue;
|
||||
|
||||
g_plugincount++;
|
||||
}
|
||||
|
||||
|
@ -57,8 +63,14 @@ Plugin_Init(void)
|
|||
i = 0;
|
||||
|
||||
while ((tmp = fgets(pdb))) {
|
||||
g_plugindb[i].m_strPath = tmp;
|
||||
g_plugindb[i].m_flProgsID = addprogs(tmp);
|
||||
int a = tokenize_console(tmp);
|
||||
|
||||
/* check for valid entries/comments */
|
||||
if (a <= 0)
|
||||
continue;
|
||||
|
||||
g_plugindb[i].m_strPath = strcat("plugins/", argv(0));
|
||||
g_plugindb[i].m_flProgsID = addprogs(g_plugindb[i].m_strPath);
|
||||
i++;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue