THIS COMMIT MOST LIKELY BREAKS THINGS.

changed conchars from 16-bit to 32-bit
added support for RGBI fg and bg colors
better support for ^8/^9 text codes
fix to echoish menu sounds
added plugin stuff for centerprints/server messages/chat messages, not finalized (?)
GL/SW color character functions improved (although neither handle transparent characters, and SW needs improvement with the palette remapping)


git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1750 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
TimeServ 2006-01-01 09:01:15 +00:00
parent 8ef3ae1182
commit a8889d8f24
31 changed files with 632 additions and 575 deletions

View file

@ -125,7 +125,9 @@ typedef struct plugin_s {
//protocol-in-a-plugin
int connectionlessclientpacket;
#endif
int messagefunction;
int svmsgfunction;
int chatmsgfunction;
int centerprintfunction;
struct plugin_s *next;
} plugin_t;
@ -371,8 +373,12 @@ int VARGS Plug_ExportToEngine(void *offset, unsigned int mask, const long *arg)
currentplug->sbarlevel[2] = arg[1];
else if (!strcmp(name, "ConnectionlessClientPacket"))
currentplug->connectionlessclientpacket = arg[1];
else if (!strcmp(name, "MessageEvent"))
currentplug->messagefunction = arg[1];
else if (!strcmp(name, "ServerMessageEvent"))
currentplug->svmsgfunction = arg[1];
else if (!strcmp(name, "ChatMessageEvent"))
currentplug->chatmsgfunction = arg[1];
else if (!strcmp(name, "CenterPrintMessage"))
currentplug->centerprintfunction = arg[1];
#endif
else
return 0;
@ -1549,17 +1555,49 @@ void Plug_SBar(void)
}
#endif
int Plug_Message(int clientnum, int messagelevel, char *buffer)
qboolean Plug_ServerMessage(char *buffer, int messagelevel)
{
qboolean ret = true;
for (currentplug = plugs; currentplug; currentplug = currentplug->next)
{
if (currentplug->messagefunction)
if (currentplug->svmsgfunction)
{
VM_Call(currentplug->vm, currentplug->messagefunction, clientnum, messagelevel, buffer);
ret &= VM_Call(currentplug->vm, currentplug->svmsgfunction, buffer, messagelevel);
}
}
return 1; // don't silence message
return ret; // true to display message, false to supress
}
qboolean Plug_ChatMessage(char *buffer, int talkernum, int tpflags)
{
qboolean ret = true;
for (currentplug = plugs; currentplug; currentplug = currentplug->next)
{
if (currentplug->chatmsgfunction)
{
ret &= VM_Call(currentplug->vm, currentplug->chatmsgfunction, buffer, talkernum, tpflags);
}
}
return ret; // true to display message, false to supress
}
qboolean Plug_CenterPrintMessage(char *buffer, int clientnum)
{
qboolean ret = true;
for (currentplug = plugs; currentplug; currentplug = currentplug->next)
{
if (currentplug->centerprintfunction)
{
ret &= VM_Call(currentplug->vm, currentplug->centerprintfunction, buffer, clientnum);
}
}
return ret; // true to display message, false to supress
}
void Plug_Close(plugin_t *plug)