From 27c107a448f429a9b6e696eb67a6d9ec73427d00 Mon Sep 17 00:00:00 2001 From: elexis Date: Sat, 22 Sep 2018 16:27:49 +0000 Subject: [PATCH] Inform users that they are subject to the mod.io Terms and Conditions and Privacy Policy and provide links following 833c9f108c / D1029. Refs GDPR #5257. Add link to feedback.wildfiregames.com, which demonstrates users how their data is going to be used. Add link buttons to the Terms dialog (refs #4583), so that users are informed of the terms prior to becoming subject to them. Don't link the DMCA / copyright terms of mod.io now since I found no UI with support for 3 buttons that doesn't appear unsatisfyingly ugly. Adds 3 button captions and 1 tooltip string. Differential Revision: https://code.wildfiregames.com/D1627 A Comment and a relatable patch in D1601 by smiley / (-_-). This was SVN commit r21890. --- binaries/data/config/default.cfg | 3 ++- binaries/data/mods/mod/gui/common/terms.js | 2 +- binaries/data/mods/mod/gui/modmod/modmodio.js | 12 +++++++++- .../mods/mod/gui/termsdialog/termsdialog.js | 20 +++++++++++++++- .../mods/mod/gui/termsdialog/termsdialog.xml | 24 ++++++++++++------- .../gui/pregame/userreport/userreport.js | 8 ++++++- source/ps/UserReport.cpp | 2 +- 7 files changed, 56 insertions(+), 15 deletions(-) diff --git a/binaries/data/config/default.cfg b/binaries/data/config/default.cfg index c09de07923..a49a41cb69 100644 --- a/binaries/data/config/default.cfg +++ b/binaries/data/config/default.cfg @@ -476,7 +476,8 @@ nick = true ; Play a sound when someone mentions your name debug = false ; Print error messages each time a translation for an English string is not found. [userreport] ; Opt-in online user reporting system -url = "http://feedback.wildfiregames.com/report/upload/v1/" +url_upload = "http://feedback.wildfiregames.com/report/upload/v1/" ; URL where UserReports are uploaded to +url_publication = "http://feedback.wildfiregames.com/" ; URL where UserReports were analyzed and published terms = "0" ; Version (hash) of the UserReporter Terms that the user has accepted [view] ; Camera control settings diff --git a/binaries/data/mods/mod/gui/common/terms.js b/binaries/data/mods/mod/gui/common/terms.js index c5480c616f..94138bd7ae 100644 --- a/binaries/data/mods/mod/gui/common/terms.js +++ b/binaries/data/mods/mod/gui/common/terms.js @@ -10,7 +10,7 @@ function openTerms(page) Engine.PushGuiPage("page_termsdialog.xml", { "file": g_Terms[page].file, "title": g_Terms[page].title, - "buttons": g_Terms[page].buttons || [], + "urlButtons": g_Terms[page].urlButtons || [], "page": page, "callback": "acceptTerms" }); diff --git a/binaries/data/mods/mod/gui/modmod/modmodio.js b/binaries/data/mods/mod/gui/modmod/modmodio.js index 7e65948f07..544a8e914f 100644 --- a/binaries/data/mods/mod/gui/modmod/modmodio.js +++ b/binaries/data/mods/mod/gui/modmod/modmodio.js @@ -6,7 +6,17 @@ function downloadModsButton() "file": translate("You are about to connect to the mod.io online service. This provides easy access to community-made mods, but is not under the control of Wildfire Games.\n\nWhile we have taken care to make this secure, we cannot guarantee with absolute certainty that this is not a security risk.\n\nDo you really want to connect?"), "config": "modio.disclaimer", "accepted": false, - "callback": openModIo + "callback": openModIo, + "urlButtons": [ + { + "caption": translate("mod.io Terms"), + "url": "https://mod.io/terms" + }, + { + "caption": translate("mod.io Privacy Policy"), + "url": "https://mod.io/privacy" + } + ] } }); diff --git a/binaries/data/mods/mod/gui/termsdialog/termsdialog.js b/binaries/data/mods/mod/gui/termsdialog/termsdialog.js index f0a2ebffd3..d9e4f7168d 100644 --- a/binaries/data/mods/mod/gui/termsdialog/termsdialog.js +++ b/binaries/data/mods/mod/gui/termsdialog/termsdialog.js @@ -1,4 +1,4 @@ -var g_TermsPage = ""; +var g_TermsPage; function init(data) { @@ -10,6 +10,24 @@ function init(data) Engine.FileExists(data.file) ? Engine.TranslateLines(Engine.ReadFile(data.file)) : data.file; + + initURLButtons(data.urlButtons); +} + +function initURLButtons(urlButtons) +{ + urlButtons.forEach((urlButton, i) => { + + let button = Engine.GetGUIObjectByName("button[" + i + "]"); + button.caption = urlButton.caption; + button.hidden = false; + button.tooltip = sprintf(translate("Open %(url)s in the browser."), { + "url": urlButton.url + }); + button.onPress = () => { + openURL(urlButton.url); + }; + }); } function closeTerms(accepted) diff --git a/binaries/data/mods/mod/gui/termsdialog/termsdialog.xml b/binaries/data/mods/mod/gui/termsdialog/termsdialog.xml index f8c3111c57..07ff729594 100644 --- a/binaries/data/mods/mod/gui/termsdialog/termsdialog.xml +++ b/binaries/data/mods/mod/gui/termsdialog/termsdialog.xml @@ -11,20 +11,26 @@ - + - - - Cancel - closeTerms(false); - + - - Connect - closeTerms(true); +