1
0
forked from 0ad/0ad

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.
This commit is contained in:
elexis 2018-09-22 16:27:49 +00:00
parent 82a89c4eb1
commit 27c107a448
7 changed files with 56 additions and 15 deletions

View File

@ -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

View File

@ -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"
});

View File

@ -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"
}
]
}
});

View File

@ -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)

View File

@ -11,20 +11,26 @@
<object name="title" style="ModernLabelText" type="text" size="50%-128 -18 50%+128 14"/>
<object size="20 20 100%-20 100%-50">
<object name="mainTextPanel" type="image" sprite="ModernFade" size="0 0 100% 100%">
<object name="mainTextPanel" type="image" sprite="ModernFade">
<object name="mainText" type="text" style="ModernTextPanel"/>
</object>
</object>
<object size="100%-355 100%-44 100% 100%-16">
<object type="button" style="ModernButtonRed" size="0 0 160 100%" hotkey="cancel">
<translatableAttribute id="caption">Cancel</translatableAttribute>
<action on="Press">closeTerms(false);</action>
</object>
<object size="25 100%-45 100% 100%-16">
<object type="button" style="ModernButtonRed" size="170 0 330 100%">
<translatableAttribute id="caption" context="mod.io connection message box">Connect</translatableAttribute>
<action on="Press">closeTerms(true);</action>
<object size="0 0 160 100%" type="button" name="button[0]" style="ModernButtonRed" hidden="true"/>
<object size="170 0 330 100%" type="button" name="button[1]" style="ModernButtonRed" hidden="true"/>
<object size="100%-355 0 100% 100%">
<object type="button" style="ModernButtonRed" size="0 0 160 100%" hotkey="cancel">
<translatableAttribute id="caption">Cancel</translatableAttribute>
<action on="Press">closeTerms(false);</action>
</object>
<object name="connectButton" type="button" style="ModernButtonRed" size="170 0 330 100%">
<translatableAttribute id="caption" context="mod.io connection message box">Connect</translatableAttribute>
<action on="Press">closeTerms(true);</action>
</object>
</object>
</object>

View File

@ -7,7 +7,13 @@ var g_TermsUserReport = {
"callback": data => {
setUserReportEnabled(data.accepted);
},
"accepted": false
"accepted": false,
"urlButtons": [
{
"caption": translate("Publications"),
"url": Engine.ConfigDB_GetValue("user", "userreport.url_publication")
}
]
}
};

View File

@ -579,7 +579,7 @@ void CUserReporter::Initialize()
std::string userID = LoadUserID();
std::string url;
CFG_GET_VAL("userreport.url", url);
CFG_GET_VAL("userreport.url_upload", url);
m_Worker = new CUserReporterWorker(userID, url);