int i = 0;
string s;
welcomeDialog_resetStrings(me);
+ if(argsbuf >= 0)
while((s = bufstr_get(argsbuf, i)) != "")
{
if(s == "name")
entity e;
me.TR(me);
- me.TD(me, 4, 2, me.serverinfo_pic_ent = makeXonoticImage(string_null, 4.0/3.0));
+ me.TD(me, 4, me.columns / 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, 1, me.columns / 2);
+ me.TD(me, 1, me.columns / 2, me.serverinfo_name_ent = makeXonoticTextLabel(0, ""));
+ me.gotoRC(me, 2, me.columns / 2);
+ me.TD(me, 1, me.columns / 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.TD(me, me.rows - 4 - 1, me.columns, me.serverinfo_MOTD_ent = makeXonoticTextListBox());
me.serverinfo_MOTD_ent.allowColors = 1;
me.gotoRC(me, me.rows - 1, 0);
me.TDempty(me, 1);
- me.TD(me, 1, 2, e = makeXonoticCommandButton(_("Disconnect"), '0 0 0', "disconnect", COMMANDBUTTON_CLOSE));
+ me.TD(me, 1, me.columns / 2, e = makeXonoticCommandButton(_("Disconnect"), '0 0 0', "disconnect", COMMANDBUTTON_CLOSE));
}
#endif
METHOD(XonoticTextListBox, setSelected, void(entity, float))
METHOD(XonoticTextListBox, destroy, void(entity))
ATTRIB(XonoticTextListBox, textbuf, float, -1)
+ ATTRIB(XonoticTextListBox, textbufSize, float, 0)
ATTRIB(XonoticTextListBox, allowColors, float, 0)
METHOD(XonoticTextListBox, setText, void(entity, string))
METHOD(XonoticTextListBox, drawListBoxItem, void(entity, float, vector, float)) // item number, width/height, selected
}
}
strunzone(s);
+ me.textbufSize = buf_getsize(me.textbuf);
}
void XonoticTextListBox_destroy(entity me)
{
}
void XonoticTextListBox_drawListBoxItem(entity me, float i, vector absSize, float isSelected)
{
- draw_CenterText(me.realUpperMargin * eY + 0.5 * eX, bufstr_get(me.textbuf, i), me.realFontSize, '1 1 1', 1, me.allowColors);
+ if(me.textbufSize > 0)
+ draw_CenterText(me.realUpperMargin * eY + 0.5 * eX, bufstr_get(me.textbuf, i), me.realFontSize, '1 1 1', 1, me.allowColors);
}
#endif