if (!isdemo() && cvar("_menu_welcome_dialog_available") && autocvar_cl_welcome_in_menu_dialog)
{
string welcomedialog_args;
- welcomedialog_args = strcat("name \"", hostname, "\"");
+ welcomedialog_args = strcat("HOSTNAME \"", hostname, "\"");
msg = MakeConsoleSafe(strreplace("\n", "\\n", msg));
- welcomedialog_args = strcat(welcomedialog_args, " motd \"", msg, "\"");
+ welcomedialog_args = strcat(welcomedialog_args, " WELCOME \"", msg, "\"");
localcmd("\nmenu_cmd directmenu Welcome ", welcomedialog_args, "\n");
}
else
#include <common/command/_mod.qh>
-.void(entity me, float argsbuf) readInputArgs;
+.void(entity me, int argsbuf) readInputArgs;
.entity firstChild, nextSibling;
string _dumptree_space;
void welcomeDialog_resetStrings(entity me)
{
- if(me.serverinfo_name)
- strunzone(me.serverinfo_name);
- me.serverinfo_name = strzone(_("<NO NAME>"));
-
- if(me.serverinfo_MOTD)
- strunzone(me.serverinfo_MOTD);
- me.serverinfo_MOTD = strzone(_("<NO MOTD>"));
+ strcpy(me.serverinfo_name, "<NO HOSTNAME>");
+ strcpy(me.serverinfo_MOTD, "<NO WELCOME MESSAGE>");
}
float XonoticWelcomeDialog_keyDown(entity me, float key, float ascii, float shift)
cvar_set("_menu_welcome_dialog_available", "0");
}
-void XonoticWelcomeDialog_readInputArgs(entity me, float argsbuf)
+void XonoticWelcomeDialog_readInputArgs(entity me, int argsbuf)
{
int i = 0;
string s;
if(argsbuf >= 0)
while((s = bufstr_get(argsbuf, i)) != "")
{
- if(s == "name")
- {
- if(me.serverinfo_name)
- strunzone(me.serverinfo_name);
- me.serverinfo_name = strzone(bufstr_get(argsbuf, i + 1));
- ++i;
- }
- else if(s == "motd")
- {
- if(me.serverinfo_MOTD)
- strunzone(me.serverinfo_MOTD);
- me.serverinfo_MOTD = strzone(bufstr_get(argsbuf, i + 1));
- ++i;
- }
+ if(s == "HOSTNAME")
+ strcpy(me.serverinfo_name, bufstr_get(argsbuf, ++i));
+ else if(s == "WELCOME")
+ strcpy(me.serverinfo_MOTD, bufstr_get(argsbuf, ++i));
++i;
}
//me.serverinfo_name_ent.setText(me.serverinfo_name_ent, me.serverinfo_name);
METHOD(XonoticWelcomeDialog, keyDown, float(entity, float, float, float));
METHOD(XonoticWelcomeDialog, configureDialog, void(entity));
METHOD(XonoticWelcomeDialog, destroy, void(entity));
- METHOD(XonoticWelcomeDialog, readInputArgs, void(entity, float));
+ METHOD(XonoticWelcomeDialog, readInputArgs, void(entity, int));
ATTRIB(XonoticWelcomeDialog, serverinfo_name, string, string_null);
//ATTRIB(XonoticWelcomeDialog, serverinfo_name_ent, entity, world);
ATTRIB(XonoticWelcomeDialog, serverinfo_MOTD, string, string_null);