}
}
+string welcomedialog_args;
void Net_ReadServerInfo()
{
- localcmd("\nmenu_cmd directmenu Welcome name \"", ReadString(),
- "\" ip \"", ReadString(),
- "\" motd \"", MakeConsoleSafe(strreplace("\n", "\\n", ReadString())),
- "\"\n");
+ if(welcomedialog_args)
+ strunzone(welcomedialog_args);
+ welcomedialog_args = strcat("name \"", ReadString(), "\"");
+ welcomedialog_args = strcat(welcomedialog_args, "ip \"", ReadString(), "\"");
+ welcomedialog_args = strcat(welcomedialog_args, "motd \"", MakeConsoleSafe(strreplace("\n", "\\n", ReadString())), "\"");
+ string pic = ReadString();
+ if(pic != "")
+ welcomedialog_args = strcat(welcomedialog_args, "pic \"", pic, "\"");
+ localcmd("\nmenu_cmd directmenu Welcome ", welcomedialog_args, "\n");
+ welcomedialog_args = string_null;
+ return;
}
// CSQC_Parse_TempEntity : Handles all temporary entity network data in the CSQC layer.
ATTRIB(XonoticWelcomeDialog, serverinfo_ip_ent, entity, world)
ATTRIB(XonoticWelcomeDialog, serverinfo_MOTD, string, string_null)
ATTRIB(XonoticWelcomeDialog, serverinfo_MOTD_ent, entity, world)
+ ATTRIB(XonoticWelcomeDialog, serverinfo_pic, string, string_null)
+ ATTRIB(XonoticWelcomeDialog, serverinfo_pic_ent, entity, NULL)
ENDCLASS(XonoticWelcomeDialog)
#endif
if(me.serverinfo_MOTD)
strunzone(me.serverinfo_MOTD);
me.serverinfo_MOTD = strzone(_("<NO MOTD>"));
+
+ if(me.serverinfo_pic)
+ strunzone(me.serverinfo_pic);
+ me.serverinfo_pic = strzone("nopic");
}
void XonoticWelcomeDialog_configureDialog(entity me)
{
me.serverinfo_MOTD = strzone(bufstr_get(argsbuf, i + 1));
++i;
}
+ else if(s == "pic")
+ {
+ if(me.serverinfo_pic)
+ strunzone(me.serverinfo_pic);
+ me.serverinfo_pic = strzone(strcat("/", bufstr_get(argsbuf, i + 1)));
+ ++i;
+ }
++i;
}
me.serverinfo_name_ent.setText(me.serverinfo_name_ent, me.serverinfo_name);
me.serverinfo_ip_ent.setText(me.serverinfo_ip_ent, me.serverinfo_ip);
me.serverinfo_MOTD_ent.setText(me.serverinfo_MOTD_ent, me.serverinfo_MOTD);
+
+ if(me.serverinfo_pic_ent.src)
+ strunzone(me.serverinfo_pic_ent.src);
+ me.serverinfo_pic_ent.src = strzone(me.serverinfo_pic);
}
void XonoticWelcomeDialog_fill(entity me)
entity e;
me.TR(me);
- me.TD(me, 1, 4, me.serverinfo_name_ent = makeXonoticTextLabel(0.5, ""));
- me.TR(me);
- me.TD(me, 1, 4, me.serverinfo_ip_ent = makeXonoticTextLabel(0.5, ""));
- me.TR(me);
- me.TR(me);
- me.TD(me, 10, 4, me.serverinfo_MOTD_ent = makeXonoticTextListBox());
+ me.TD(me, 4, 2, me.serverinfo_pic_ent = makeXonoticImage(string_null, 4.0/3.0));
+
+ me.gotoRC(me, 1, 2);
+ me.TD(me, 1, 2, me.serverinfo_name_ent = makeXonoticTextLabel(0, ""));
+ me.gotoRC(me, 2, 2);
+ me.TD(me, 1, 2, me.serverinfo_ip_ent = makeXonoticTextLabel(0, ""));
+
+ me.gotoRC(me, 4, 0);
+ me.TD(me, me.rows - 4 - 1, 4, me.serverinfo_MOTD_ent = makeXonoticTextListBox());
me.serverinfo_MOTD_ent.allowColors = 1;
me.gotoRC(me, me.rows - 1, 0);
me.TDempty(me, 1);