Xonotic
dialog_firstrun.qc File Reference
#include "dialog_firstrun.qh"
#include "textlabel.qh"
#include "inputbox.qh"
#include "languagelist.qh"
#include "radiobutton.qh"
#include "colorpicker.qh"
#include "charmap.qh"
#include "commandbutton.qh"
+ Include dependency graph for dialog_firstrun.qc:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

float CheckFirstRunButton (entity me)
 
void firstRun_setLanguage (entity me)
 
void XonoticFirstRunDialog_fill (entity me)
 
bool XonoticFirstRunDialog_shouldShow ()
 

Function Documentation

◆ CheckFirstRunButton()

float CheckFirstRunButton ( entity  me)

Definition at line 16 of file dialog_firstrun.qc.

References cvar_defstring(), cvar_string(), and prvm_language.

17 {
18  if(cvar_string("_cl_name") != cvar_defstring("_cl_name"))
19  return 1;
20 
21  if(cvar_string("_menu_prvm_language") != prvm_language)
22  return 1; // OK will then reopen the dialog in another language
23 
24  if(cvar_string("cl_allow_uid2name") != "-1")
25  return 1;
26 
27  return 0;
28 }
string prvm_language
Definition: i18n.qh:8
+ Here is the call graph for this function:

◆ firstRun_setLanguage()

void firstRun_setLanguage ( entity  me)

Definition at line 30 of file dialog_firstrun.qc.

References cvar_string(), localcmd, and prvm_language.

31 {
32  if(prvm_language != cvar_string("_menu_prvm_language"))
33  localcmd("\nprvm_language \"$_menu_prvm_language\"; saveconfig; menu_restart\n");
34 }
string prvm_language
Definition: i18n.qh:8
+ Here is the call graph for this function:

◆ XonoticFirstRunDialog_fill()

void XonoticFirstRunDialog_fill ( entity  me)

Definition at line 36 of file dialog_firstrun.qc.

References entity(), and makeXonoticTextLabel().

37 {
38  entity e;
39  entity label, box;
40 
41  me.TR(me);
42  me.TR(me);
43  me.TDempty(me, 1);
44  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.")));
45  e.allowWrap = 1;
46  me.TR(me);
47 
48  me.TR(me);
49  me.TR(me);
50  me.TD(me, 1, 0.5, me.playerNameLabel = makeXonoticTextLabel(0, _("Name:")));
51  me.playerNameLabelAlpha = me.playerNameLabel.alpha;
52  me.TD(me, 1, 3.25, label = makeXonoticTextLabel(0, string_null));
53  label.allowCut = 1;
54  label.allowColors = 1;
55  label.alpha = 1;
56  me.TR(me);
57  me.TD(me, 1, 3.75, box = makeXonoticInputBox_T(1, "_cl_name",
58  _("Name under which you will appear in the game")));
59  box.forbiddenCharacters = "\r\n\\\"$"; // don't care, isn't getting saved
60  box.maxLength = -127; // negative means encoded length in bytes
61  box.saveImmediately = 0; // Sorry, can't do this, it spams "name" commands.
62  box.enableClearButton = 0;
63  label.textEntity = box;
64  me.TR(me);
65  me.TD(me, 5, 1.25, e = makeXonoticColorpicker(box));
66  me.TD(me, 5, 2.5, e = makeXonoticCharmap(box));
67  me.TR(me);
68  me.TR(me);
69  me.TR(me);
70  me.TR(me);
71 
72  me.gotoRC(me, 3, 4); me.setFirstColumn(me, me.currentColumn);
73  me.TR(me);
74  me.TD(me, 1, 2, e = makeXonoticTextLabel(0, _("Text language:")));
75  me.TR(me);
76  me.TD(me, 6, 2, e = makeXonoticLanguageList());
77  e.name = "languageselector_firstrun";
78  e.setLanguage = firstRun_setLanguage;
79  me.TR(me);
80  me.TR(me);
81 
82  me.gotoRC(me, me.rows - 4, 0);
83  me.TD(me, 1, me.columns, e = makeXonoticTextLabel(0.5, _("Allow player statistics to use your nickname at stats.xonotic.org?")));
84 
85  me.gotoRC(me, me.rows - 3, 0);
86  me.TDempty(me, 1.5);
87  me.TD(me, 1, 1, e = makeXonoticRadioButton(1, "cl_allow_uid2name", "1", _("Yes")));
88  me.TD(me, 1, 1, e = makeXonoticRadioButton(1, "cl_allow_uid2name", "0", _("No")));
89  me.TD(me, 1, 1, e = makeXonoticRadioButton(1, "cl_allow_uid2name", "-1", _("Undecided")));
90  me.TR(me);
91  me.TD(me, 1, me.columns, e = makeXonoticTextLabel(0.5, _("Player statistics are enabled by default, you can change this in the Profile menu")));
92 
93  // because of the language selector, this is a menu_restart!
94  me.gotoRC(me, me.rows - 1, 0);
95  me.TD(me, 1, me.columns, e = makeXonoticCommandButton(_("Save settings"), '0 0 0', "prvm_language \"$_menu_prvm_language\"; saveconfig; menu_restart", COMMANDBUTTON_APPLY));
97 }
string string_null
Definition: nil.qh:9
entity makeXonoticRadioButton(float theGroup, string theCvar, string theValue, string theText)
Definition: radiobutton.qc:10
entity() spawn
entity makeXonoticTextLabel(float theAlign, string theText)
Definition: textlabel.qc:3
entity makeXonoticCharmap(entity controlledInputBox)
Definition: charmap.qc:32
entity makeXonoticLanguageList()
Definition: languagelist.qc:12
void firstRun_setLanguage(entity me)
entity makeXonoticCommandButton(string theText, vector theColor, string theCommand, int theFlags)
entity makeXonoticColorpicker(entity theTextbox)
Definition: colorpicker.qc:5
#define COMMANDBUTTON_APPLY
entity makeXonoticInputBox_T(float doEditColorCodes, string theCvar, string theTooltip)
Definition: inputbox.qc:3
float CheckFirstRunButton(entity me)
+ Here is the call graph for this function:

◆ XonoticFirstRunDialog_shouldShow()

bool XonoticFirstRunDialog_shouldShow ( )

Definition at line 11 of file dialog_firstrun.qc.

References cvar_defstring(), and cvar_string().

12 {
13  return cvar_string("_cl_name") == cvar_defstring("_cl_name");
14 }
+ Here is the call graph for this function: