seta notification_INFO_WEAPON_VAPORIZER_MURDER "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
seta notification_INFO_WEAPON_VORTEX_MURDER "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
-// MSG_CENTER notifications (count = 242):
+// MSG_CENTER notifications (count = 241):
seta notification_CENTER_ALONE "1" "0 = off, 1 = centerprint"
seta notification_CENTER_ASSAULT_ATTACKING "1" "0 = off, 1 = centerprint"
seta notification_CENTER_ASSAULT_DEFENDING "1" "0 = off, 1 = centerprint"
seta notification_CENTER_ASSAULT_OBJ_DESTROYED "1" "0 = off, 1 = centerprint"
-seta notification_CENTER_CAMPAIGN_MESSAGE "1" "0 = off, 1 = centerprint"
seta notification_CENTER_CAMPCHECK "1" "0 = off, 1 = centerprint"
seta notification_CENTER_COINTOSS "1" "0 = off, 1 = centerprint"
seta notification_CENTER_COUNTDOWN_BEGIN "1" "0 = off, 1 = centerprint"
seta notification_show_sprees_info_newline "1" "Show attacker spree information for MSG_INFO messages on a separate line than the death notification itself"
seta notification_show_sprees_info_specialonly "1" "Don't show attacker spree information in MSG_INFO messages if it isn't an achievement"
-// Notification counts (total = 840): MSG_ANNCE = 80, MSG_INFO = 334, MSG_CENTER = 242, MSG_MULTI = 156, MSG_CHOICE = 28
+// Notification counts (total = 839): MSG_ANNCE = 80, MSG_INFO = 334, MSG_CENTER = 241, MSG_MULTI = 156, MSG_CHOICE = 28
NET_HANDLE(TE_CSQC_SERVERINFO, bool isNew)
{
+ bool campaign = ReadByte();
+ if (campaign)
+ {
+ string campaign_title = ReadString();
+ int campaign_level = ReadByte();
+ string campaign_msg = ReadString();
+ string welcomedialog_args;
+ welcomedialog_args = strcat("HOSTNAME \"", campaign_title, "\"");
+ string key = getcommandkey(_("jump"), "+jump");
+ string msg = strcat(
+ CCR("^F1"), sprintf(_("Level %d:"), campaign_level),
+ sprintf(CCR(" ^BG%s\n^3\n"), campaign_msg),
+ sprintf(CCR(_("^BGPress ^F2%s^BG to enter the game")), key));
+ msg = MakeConsoleSafe(strreplace("\n", "\\n", msg));
+ welcomedialog_args = strcat(welcomedialog_args, " WELCOME \"", msg, "\"");
+ localcmd("\nmenu_cmd directmenu Welcome ", welcomedialog_args, "\n");
+ return true;
+ }
+
bool force_centerprint = ReadByte();
string hostname = ReadString();
string ver = ReadString();
MSG_CENTER_NOTIF(INSTAGIB_FINDAMMO_FIRST, N_ENABLE, 0, 0, "", CPID_INSTAGIB_FINDAMMO, "1 10", _("^BGGet some ammo or you'll be dead in ^F4^COUNT^BG!"), _("^BGGet some ammo! ^F4^COUNT^BG left!"))
MSG_CENTER_NOTIF(INSTAGIB_LIVES_REMAINING, N_ENABLE, 0, 1, "f1", CPID_Null, "0 0", _("^F2Extra lives remaining: ^K1%s"), "")
- MSG_CENTER_NOTIF(CAMPAIGN_MESSAGE, N_ENABLE, 1, 1, "f1 s1 join_key", CPID_CAMPAIGN_MESSAGE, "-1 0", strcat(_("Level %s: "), "^BG%s\n^3\n", _("^BGPress ^F2%s^BG to enter the game")), "")
MSG_CENTER_NOTIF(MOTD, N_ENABLE, 1, 0, "s1", CPID_MOTD, "-1 0", "^BG%s", "")
MSG_CENTER_NOTIF(NIX_COUNTDOWN, N_ENABLE, 0, 2, "item_wepname", CPID_NIX, "1 f2", _("^F2^COUNT^BG until weapon change...\nNext weapon: ^F1%s"), "")
CASE(CPID, MISSING_TEAMS)
CASE(CPID, MISSING_PLAYERS)
CASE(CPID, INSTAGIB_FINDAMMO)
- CASE(CPID, CAMPAIGN_MESSAGE)
CASE(CPID, MOTD)
CASE(CPID, NIX)
CASE(CPID, ONSLAUGHT)
}
else if (argc == 2 && !isdemo()) // don't allow this command in demos
{
- if (argv(1) == "Welcome" && cvar("g_campaign"))
- return;
m_play_click_sound(MENU_SOUND_OPEN);
m_goto(strcat(filter, argv(1))); // switch to a menu item
}
s = campaign_shortdesc[i]; // fteqcc sucks
else
s = "???";
- // NOTE the following string is equal to the one used in the campaign level notification
- // (CAMPAIGN_MESSAGE) to avoid adding another duplicate string to translate
- s = draw_TextShortenToWidth(strcat(sprintf(_("Level %s: "), itos(i+1)), s), me.columnNameSize, 0, me.realFontSize);
+ // NOTE the following string should be equal to the one used in the Welcome dialog
+ // to avoid adding a slightly different string to translate
+ s = draw_TextShortenToWidth(strcat(sprintf(_("Level %d:"), i+1), " ", s), me.columnNameSize, 0, me.realFontSize);
draw_Text(me.realUpperMargin1 * eY + (me.columnNameOrigin + 0.00 * (me.columnNameSize - draw_TextWidth(s, 0, me.realFontSize))) * eX, s, me.realFontSize, theColor, theAlpha, 0);
if(i <= me.campaignIndex)
return 0;
}
+string Campaign_GetTitle()
+{
+ return campaign_title;
+}
+
int Campaign_GetLevelNum()
{
return campaign_level + 1;
cvar_settemp("g_dm", "0");
cvar_settemp("skill", ftos(baseskill));
cvar_settemp("bot_number", ftos(campaign_bots[0]));
- cvar_settemp("cl_welcome_in_menu_dialog", "0");
MapInfo_SwitchGameType(MapInfo_Type_FromString(campaign_gametype[0], false));
// this must be included BEFORE campaign_common.h to make this a memory saving
#define CAMPAIGN_MAX_ENTRIES 2
+string Campaign_GetTitle();
int Campaign_GetLevelNum();
string Campaign_GetMessage();
{
msg_entity = this;
WriteHeader(MSG_ONE, TE_CSQC_SERVERINFO);
+ WriteByte(MSG_ONE, boolean(autocvar_g_campaign));
+ if (boolean(autocvar_g_campaign))
+ {
+ WriteString(MSG_ONE, Campaign_GetTitle());
+ WriteByte(MSG_ONE, Campaign_GetLevelNum());
+ WriteString(MSG_ONE, Campaign_GetMessage());
+ return;
+ }
WriteByte(MSG_ONE, force_centerprint);
WriteString(MSG_ONE, autocvar_hostname);
WriteString(MSG_ONE, GetClientVersionMessage(this));
if (autocvar_g_campaign) {
if ((IS_PLAYER(this) && PHYS_INPUT_BUTTON_INFO(this)) || (!IS_PLAYER(this))) {
CS(this).motd_actived_time = time;
- Send_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CENTER_CAMPAIGN_MESSAGE, Campaign_GetMessage(), Campaign_GetLevelNum());
+ SendWelcomemessage(this, false);
}
} else {
if (PHYS_INPUT_BUTTON_INFO(this)) {
CS(this).motd_actived_time = time;
else if ((time - CS(this).motd_actived_time > 2) && IS_PLAYER(this)) { // hide it some seconds after BUTTON_INFO has been released
CS(this).motd_actived_time = 0;
- Kill_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CPID_CAMPAIGN_MESSAGE);
+ Kill_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CPID_MOTD);
}
} else {
if (PHYS_INPUT_BUTTON_INFO(this))
{
// instantly hide MOTD
CS(this).motd_actived_time = 0;
- if (autocvar_g_campaign)
- Kill_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CPID_CAMPAIGN_MESSAGE);
- else
- Kill_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CPID_MOTD);
+ Kill_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CPID_MOTD);
}
else if (IS_PLAYER(this) || IS_SPEC(this))
{