X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fmenu%2Fxonotic%2Fdialog_firstrun.qc;h=c45256c525621e59e2eeb901d6efd3dcca8c1e7e;hb=54c73db251372d28956d780656c4a0a78a2e54ca;hp=894a702d8a026a155c1c05a1d4553003c474ec6a;hpb=853b6160a59c1e6f1b67af9abd43cf98d25b8625;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/menu/xonotic/dialog_firstrun.qc b/qcsrc/menu/xonotic/dialog_firstrun.qc index 894a702d8..c45256c52 100644 --- a/qcsrc/menu/xonotic/dialog_firstrun.qc +++ b/qcsrc/menu/xonotic/dialog_firstrun.qc @@ -1,22 +1,18 @@ -#ifndef DIALOG_FIRSTRUN_H -#define DIALOG_FIRSTRUN_H -#include "rootdialog.qc" -CLASS(XonoticFirstRunDialog, XonoticRootDialog) - METHOD(XonoticFirstRunDialog, fill, void(entity)) // to be overridden by user to fill the dialog with controls - ATTRIB(XonoticFirstRunDialog, title, string, _("Welcome")) - ATTRIB(XonoticFirstRunDialog, color, vector, SKINCOLOR_DIALOG_FIRSTRUN) - ATTRIB(XonoticFirstRunDialog, intendedWidth, float, 0.7) - ATTRIB(XonoticFirstRunDialog, rows, float, 16) - ATTRIB(XonoticFirstRunDialog, columns, float, 6) - ATTRIB(XonoticFirstRunDialog, name, string, "FirstRun") - ATTRIB(XonoticFirstRunDialog, playerNameLabel, entity, NULL) - ATTRIB(XonoticFirstRunDialog, playerNameLabelAlpha, float, 0) +#include "dialog_firstrun.qh" - ATTRIB(XonoticFirstRunDialog, closable, float, 0) -ENDCLASS(XonoticFirstRunDialog) -#endif +#include "textlabel.qh" +#include "inputbox.qh" +#include "languagelist.qh" +#include "radiobutton.qh" +#include "colorpicker.qh" +#include "charmap.qh" +#include "commandbutton.qh" + +bool XonoticFirstRunDialog_shouldShow() +{ + return cvar_string("_cl_name") == cvar_defstring("_cl_name"); +} -#ifdef IMPLEMENTATION float CheckFirstRunButton(entity me) { if(cvar_string("_cl_name") != cvar_defstring("_cl_name")) @@ -58,7 +54,8 @@ void XonoticFirstRunDialog_fill(entity me) label.allowColors = 1; label.alpha = 1; me.TR(me); - me.TD(me, 1, 3.75, box = makeXonoticInputBox(1, "_cl_name")); + me.TD(me, 1, 3.75, box = makeXonoticInputBox_T(1, "_cl_name", + _("Name under which you will appear in the game"))); box.forbiddenCharacters = "\r\n\\\"$"; // don't care, isn't getting saved box.maxLength = -127; // negative means encoded length in bytes box.saveImmediately = 0; // Sorry, can't do this, it spams "name" commands. @@ -90,10 +87,11 @@ void XonoticFirstRunDialog_fill(entity me) me.TD(me, 1, 1, e = makeXonoticRadioButton(1, "cl_allow_uid2name", "1", _("Yes"))); me.TD(me, 1, 1, e = makeXonoticRadioButton(1, "cl_allow_uid2name", "0", _("No"))); me.TD(me, 1, 1, e = makeXonoticRadioButton(1, "cl_allow_uid2name", "-1", _("Undecided"))); + me.TR(me); + me.TD(me, 1, me.columns, e = makeXonoticTextLabel(0.5, _("Player statistics are enabled by default, you can change this in the Profile menu"))); // because of the language selector, this is a menu_restart! me.gotoRC(me, me.rows - 1, 0); me.TD(me, 1, me.columns, e = makeXonoticCommandButton(_("Save settings"), '0 0 0', "prvm_language \"$_menu_prvm_language\"; saveconfig; menu_restart", COMMANDBUTTON_APPLY)); setDependentWeird(e, CheckFirstRunButton); } -#endif