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 = 243):
+// MSG_CENTER notifications (count = 242):
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_LMS_VISIBLE_OTHER "1" "0 = off, 1 = centerprint"
seta notification_CENTER_MISSING_PLAYERS "1" "0 = off, 1 = centerprint"
seta notification_CENTER_MISSING_TEAMS "1" "0 = off, 1 = centerprint"
-seta notification_CENTER_MOTD "1" "0 = off, 1 = centerprint"
seta notification_CENTER_MOVETOSPEC_IDLING "1" "0 = off, 1 = centerprint"
seta notification_CENTER_NADE_BONUS "1" "0 = off, 1 = centerprint"
seta notification_CENTER_NADE_THROW "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 = 843): MSG_ANNCE = 80, MSG_INFO = 335, MSG_CENTER = 243, MSG_MULTI = 157, MSG_CHOICE = 28
+// Notification counts (total = 842): MSG_ANNCE = 80, MSG_INFO = 335, MSG_CENTER = 242, MSG_MULTI = 157, MSG_CHOICE = 28
return true;
}
- welcome_msg_force_centerprint = ReadByte();
strcpy(hostname, ReadString());
string hostversion = ReadString();
if (!welcome_msg_menu_check_maxtime)
return;
- bool want_dialog = (!welcome_msg_force_centerprint && !isdemo() && autocvar_cl_welcome_in_menu_dialog);
// if want dialog check if menu is initialized but for a short time
- if (!want_dialog || cvar("_menu_initialized") == 2 || time > welcome_msg_menu_check_maxtime)
+ if (cvar("_menu_initialized") == 2 || time > welcome_msg_menu_check_maxtime)
{
- if (want_dialog && cvar("_menu_welcome_dialog_available"))
+ if (cvar("_menu_welcome_dialog_available"))
{
string welcomedialog_args = strcat("HOSTNAME \"", hostname, "\"");
string msg = MakeConsoleSafe(strreplace("\n", "\\n", welcome_msg));
welcomedialog_args = strcat(welcomedialog_args, " WELCOME \"", msg, "\"");
localcmd("\nmenu_cmd directmenu Welcome ", welcomedialog_args, "\n");
- if (intermission) // close it after it's been initialized so it can still be opened manually
+ if (intermission || isdemo() || !autocvar_cl_welcome)
+ // close it after it's been initialized so it can still be opened manually
localcmd("\ntogglemenu 0\n");
}
- else
- centerprint_Add(ORDINAL(CPID_MOTD), strcat(hostname, "\n\n\n", welcome_msg), -1, 0);
strfree(welcome_msg);
welcome_msg_menu_check_maxtime = 0;
bool autocvar_developer_csqcentities;
bool autocvar_cl_race_cptimes_onlyself; // TODO: move to race gamemode
bool autocvar_cl_race_cptimes_showself = false;
-bool autocvar_cl_welcome_in_menu_dialog = true;
+bool autocvar_cl_welcome = true;
// Map coordinate base calculations need these
vector mi_center;
string hostname;
string welcome_msg;
float welcome_msg_menu_check_maxtime;
-bool welcome_msg_force_centerprint;
void Welcome_Message_Show_Try();
void Fog_Force();
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(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"), "")
MSG_CENTER_NOTIF(NIX_NEWWEAPON, N_ENABLE, 0, 1, "item_wepname", CPID_NIX, "0 0", _("^F2Active weapon: ^F1%s"), "")
CASE(CPID, MISSING_TEAMS)
CASE(CPID, MISSING_PLAYERS)
CASE(CPID, INSTAGIB_FINDAMMO)
- CASE(CPID, MOTD)
CASE(CPID, NIX)
CASE(CPID, ONSLAUGHT)
CASE(CPID, ONS_CAPSHIELD)
#define PHYS_INPUT_BUTTON_ZOOM(s) PHYS_INPUT_BUTTON_BUTTON4(s)
#define PHYS_INPUT_BUTTON_CROUCH(s) PHYS_INPUT_BUTTON_BUTTON5(s)
#define PHYS_INPUT_BUTTON_HOOK(s) PHYS_INPUT_BUTTON_BUTTON6(s)
-#define PHYS_INPUT_BUTTON_INFO(s) PHYS_INPUT_BUTTON_BUTTON7(s)
+#define PHYS_INPUT_BUTTON_INFO(s) PHYS_INPUT_BUTTON_BUTTON7(s) // button7 is FREE
#define PHYS_INPUT_BUTTON_DRAG(s) PHYS_INPUT_BUTTON_BUTTON8(s)
#define PHYS_INPUT_BUTTON_USE(s) PHYS_INPUT_BUTTON_BUTTON_USE(s)
#define PHYS_INPUT_BUTTON_CHAT(s) PHYS_INPUT_BUTTON_BUTTON_CHAT(s)
LOG_HELP(" ", s);
});
}
- else if (argc == 2 && !isdemo()) // don't allow this command in demos
+ else if (argc == 2 && (!isdemo() || argv(1) == "Welcome")) // don't allow this command in demos
{
m_play_click_sound(MENU_SOUND_OPEN);
m_goto(strcat(filter, argv(1))); // switch to a menu item
}
- else if(argc > 2 && !isdemo())
+ else if(argc > 2 && (!isdemo() || argv(1) == "Welcome"))
{
entity e = NULL;
float argsbuf = 0;
localcmd("\n+show_info0; defer 2 -show_info0\n");
me.close(me);
}
+
+ if (isdemo())
+ {
+ me.joinButton_ent.disabled = true;
+ me.spectateButton_ent.disabled = true;
+ }
+ else
+ {
+ me.joinButton_ent.disabled = false;
+ me.spectateButton_ent.disabled = false;
+ }
}
void XonoticWelcomeDialog_fill(entity me)
me.gotoRC(me, me.rows - 1, 0);
me.TD(me, 1, me.columns / 2, me.joinButton_ent = makeXonoticCommandButton(_("Join"), '0 1 0', "cmd join", COMMANDBUTTON_CLOSE));
me.joinButton_ent.preferredFocusPriority = 1;
- me.TD(me, 1, me.columns / 2, makeXonoticCommandButton(_("Spectate"), '0 0 0', "cmd spectate", COMMANDBUTTON_CLOSE));
+ me.TD(me, 1, me.columns / 2, me.spectateButton_ent = makeXonoticCommandButton(_("Spectate"), '0 0 0', "cmd spectate", COMMANDBUTTON_CLOSE));
}
ATTRIB(XonoticWelcomeDialog, serverinfo_MOTD, string, string_null);
ATTRIB(XonoticWelcomeDialog, serverinfo_MOTD_ent, entity, world);
ATTRIB(XonoticWelcomeDialog, joinButton_ent, entity, world);
+ ATTRIB(XonoticWelcomeDialog, spectateButton_ent, entity, world);
ATTRIB(XonoticWelcomeDialog, requiresConnection, bool, true);
ENDCLASS(XonoticWelcomeDialog)
}
#endif
-void SendWelcomemessage(entity this, bool force_centerprint)
-{
- msg_entity = this;
- WriteHeader(MSG_ONE, TE_CSQC_SERVERWELCOME);
- SendWelcomemessage_msg_type(this, force_centerprint, MSG_ONE);
-}
-
// NOTE csqc uses the active mutators list sent by this function
// to understand which mutators are enabled
// also note that they aren't all registered mutators, e.g. jetpack, low gravity
-void SendWelcomemessage_msg_type(entity this, bool force_centerprint, int msg_type)
+void SendWelcomeMessage(entity this, int msg_type)
{
WriteByte(msg_type, boolean(autocvar_g_campaign));
if (boolean(autocvar_g_campaign))
WriteString(msg_type, Campaign_GetMessage());
return;
}
- WriteByte(msg_type, force_centerprint);
WriteString(msg_type, autocvar_hostname);
WriteString(msg_type, autocvar_g_xonoticversion);
WriteByte(msg_type, CS(this).version_mismatch);
if (player_count == 1)
localcmd("\nsv_hook_firstjoin\n");
-
- if (IS_REAL_CLIENT(this) && !IS_PLAYER(this) && !autocvar_g_campaign)
- CS(this).motd_actived_time = -1; // the welcome message is shown by the client
}
/*
=============
return free_slots;
}
-void PrintWelcomeMessage(entity this)
-{
- if(CS(this).motd_actived_time == 0)
- {
- if (autocvar_g_campaign) {
- if ((IS_PLAYER(this) && PHYS_INPUT_BUTTON_INFO(this)) || (!IS_PLAYER(this))) {
- CS(this).motd_actived_time = time;
- SendWelcomemessage(this, false);
- }
- } else {
- if (PHYS_INPUT_BUTTON_INFO(this)) {
- CS(this).motd_actived_time = time;
- SendWelcomemessage(this, true);
- }
- }
- }
- else if(CS(this).motd_actived_time > 0) // showing MOTD or campaign message
- {
- if (autocvar_g_campaign) {
- 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_MOTD);
- }
- } else {
- if (PHYS_INPUT_BUTTON_INFO(this))
- CS(this).motd_actived_time = time;
- else if (time - CS(this).motd_actived_time > 2) { // 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_MOTD);
- }
- }
- }
- else //if(CS(this).motd_actived_time < 0) // just connected, motd is active
- {
- if(PHYS_INPUT_BUTTON_INFO(this)) // BUTTON_INFO hides initial MOTD
- CS(this).motd_actived_time = -2; // wait until BUTTON_INFO gets released
- else if (CS(this).motd_actived_time == -2)
- {
- // instantly hide MOTD
- CS(this).motd_actived_time = 0;
- Kill_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CPID_MOTD);
- }
- else if (IS_PLAYER(this) || IS_SPEC(this))
- {
- // FIXME occasionally for some reason MOTD never goes away
- // delay MOTD removal a little bit in the hope it fixes this bug
- if (CS(this).motd_actived_time == -1) // MOTD marked to fade away as soon as client becomes player or spectator
- CS(this).motd_actived_time = -(5 + floor(random() * 10)); // add small delay
- else //if (CS(this).motd_actived_time < -2)
- CS(this).motd_actived_time++;
- }
- }
-}
-
bool joinAllowed(entity this)
{
if (CS(this).version_mismatch) return false;
PlayerUseKey(this);
CS(this).usekeypressed = PHYS_INPUT_BUTTON_USE(this);
- if (IS_REAL_CLIENT(this))
- PrintWelcomeMessage(this);
-
if (IS_PLAYER(this)) {
if (IS_REAL_CLIENT(this) && time < CS(this).jointime + MIN_SPEC_TIME)
error("Client can't be spawned as player on connection!");
.float jointime; // time of connecting
.float startplaytime; // time of switching from spectator to player
.float alivetime; // time of being alive
-.float motd_actived_time; // used for both motd and campaign_message
.bool wasplayer;
ATTRIB(Client, teamkill_soundtime, float, this.teamkill_soundtime);
ATTRIB(Client, teamkill_soundsource, entity, this.teamkill_soundsource);
ATTRIB(Client, usekeypressed, bool, this.usekeypressed);
- ATTRIB(Client, motd_actived_time, float, this.motd_actived_time);
ATTRIB(Client, jointime, float, this.jointime);
ATTRIB(Client, spectatortime, float, this.spectatortime);
ATTRIB(Client, startplaytime, float, this.startplaytime);
.float nickspamtime; // time of last nick change
.float nickspamcount;
-void SendWelcomemessage_msg_type(entity this, bool force_centerprint, int msg_type);
+void SendWelcomeMessage(entity this, int msg_type);
// respawning
.int respawn_flags;
WriteByte(MSG_ENTITY, welcome_msg_too);
// welcome message is sent here because it needs to know the gametype
if (welcome_msg_too)
- SendWelcomemessage_msg_type(to, false, MSG_ENTITY);
+ SendWelcomeMessage(to, MSG_ENTITY);
return true;
}
alias dropweapon "impulse 17"
+// support for servers still using the old centreprint MOTD
alias +show_info0 "+button7"
alias -show_info0 "-button7"
alias +show_info1 "menu_showwelcomedialog"
alias -show_info1 ""
-
-seta cl_welcome_in_menu_dialog 1 "1: show the welcome message in a dedicated menu dialog; 0: show it as a centerprint message"
-alias +show_info +show_info$cl_welcome_in_menu_dialog
-alias -show_info -show_info$cl_welcome_in_menu_dialog
+alias +show_info +show_info$_menu_welcome_dialog_available
+alias -show_info -show_info$_menu_welcome_dialog_available
+seta cl_welcome 1 "1: show the Welcome dialog when connecting; 0: show it only when +show_info keybind is pressed"
// merge lightmaps up to 2048x2048 textures
mod_q3bsp_lightmapmergepower 4