bind u "+con_chat_maximize"
bind m +hud_panel_radar_maximized
bind b "quickmenu"
-bind i menu_showwelcomedialog
+bind i +show_info
bind PAUSE pause
bind F9 "cl_cmd hud minigame"
bind F10 menu_showquitdialog
}
}
-string welcomedialog_args;
NET_HANDLE(TE_CSQC_SERVERINFO, bool isNew)
{
- if(welcomedialog_args)
- strunzone(welcomedialog_args);
- welcomedialog_args = strcat("name \"", ReadString(), "\"");
- welcomedialog_args = strcat(welcomedialog_args, " motd \"", MakeConsoleSafe(strreplace("\n", "\\n", ReadString())), "\"");
- localcmd("\nmenu_cmd directmenu Welcome ", welcomedialog_args, "\n");
- welcomedialog_args = string_null;
+ string hostname = ReadString();
+ string msg = ReadString();
+ // players running older Xonotic version without the Welocome dialog have the cvar
+ // cl_welcome_in_menu_dialog not saved because it was created by the relative autocvar
+ // initilaization when server's client program is run
+ if (cvar_type("cl_welcome_in_menu_dialog") & CVAR_TYPEFLAG_SAVED && autocvar_cl_welcome_in_menu_dialog)
+ {
+ string welcomedialog_args;
+ welcomedialog_args = strcat("name \"", hostname, "\"");
+ msg = MakeConsoleSafe(strreplace("\n", "\\n", msg));
+ welcomedialog_args = strcat(welcomedialog_args, " motd \"", msg, "\"");
+ localcmd("\nmenu_cmd directmenu Welcome ", welcomedialog_args, "\n");
+ }
+ else
+ centerprint_Add(ORDINAL(CPID_MOTD), strcat(hostname, "\n\n\n", msg), -1, 0);
return true;
}
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;
// Map coordinate base calculations need these
vector mi_center;
strunzone(me.serverinfo_MOTD);
me.serverinfo_MOTD = strzone(_("<NO MOTD>"));
}
+
float XonoticWelcomeDialog_keyDown(entity me, float key, float ascii, float shift)
{
switch(key)
case K_KP_ENTER:
case K_ENTER:
case K_SPACE:
- XonoticWelcomeDialog_close(me);
+ me.close(me);
return true;
default:
return SUPER(XonoticWelcomeDialog).keyDown(me, key, ascii, shift);
}
}
-void XonoticWelcomeDialog_close(entity me)
-{
- SUPER(XonoticWelcomeDialog).close(me);
-}
+
void XonoticWelcomeDialog_configureDialog(entity me)
{
welcomeDialog_resetStrings(me);
SUPER(XonoticWelcomeDialog).configureDialog(me);
}
+
void XonoticWelcomeDialog_readInputArgs(entity me, float argsbuf)
{
int i = 0;
}
++i;
}
- localcmd("\nwait; wait; +show_info; wait; wait; -show_info\n");
//me.serverinfo_name_ent.setText(me.serverinfo_name_ent, me.serverinfo_name);
me.serverinfo_MOTD_ent.setText(me.serverinfo_MOTD_ent, me.serverinfo_MOTD);
me.frame.setText(me.frame, me.serverinfo_name);
ATTRIB(XonoticWelcomeDialog, name, string, "Welcome");
METHOD(XonoticWelcomeDialog, keyDown, float(entity, float, float, float));
- METHOD(XonoticWelcomeDialog, close, void(entity));
METHOD(XonoticWelcomeDialog, configureDialog, void(entity));
METHOD(XonoticWelcomeDialog, readInputArgs, void(entity, float));
ATTRIB(XonoticWelcomeDialog, serverinfo_name, string, string_null);
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));
MUTATOR_CALLHOOK(ClientConnect, this);
- if (IS_REAL_CLIENT(this))
- {
- if (!autocvar_g_campaign && !IS_PLAYER(this))
- {
- CS(this).motd_actived_time = -1;
- Send_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CENTER_MOTD, getwelcomemessage(this));
- }
- }
+ 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
}
/*
=============
cl_particles_forcetraileffects 1
alias dropweapon "impulse 17"
-alias +show_info +button7
-alias -show_info -button7
+
+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
// merge lightmaps up to 2048x2048 textures
mod_q3bsp_lightmapmergepower 4