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.7)
7 ATTRIB(XonoticFirstRunDialog, rows, float, 16)
8 ATTRIB(XonoticFirstRunDialog, columns, float, 6)
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 float CheckFirstRunButton(entity me)
20 if(cvar_string("_cl_name") != "Player")
23 if(cvar_string("_menu_prvm_language") != prvm_language)
24 return 1; // OK will then reopen the dialog in another language
26 if(cvar_string("cl_allow_uid2name") != "-1")
32 void XonoticFirstRunDialog_fill(entity me)
40 me.TD(me, 2, 4, e = makeXonoticTextLabel(0, _("Welcome to Xonotic, please select your language preference and enter your player name to get started. You can change these options later through the menu system.")));
46 me.TD(me, 1, 0.5, me.playerNameLabel = makeXonoticTextLabel(0, _("Name:")));
47 me.playerNameLabelAlpha = me.playerNameLabel.alpha;
48 me.TD(me, 1, 3.25, label = makeXonoticTextLabel(0, string_null));
50 label.allowColors = 1;
53 me.TD(me, 1, 3.75, box = makeXonoticInputBox(1, "_cl_name"));
54 box.forbiddenCharacters = "\r\n\\\"$"; // don't care, isn't getting saved
55 box.maxLength = -127; // negative means encoded length in bytes
56 box.saveImmediately = 1;
57 label.textEntity = box;
59 me.TD(me, 5, 1.25, e = makeXonoticColorpicker(box));
60 me.TD(me, 5, 2.5, e = makeXonoticCharmap(box));
66 me.gotoRC(me, 3, 4); me.setFirstColumn(me, me.currentColumn);
68 me.TD(me, 1, 2, e = makeXonoticTextLabel(0, _("Text language:")));
70 me.TD(me, 6, 2, e = makeXonoticLanguageList());
71 e.name = "languageselector_firstrun";
72 e.doubleClickCommand = "prvm_language \"$_menu_prvm_language\"; saveconfig; menu_restart";
76 me.gotoRC(me, me.rows - 4, 0);
77 me.TD(me, 1, me.columns, e = makeXonoticTextLabel(0.5, _("Allow player statistics to use your nickname at stats.xonotic.org?")));
79 me.gotoRC(me, me.rows - 3, 0);
81 me.TD(me, 1, 1, e = makeXonoticRadioButton(1, "cl_allow_uid2name", "1", ZCTX(_("ALWU2N^Yes"))));
82 me.TD(me, 1, 1, e = makeXonoticRadioButton(1, "cl_allow_uid2name", "0", ZCTX(_("ALWU2N^No"))));
83 me.TD(me, 1, 1, e = makeXonoticRadioButton(1, "cl_allow_uid2name", "-1", ZCTX(_("ALWU2N^Undecided"))));
85 // because of the language selector, this is a menu_restart!
86 me.gotoRC(me, me.rows - 1, 0);
87 me.TD(me, 1, me.columns, e = makeXonoticCommandButton(_("Save settings"), '0 0 0', "prvm_language \"$_menu_prvm_language\"; saveconfig; menu_restart", COMMANDBUTTON_APPLY));
88 setDependentWeird(e, CheckFirstRunButton);