Xonotic
dialog_multiplayer_join_termsofservice.qc
Go to the documentation of this file.
2 
3 #include "textbox.qh"
4 #include <lib/urllib.qh>
5 
6 
8 {
9  entity me;
11  me.configureDialog(me);
12  return me;
13 }
14 
15 void XonoticServerToSTab_loadToS(entity me, string downloadurl)
16 {
18 }
19 
21 {
22  entity e;
23  me.TR(me);
24  me.TD(me, me.rows, me.columns, e = makeXonoticTextBox());
25  me.textBox = e;
26 }
27 
28 void AdditionalServerInfo_OnGet(entity fh, entity me, int status)
29 {
30  switch (status) {
31  case URL_READY_CLOSED:
32  {
33  break;
34  }
35  case URL_READY_ERROR:
36  {
37  me.text = strzone("Error reading ToS");
38  me.textBox.setText(me.textBox, me.text);
39  break;
40  }
41  case URL_READY_CANREAD:
42  {
43  strfree(me.text);
44  string temp = "";
45  for (string s; (s = url_fgets(fh)); )
46  {
47  if (temp != "")
48  temp = strcat(temp, "\n", s);
49  else
50  temp = s;
51  }
52  url_fclose(fh);
53  me.text = strzone(temp);
54  me.textBox.setText(me.textBox, me.text);
55  break;
56  }
57  default:
58  {
59  break;
60  }
61  }
62 }
const float URL_READY_CANREAD
Definition: urllib.qh:17
const float URL_READY_CLOSED
Definition: urllib.qh:15
#define NEW(cname,...)
Definition: oo.qh:105
entity() spawn
const float FILE_READ
Definition: csprogsdefs.qc:231
spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 f1 s1 strcat(_("Level %s: "), "^BG%s\3\, _("^BGPress ^F2%s^BG to enter the game"))
entity makeXonoticTextBox()
Definition: textbox.qc:4
void XonoticServerToSTab_loadToS(entity me, string downloadurl)
ERASEABLE void url_fclose(entity e)
Definition: urllib.qc:207
void AdditionalServerInfo_OnGet(entity fh, entity me, int status)
void XonoticServerToSTab_fill(entity me)
ERASEABLE void url_single_fopen(string url, int mode, url_ready_func rdy, entity pass)
Definition: urllib.qc:87
entity makeXonoticServerToSTab()
const float URL_READY_ERROR
Definition: urllib.qh:14
#define strfree(this)
Definition: string.qh:56
ERASEABLE string url_fgets(entity e)
Definition: urllib.qc:287