#include <menu/xonotic/dialog_multiplayer_join.qc>
#include <menu/xonotic/dialog_multiplayer_join_serverinfo.qc>
#include <menu/xonotic/dialog_multiplayer_join_serverinfotab.qc>
-#include <menu/xonotic/dialog_multiplayer_join_ToS.qc>
+#include <menu/xonotic/dialog_multiplayer_join_termsofservice.qc>
#include <menu/xonotic/dialog_multiplayer_media.qc>
#include <menu/xonotic/dialog_multiplayer_media_demo.qc>
#include <menu/xonotic/dialog_multiplayer_media_demo_startconfirm.qc>
#include <menu/xonotic/dialog_multiplayer_join.qh>
#include <menu/xonotic/dialog_multiplayer_join_serverinfo.qh>
#include <menu/xonotic/dialog_multiplayer_join_serverinfotab.qh>
-#include <menu/xonotic/dialog_multiplayer_join_ToS.qh>
+#include <menu/xonotic/dialog_multiplayer_join_termsofservice.qh>
#include <menu/xonotic/dialog_multiplayer_media.qh>
#include <menu/xonotic/dialog_multiplayer_media_demo.qh>
#include <menu/xonotic/dialog_multiplayer_media_demo_startconfirm.qh>
+++ /dev/null
-#include "dialog_multiplayer_join_ToS.qh"
-
-#include "textbox.qh"
-#include <lib/urllib.qh>
-
-
-entity makeXonoticServerToSTab()
-{
- entity me;
- me = NEW(XonoticServerToSTab);
- me.configureDialog(me);
- return me;
-}
-
-void XonoticServerToSTab_loadToS(entity me, string downloadurl)
-{
- url_single_fopen(downloadurl, FILE_READ, AdditionalServerInfo_OnGet, me);
-}
-
-void XonoticServerToSTab_fill(entity me)
-{
- entity e;
- me.TR(me);
- me.TD(me, me.rows, me.columns, e = makeXonoticTextBox());
- me.textBox = e;
-}
-
-void AdditionalServerInfo_OnGet(entity fh, entity me, int status)
-{
- switch (status) {
- case URL_READY_CLOSED:
- {
- break;
- }
- case URL_READY_ERROR:
- {
- me.text = strzone("Error reading ToS");
- me.textBox.setText(me.textBox, me.text);
- break;
- }
- case URL_READY_CANREAD:
- {
- strfree(me.text);
- string temp = "";
- for (string s; (s = url_fgets(fh)); )
- {
- if (temp != "")
- {
- temp = strcat(temp, "\n", s);
- }
- else
- {
- temp = s;
- }
- }
- url_fclose(fh);
- me.text = strzone(temp);
- me.textBox.setText(me.textBox, me.text);
- break;
- }
- default:
- {
- break;
- }
- }
-}
+++ /dev/null
-#pragma once
-
-#include "tab.qh"
-CLASS(XonoticServerToSTab, XonoticTab)
- METHOD(XonoticServerToSTab, fill, void(entity));
- METHOD(XonoticServerToSTab, loadToS, void(entity, string));
- ATTRIB(XonoticServerToSTab, title, string, _("Terms of Service"));
- ATTRIB(XonoticServerToSTab, color, vector, SKINCOLOR_DIALOG_SERVERINFO);
- ATTRIB(XonoticServerToSTab, intendedWidth, float, 0.8);
- ATTRIB(XonoticServerToSTab, rows, float, 17);
- ATTRIB(XonoticServerToSTab, columns, float, 6.2);
-
- ATTRIB(XonoticServerToSTab, text, string);
- ATTRIB(XonoticServerToSTab, textBox, entity);
-ENDCLASS(XonoticServerToSTab)
-entity makeXonoticServerToSTab();
-
-void AdditionalServerInfo_OnGet(entity fh, entity pass, int status);
#include "textlabel.qh"
#include "button.qh"
#include "dialog_multiplayer_join_serverinfotab.qh"
-#include "dialog_multiplayer_join_ToS.qh"
+#include "dialog_multiplayer_join_termsofservice.qh"
void XonoticServerInfoDialog_loadServerInfo(entity me, float i)
--- /dev/null
+#include "dialog_multiplayer_join_termsofservice.qh"
+
+#include "textbox.qh"
+#include <lib/urllib.qh>
+
+
+entity makeXonoticServerToSTab()
+{
+ entity me;
+ me = NEW(XonoticServerToSTab);
+ me.configureDialog(me);
+ return me;
+}
+
+void XonoticServerToSTab_loadToS(entity me, string downloadurl)
+{
+ url_single_fopen(downloadurl, FILE_READ, AdditionalServerInfo_OnGet, me);
+}
+
+void XonoticServerToSTab_fill(entity me)
+{
+ entity e;
+ me.TR(me);
+ me.TD(me, me.rows, me.columns, e = makeXonoticTextBox());
+ me.textBox = e;
+}
+
+void AdditionalServerInfo_OnGet(entity fh, entity me, int status)
+{
+ switch (status) {
+ case URL_READY_CLOSED:
+ {
+ break;
+ }
+ case URL_READY_ERROR:
+ {
+ me.text = strzone("Error reading ToS");
+ me.textBox.setText(me.textBox, me.text);
+ break;
+ }
+ case URL_READY_CANREAD:
+ {
+ strfree(me.text);
+ string temp = "";
+ for (string s; (s = url_fgets(fh)); )
+ {
+ if (temp != "")
+ {
+ temp = strcat(temp, "\n", s);
+ }
+ else
+ {
+ temp = s;
+ }
+ }
+ url_fclose(fh);
+ me.text = strzone(temp);
+ me.textBox.setText(me.textBox, me.text);
+ break;
+ }
+ default:
+ {
+ break;
+ }
+ }
+}
--- /dev/null
+#pragma once
+
+#include "tab.qh"
+CLASS(XonoticServerToSTab, XonoticTab)
+ METHOD(XonoticServerToSTab, fill, void(entity));
+ METHOD(XonoticServerToSTab, loadToS, void(entity, string));
+ ATTRIB(XonoticServerToSTab, title, string, _("Terms of Service"));
+ ATTRIB(XonoticServerToSTab, color, vector, SKINCOLOR_DIALOG_SERVERINFO);
+ ATTRIB(XonoticServerToSTab, intendedWidth, float, 0.8);
+ ATTRIB(XonoticServerToSTab, rows, float, 17);
+ ATTRIB(XonoticServerToSTab, columns, float, 6.2);
+
+ ATTRIB(XonoticServerToSTab, text, string);
+ ATTRIB(XonoticServerToSTab, textBox, entity);
+ENDCLASS(XonoticServerToSTab)
+entity makeXonoticServerToSTab();
+
+void AdditionalServerInfo_OnGet(entity fh, entity pass, int status);