2 CLASS(XonoticFirstRunDialog) EXTENDS(XonoticRootDialog)
3 METHOD(XonoticFirstRunDialog, fill, void(entity)) // to be overridden by user to fill the dialog with controls
4 ATTRIB(XonoticFirstRunDialog, title, string, _("Welcome"))
5 ATTRIB(XonoticFirstRunDialog, color, vector, SKINCOLOR_DIALOG_FIRSTRUN)
6 ATTRIB(XonoticFirstRunDialog, intendedWidth, float, 0.6)
7 ATTRIB(XonoticFirstRunDialog, rows, float, 11)
8 ATTRIB(XonoticFirstRunDialog, columns, float, 3)
9 ATTRIB(XonoticFirstRunDialog, name, string, "FirstRun")
10 ATTRIB(XonoticFirstRunDialog, playerNameLabel, entity, NULL)
11 ATTRIB(XonoticFirstRunDialog, playerNameLabelAlpha, float, 0)
13 ATTRIB(XonoticFirstRunDialog, closable, float, 0)
14 ENDCLASS(XonoticFirstRunDialog)
18 void XonoticFirstRunDialog_fill(entity me)
23 me.TD(me, 2, 3, e = makeXonoticTextLabel(0, _("Please answer a few initial questions to enhance the game experience.")));
27 me.TD(me, 1, 0.5, me.playerNameLabel = makeXonoticTextLabel(0, _("Name:")));
28 me.playerNameLabelAlpha = me.playerNameLabel.alpha;
29 me.TD(me, 1, 2.5, label = makeXonoticTextLabel(0, string_null));
31 label.allowColors = 1;
34 me.TD(me, 1, 3.0, box = makeXonoticInputBox(1, "_cl_name"));
35 box.forbiddenCharacters = "\r\n\\\"$"; // don't care, isn't getting saved
36 box.maxLength = -127; // negative means encoded length in bytes
37 label.textEntity = box;
39 me.TD(me, 5, 1, e = makeXonoticColorpicker(box));
40 me.TD(me, 5, 2, e = makeXonoticCharmap(box));
48 // because of the language selector, this is a menu_restart!
49 me.gotoRC(me, me.rows - 1, 0);
50 me.TD(me, 1, me.columns, e = makeXonoticCommandButton(_("Save settings"), '0 0 0', "saveconfig; menu_restart; togglemenu", COMMANDBUTTON_APPLY));
51 setDependentStringNotEqual(e, "_cl_name", "Player");