Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
dialog_termsofservice.qc File Reference
#include "dialog_termsofservice.qh"
#include "../menu.qh"
#include "mainwindow.qh"
#include "dialog_firstrun.qh"
#include "textbox.qh"
#include "textlabel.qh"
#include "button.qh"
#include "util.qh"
Include dependency graph for dialog_termsofservice.qc:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void Close_Clicked (entity btn, entity me)
void DontAccept_Clicked (entity btn, entity me)
void XonoticToS_OnGet (entity fh, entity me, int status)
void XonoticToSDialog_fill (entity me)
void XonoticToSDialog_loadXonoticToS (entity me)
bool XonoticToSDialog_shouldShow ()

Function Documentation

◆ Close_Clicked()

void Close_Clicked ( entity btn,
entity me )

Definition at line 11 of file dialog_termsofservice.qc.

12{
13 LOG_INFOF("Accepted ToS version %d", _Nex_ExtResponseSystem_NewToS);
14 cvar_set("_termsofservice_accepted", ftos(_Nex_ExtResponseSystem_NewToS));
15 localcmd("saveconfig\n");
16 if (main.firstRunDialog.shouldShow())
17 main.firstDraw = true;
18 Dialog_Close(btn, me);
19}
#define main
Definition _all.inc:202
#define LOG_INFOF(...)
Definition log.qh:66
void Dialog_Close(entity button, entity me)
Definition dialog.qc:7
float _Nex_ExtResponseSystem_NewToS
Definition util.qh:68
void localcmd(string command,...)
void cvar_set(string name, string value)
string ftos(float f)

References _Nex_ExtResponseSystem_NewToS, cvar_set(), Dialog_Close(), entity(), ftos(), localcmd(), LOG_INFOF, and main.

Referenced by XonoticToSDialog_fill().

◆ DontAccept_Clicked()

void DontAccept_Clicked ( entity btn,
entity me )

Definition at line 21 of file dialog_termsofservice.qc.

22{
23 localcmd("quit\n");
24}

References entity(), and localcmd().

Referenced by XonoticToSDialog_fill().

◆ XonoticToS_OnGet()

void XonoticToS_OnGet ( entity fh,
entity me,
int status )

Definition at line 31 of file dialog_termsofservice.qc.

32{
33 switch (status) {
35 {
36 break;
37 }
38 case URL_READY_ERROR:
39 {
40 me.textBox.setText(me.textBox, "Error reading ToS");
41 break;
42 }
44 {
45 string temp = "";
46 for (string s; (s = url_fgets(fh)); )
47 {
48 if (temp != "")
49 temp = strcat(temp, "\n", s);
50 else
51 temp = s;
52 }
53 url_fclose(fh);
54 me.textBox.setText(me.textBox, temp);
55 break;
56 }
57 default:
58 {
59 break;
60 }
61 }
62}
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))
ERASEABLE string url_fgets(entity e)
Definition urllib.qc:287
ERASEABLE void url_fclose(entity e)
Definition urllib.qc:207
const float URL_READY_CLOSED
Definition urllib.qh:15
const float URL_READY_ERROR
Definition urllib.qh:14
const float URL_READY_CANREAD
Definition urllib.qh:17

References entity(), strcat(), url_fclose(), url_fgets(), URL_READY_CANREAD, URL_READY_CLOSED, and URL_READY_ERROR.

Referenced by XonoticToSDialog_loadXonoticToS().

◆ XonoticToSDialog_fill()

void XonoticToSDialog_fill ( entity me)

Definition at line 69 of file dialog_termsofservice.qc.

70{
71 entity e;
72 string subtitle;
73
75 subtitle = _("Terms of Service have been updated. Please read them before continuing:");
76 else
77 subtitle = _("Welcome to Xonotic! Please read the following Terms of Service:");
78
79 me.TR(me);
80 me.TD(me, 1, 5, e = makeXonoticTextLabel(0, subtitle));
81 e.allowWrap = true;
82
83 me.TR(me);
84 me.TR(me);
85 me.TD(me, me.rows - 4, me.columns, me.textBox = makeXonoticTextBox());
86 me.textBox.allowColors = true;
87
88 me.TR(me);
89 me.gotoRC(me, me.rows - 1, 0);
90
91 me.TD(me, 1, me.columns/2, e = makeXonoticButton(_("Accept"), '0 1 0'));
92 e.onClick = Close_Clicked;
93 e.onClickEntity = me;
94
95 me.TD(me, 1, me.columns/2, e = makeXonoticButton(_("Don't accept (quit the game)"), '1 0 0'));
96 e.onClick = DontAccept_Clicked;
97 e.onClickEntity = me;
98}
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
void DontAccept_Clicked(entity btn, entity me)
void Close_Clicked(entity btn, entity me)
int autocvar__termsofservice_accepted
entity makeXonoticButton(string theText, vector theColor)
Definition button.qc:10
entity makeXonoticTextBox()
Definition textbox.qc:4
entity makeXonoticTextLabel(float theAlign, string theText)
Definition textlabel.qc:3

References autocvar__termsofservice_accepted, Close_Clicked(), DontAccept_Clicked(), entity(), makeXonoticButton(), makeXonoticTextBox(), and makeXonoticTextLabel().

◆ XonoticToSDialog_loadXonoticToS()

void XonoticToSDialog_loadXonoticToS ( entity me)

Definition at line 26 of file dialog_termsofservice.qc.

27{
29}
const float FILE_READ
void XonoticToS_OnGet(entity fh, entity me, int status)
const string termsofservice_url
ERASEABLE void url_single_fopen(string url, int mode, url_ready_func rdy, entity pass)
Definition urllib.qc:87

References entity(), FILE_READ, termsofservice_url, url_single_fopen(), and XonoticToS_OnGet().

◆ XonoticToSDialog_shouldShow()