diff --git a/binaries/data/config/default.cfg b/binaries/data/config/default.cfg index 22be9b235e..b5368adcea 100644 --- a/binaries/data/config/default.cfg +++ b/binaries/data/config/default.cfg @@ -53,9 +53,8 @@ renderpath = default ; -1.0 to -1.5 recommended for good results. lodbias = 0 -; Profile selection - -profile = default +; Opt-in online user reporting system +userreport.url = "http://feedback.wildfiregames.com/report/upload/v1/" ; Font mappings: diff --git a/binaries/data/mods/public/gui/manual/intro.txt b/binaries/data/mods/public/gui/manual/intro.txt index 249625656b..68b377f59b 100644 --- a/binaries/data/mods/public/gui/manual/intro.txt +++ b/binaries/data/mods/public/gui/manual/intro.txt @@ -2,8 +2,6 @@ [font="serif-14"] Thank you for installing 0 A.D.! This page will give a brief overview of the features available in this incomplete, under-development, alpha version of the game. -[font="serif-12"]Use the "X" button in the top-right corner of this window to close it. Or click the "Close" button below. - [font="serif-bold-16"]Graphics settings [font="serif-14"]You can switch between fullscreen and windowed mode by pressing Alt+Enter. In windowed mode, you can resize the window. If the game runs too slowly, you can change some settings in the configuration file: look for binaries/data/config/default.cfg in the location where the game is installed, which gives instructions for editing, and try disabling the "fancywater" and "shadows" options. diff --git a/binaries/data/mods/public/gui/manual/manual.js b/binaries/data/mods/public/gui/manual/manual.js index 399227716b..101b38dc36 100644 --- a/binaries/data/mods/public/gui/manual/manual.js +++ b/binaries/data/mods/public/gui/manual/manual.js @@ -1,4 +1,4 @@ -function init() +function init(data) { - getGUIObjectByName("mainText").caption = readFile("gui/manual/intro.txt"); + getGUIObjectByName("mainText").caption = readFile("gui/manual/" + data.page + ".txt"); } diff --git a/binaries/data/mods/public/gui/manual/userreport.txt b/binaries/data/mods/public/gui/manual/userreport.txt new file mode 100644 index 0000000000..d707c00f43 --- /dev/null +++ b/binaries/data/mods/public/gui/manual/userreport.txt @@ -0,0 +1,12 @@ +As a free, open source game, we don't have the resources to test on a wide range of systems, but we want to provide the best quality experience to as many players as possible. When you enable automatic feedback, we'll receive data to help us understand the hardware we should focus on supporting, and to identify performance problems we should fix. + +The following data will be sent to our server: + +• A random user ID (stored in %APPDATA%\0ad\config\user.cfg on Windows, ~/.config/0ad/user.cfg on Unix), to let us detect repeated reports from the same user. +• Game version number and basic build settings (optimisation mode, CPU architecture). +• Hardware details: OS version, graphics driver version, OpenGL capabilities, screen size, CPU type, RAM. +• Performance details: a snapshot of timing data a few seconds after you start a match or change graphics settings. + +The data will only be a few kilobytes each time you run the game, so bandwidth usage is minimal. + +We will store the submitted data on our server, and may publish statistics or non-user-identifiable details to help other game developers with similar questions. We will store the IP address that submitted the data, to help detect abuse of the service, but will not publish it. diff --git a/binaries/data/mods/public/gui/pregame/mainmenu.js b/binaries/data/mods/public/gui/pregame/mainmenu.js index aeaa6299d2..a17019648b 100644 --- a/binaries/data/mods/public/gui/pregame/mainmenu.js +++ b/binaries/data/mods/public/gui/pregame/mainmenu.js @@ -1,8 +1,74 @@ +var userReportEnabledText; // contains the original version with "$status" placeholder + function init() { global.curr_music = newRandomSound("music", "menu"); if (global.curr_music) global.curr_music.loop(); + + userReportEnabledText = getGUIObjectByName("userReportEnabledText").caption; +} + +function submitUserReportMessage() +{ + var input = getGUIObjectByName("userReportMessageInput"); + var msg = input.caption; + if (msg.length) + Engine.SubmitUserReport("message", 1, msg); + input.caption = ""; +} + +function formatUserReportStatus(status) +{ + var d = status.split(/:/, 3); + + if (d[0] == "disabled") + return "disabled"; + + if (d[0] == "connecting") + return "connecting to server"; + + if (d[0] == "sending") + { + var done = d[1]; + return "uploading (" + Math.floor(100*done) + "%)"; + } + + if (d[0] == "completed") + { + var httpCode = d[1]; + if (httpCode == 200) + return "upload succeeded"; + else + return "upload failed (" + httpCode + ")"; + } + + if (d[0] == "failed") + { + var errCode = d[1]; + var errMessage = d[2]; + return "upload failed (" + errMessage + ")"; + } + + return "unknown"; +} + +function onTick() +{ + if (Engine.IsUserReportEnabled()) + { + getGUIObjectByName("userReportDisabled").hidden = true; + getGUIObjectByName("userReportEnabled").hidden = false; + + getGUIObjectByName("userReportEnabledText").caption = + userReportEnabledText.replace(/\$status/, + formatUserReportStatus(Engine.GetUserReportStatus())); + } + else + { + getGUIObjectByName("userReportDisabled").hidden = false; + getGUIObjectByName("userReportEnabled").hidden = true; + } } // Helper function that enables the dark background mask, then reveals a given subwindow object. diff --git a/binaries/data/mods/public/gui/pregame/mainmenu.xml b/binaries/data/mods/public/gui/pregame/mainmenu.xml index cb3e2993b8..2d9289e2c4 100644 --- a/binaries/data/mods/public/gui/pregame/mainmenu.xml +++ b/binaries/data/mods/public/gui/pregame/mainmenu.xml @@ -17,6 +17,11 @@ sprite="pgBackground" aspectratio="1.333333" > + + + onTick(); + + - + Manual @@ -268,6 +273,87 @@ Watch for updates or get involved in the development: http://wildfiregames.com/0 "to learn more about [icon=iconProduct] A.D., participate in the community, meet the developers, and learn how to become a part of development yourself.\n\n", "About [icon=iconProduct] A.D.", 2, [], []); ]]> + + + + + [font="serif-bold-16"]Help improve 0 A.D.![/font] + +You can automatically send us anonymous feedback that will help us to improve performance and compatibility and to fix bugs. + + + [font="serif-bold-16"]Enable feedback + Engine.SetUserReportEnabled(true); + + + Technical details + Engine.PushGuiPage("page_manual.xml", { "page": "userreport" }); + + + + + [font="serif-bold-16"]Thank you for helping improve 0 A.D.![/font] + +Anonymous feedback is currently enabled. +Status: $status. + + If you want to send a message to the developers, you can enter one here: + + + + + + Send + submitUserReportMessage(); + + + + Disable feedback + Engine.SetUserReportEnabled(false); + + + Technical details + Engine.PushGuiPage("page_manual.xml", { "page": "userreport" }); + + +