From fca469b053a86d17088a357e019485a25e69f5cf Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 26 Nov 2015 10:25:05 +0100 Subject: [PATCH] - 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.) --- src/p_lnspec.cpp | 14 ++++++++------ wadsrc/static/language.enu | 4 ++++ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/p_lnspec.cpp b/src/p_lnspec.cpp index 37d6d6058..35b0300ef 100644 --- a/src/p_lnspec.cpp +++ b/src/p_lnspec.cpp @@ -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; diff --git a/wadsrc/static/language.enu b/wadsrc/static/language.enu index bdefa1b86..005a3f57d 100644 --- a/wadsrc/static/language.enu +++ b/wadsrc/static/language.enu @@ -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";