#include "radiobutton.qh"
#include "commandbutton.qh"
#include "slider.qh"
+#include "util.qh"
+
void welcomeDialog_resetStrings(entity me)
{
{
switch(key)
{
- case K_KP_ENTER:
- case K_ENTER:
- case K_SPACE:
- me.close(me);
- return true;
+ //case K_KP_ENTER:
+ //case K_ENTER:
+ //case K_SPACE:
+ // me.close(me);
+ // return true;
default:
return SUPER(XonoticWelcomeDialog).keyDown(me, key, ascii, shift);
}
}
++i;
}
- //me.serverinfo_name_ent.setText(me.serverinfo_name_ent, me.serverinfo_name);
+ 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);
+ me.frame.setText(me.frame, "Welcome to Xonotic git");
+}
+
+void XonoticWelcomeDialog_showNotify(entity me)
+{
+ SUPER(XonoticWelcomeDialog).showNotify(me);
+ float teams, nTeams;
+ teams = cvar("_teams_available");
+ nTeams = 0;
+ me.team1.disabled = !(teams & 1); nTeams += boolean(teams & 1);
+ me.team2.disabled = !(teams & 2); nTeams += boolean(teams & 2);
+ me.team3.disabled = !(teams & 4); nTeams += boolean(teams & 4);
+ me.team4.disabled = !(teams & 8); nTeams += boolean(teams & 8);
}
void XonoticWelcomeDialog_draw(entity me)
entity e;
me.TR(me);
- me.TD(me, me.rows - 1, me.columns, me.serverinfo_MOTD_ent = makeXonoticTextBox());
+ me.TD(me, 1, me.columns, me.serverinfo_name_ent = makeXonoticHeaderLabel("Server"));
+ me.serverinfo_name_ent.allowColors = true;
+ me.TR(me);
+ me.TD(me, 2, 1, makeXonoticImage("/gfx/menu/luma/gametype_ca", 1));
+ me.TD(me, 1, 3, makeXonoticTextLabel(0, "Game type: Clan Arena"));
+ me.TR(me);
+ me.TDempty(me, 1);
+ me.TD(me, 1, 4, makeXonoticTextLabel(0, "Players: 4/24 (Warmup)"));
+ me.TR(me);
+ me.TD(me, 1, 2, makeXonoticTextLabel(0, "Frag limit: 0"));
+ me.TR(me);
+ me.TD(me, 1, 4, makeXonoticTextLabel(0, "Time limit: 10"));
+ me.TR(me);
+ me.TD(me, 1, 4, e = makeXonoticTextLabel(0, "Active modifications: Test\nNew line test"));
+ e.escapedNewLines = true;
+ me.TR(me);
+ me.TR(me);
+ me.TD(me, 2, 4, e = makeTeamButton_T(_("join"), '0 0 0', "cmd selectteam auto; cmd join",
+ _("Autoselect team (recommended)")));
+ e.preferredFocusPriority = 1;
+ me.TR(me);
+ me.TR(me);
+ me.TD(me, 2, 1, e = me.team1 = makeTeamButton(_("red"), '1 0.5 0.5', "cmd selectteam red; cmd join"));
+ me.TD(me, 2, 1, e = me.team2 = makeTeamButton(_("blue"), '0.5 0.5 1', "cmd selectteam blue; cmd join"));
+ me.TD(me, 2, 1, e = me.team3 = makeTeamButton(_("yellow"), '1 1 0.5', "cmd selectteam yellow; cmd join"));
+ me.TD(me, 2, 1, e = me.team4 = makeTeamButton(_("pink"), '1 0.5 1', "cmd selectteam pink; cmd join"));
+ me.TR(me);
+ me.TR(me);
+ me.TD(me, 1, 4, makeXonoticCommandButton(_("spectate"), '0 0 0', "cmd spectate", COMMANDBUTTON_CLOSE));
+
+ me.gotoRC(me, 1, 4);
+ me.TD(me, me.rows - 1, 4, me.serverinfo_MOTD_ent = makeXonoticTextBox());
me.serverinfo_MOTD_ent.align = 0.5;
me.serverinfo_MOTD_ent.allowColors = true;
me.serverinfo_MOTD_ent.escapedNewLines = true;
- me.gotoRC(me, me.rows - 1, 0);
+ /*me.gotoRC(me, me.rows - 1, 0);
me.TD(me, 1, me.columns, e = makeXonoticButton(_("OK"), '0 0 0'));
e.onClick = Dialog_Close;
e.onClickEntity = me;
- e.preferredFocusPriority = 1;
+ e.preferredFocusPriority = 1;*/
}
ATTRIB(XonoticWelcomeDialog, color, vector, SKINCOLOR_DIALOG_WELCOME);
ATTRIB(XonoticWelcomeDialog, intendedWidth, float, 0.8);
ATTRIB(XonoticWelcomeDialog, rows, float, 12);
- ATTRIB(XonoticWelcomeDialog, columns, float, 4);
+ ATTRIB(XonoticWelcomeDialog, columns, float, 8);
ATTRIB(XonoticWelcomeDialog, name, string, "Welcome");
METHOD(XonoticWelcomeDialog, draw, void(entity));
METHOD(XonoticWelcomeDialog, mouseRelease, bool(entity, vector));
METHOD(XonoticWelcomeDialog, keyDown, float(entity, float, float, float));
+ METHOD(XonoticWelcomeDialog, showNotify, void(entity));
METHOD(XonoticWelcomeDialog, destroy, void(entity));
METHOD(XonoticWelcomeDialog, readInputArgs, void(entity, int));
ATTRIB(XonoticWelcomeDialog, serverinfo_name, string, string_null);
- //ATTRIB(XonoticWelcomeDialog, serverinfo_name_ent, entity, world);
+ ATTRIB(XonoticWelcomeDialog, serverinfo_name_ent, entity, world);
ATTRIB(XonoticWelcomeDialog, serverinfo_MOTD, string, string_null);
ATTRIB(XonoticWelcomeDialog, serverinfo_MOTD_ent, entity, world);
+ ATTRIB(XonoticWelcomeDialog, team1, entity);
+ ATTRIB(XonoticWelcomeDialog, team2, entity);
+ ATTRIB(XonoticWelcomeDialog, team3, entity);
+ ATTRIB(XonoticWelcomeDialog, team4, entity);
ATTRIB(XonoticWelcomeDialog, requiresConnection, bool, true);
ENDCLASS(XonoticWelcomeDialog)