- moved the notification messages for SendToCommunicator into LANGUAGE.

As a side effect this will now allow using custom messages with this function as well by using the arg2 parameter as part of the message's name (arg2=0 will use TXT_COMM0, arg1 TXT_COMM1 and so on.)
This commit is contained in:
Christoph Oelckers 2015-11-26 10:25:05 +01:00
parent 6efc2a0ec7
commit fca469b053
2 changed files with 12 additions and 6 deletions

View file

@ -56,6 +56,7 @@
#include "p_3dmidtex.h"
#include "d_net.h"
#include "d_event.h"
#include "gstrings.h"
#include "r_data/colormaps.h"
#define FUNC(a) static int a (line_t *ln, AActor *it, bool backSide, \
@ -2985,13 +2986,14 @@ FUNC(LS_SendToCommunicator)
{
S_StopSound (CHAN_VOICE);
S_Sound (CHAN_VOICE, name, 1, ATTN_NORM);
if (arg2 == 0)
// Get the message from the LANGUAGE lump.
FString msg;
msg.Format("TXT_COMM%d", arg2);
const char *str = GStrings[msg];
if (msg != NULL)
{
Printf (PRINT_CHAT, "Incoming Message\n");
}
else if (arg2 == 1)
{
Printf (PRINT_CHAT, "Incoming Message from BlackBird\n");
Printf (PRINT_CHAT, "%s\n", str);
}
}
return true;

View file

@ -1550,6 +1550,10 @@ TXT_RANDOMGOODBYE_3 = "See you later!";
TXT_HAVEENOUGH = "You seem to have enough!";
TXT_GOAWAY = "Go away!";
TXT_COMM0 = "Incoming Message";
TXT_COMM1 = "Incoming Message from BlackBird";
// Skills:
SKILL_BABY = "I'm too young to die";