Page MenuHomeWildfire Games

Add Help menu to Atlas
ClosedPublic

Authored by vladislavbelov on Aug 16 2017, 8:04 PM.

Details

Reviewers
elexis
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Restricted Owners Package(Owns No Changed Paths)
Commits
rP20021: Add help button to Atlas with a link to the Manual and bugtracker.
Summary

Currently if someone downloaded the game by link or by standard repo, he/she may don't know about Atlas wiki. So the patch adds link to the game. Like it's added to the game in the main menu.

Test Plan
  1. Run atlas
  2. Open any Help item

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

vladislavbelov created this revision.Aug 16 2017, 8:04 PM
elexis added a subscriber: elexis.Aug 16 2017, 8:13 PM

Not that I expect that URL to change more than once per decade, but it's not too nice to have an URL hardcoded in C++ IMO.
Could be loaded from a JSON file:

{
     "Manual": "https://trac.wildfiregames.com/wiki/Atlas_Manual",
     "ReportBug": "https://trac.wildfiregames.com/wiki/ReportingErrors"
}

In case we can get the event as a string, the switch might become unneeded.

Added @elexis 's suggestion about JSON and added the confirmation window.

Added help.json.

Vulcan added a subscriber: Vulcan.Aug 16 2017, 10:12 PM

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...

http://jw:8080/job/phabricator/1863/ for more details.

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...

http://jw:8080/job/phabricator/1866/ for more details.

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...

http://jw:8080/job/phabricator/1867/ for more details.

vladislavbelov retitled this revision from Add Help tab to Atlas to Add Help menu to Atlas.Aug 21 2017, 4:09 PM
elexis requested changes to this revision.Aug 21 2017, 6:13 PM

Can't get tools/atlas/help.json to work.

Also can you make that error show the filepath if the file is missing or could not be loaded?
(Correct not to modify messages.json, as that doesn't include the new directory and since nothing in atlas is translated.)

binaries/data/mods/mod/gui/atlas/help.json
4 ↗(On Diff #3150)

+the

9 ↗(On Diff #3150)

We might switch from trac to Phabricator or whatever platform. The string can be agnostic of our current choice.

"Click to visit our bug tracker to report a crash or other error.",

source/tools/atlas/AtlasUI/ScenarioEditor/ScenarioEditor.cpp
499 ↗(On Diff #3150)

There is "tools/atlas/icons/ScenarioEditor.ico", so we should use that directory.

501 ↗(On Diff #3150)

If the file is not found, it just says ../src/common/ffile.cpp(97): assert "IsOpened()" failed in ReadAll(): can't read from closed file

506 ↗(On Diff #3150)

Ok to have tooltips optional

508 ↗(On Diff #3150)

Not so familiar with macros. So ## is for code, # is for strings, therefore it's correct.
http://en.cppreference.com/w/cpp/preprocessor/replace#.23_and_.23.23_operators

This function call exists in wxwidgets 2.8 with that number of arguments, especially with the tooltip which I can't see displayed anywhere, but which must work according to the specs.
http://docs.wxwidgets.org/2.8/wx_wxmenu.html#wxmenuappend

981 ↗(On Diff #3150)

-the
-in your browser

984 ↗(On Diff #3150)

According to BuildInstructions we support 2.8 or later.
Luckily it's present in that version: http://docs.wxwidgets.org/2.8/wx_wxmessagedialog.html#wxmessagedialog

source/tools/atlas/AtlasUI/ScenarioEditor/ScenarioEditor.h
66 ↗(On Diff #3150)

do those newlines make sense?

This revision now requires changes to proceed.Aug 21 2017, 6:13 PM
In D794#32341, @elexis wrote:

Can't get tools/atlas/help.json to work.

You need to use the right path with '..'.

Also can you make that error show the filepath if the file is missing or could not be loaded?

There is already an error message if the filepath doesn't exist. It's reported by wxWidgets natively.

source/tools/atlas/AtlasUI/ScenarioEditor/ScenarioEditor.cpp
501 ↗(On Diff #3150)

Do you need more readable format? Currently we nostly do not show well formated messages for errors, which are throwed not by users directly.

508 ↗(On Diff #3150)

Yep, I've already checked compatibility. The help text should be shown in the statusbar, if it exists.

984 ↗(On Diff #3150)

Yep, I've already checked compatibility.

source/tools/atlas/AtlasUI/ScenarioEditor/ScenarioEditor.h
66 ↗(On Diff #3150)

Yes, it's grouped by menu groups.

You need to use the right path with '..'.

Upload and it should be good.

source/tools/atlas/AtlasUI/ScenarioEditor/ScenarioEditor.cpp
501 ↗(On Diff #3150)

Not a hard requirement, but having the filename in the message would be easier for the one with broken files to solve.
(Also I didn't see a ScenarioEditor.cpp entry in the call stack iirc.)

vladislavbelov edited edge metadata.
vladislavbelov marked 5 inline comments as done.

Added @elexis 's suggestions.

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...

http://jw:8080/job/phabricator/1900/ for more details.

elexis accepted this revision.Aug 22 2017, 1:29 AM

Thanks, the button with the links are really needed!

source/tools/atlas/AtlasUI/ScenarioEditor/ScenarioEditor.cpp
516 ↗(On Diff #3270)

whitespace

527 ↗(On Diff #3270)

wxLogError

This revision is now accepted and ready to land.Aug 22 2017, 1:29 AM
This revision was automatically updated to reflect the committed changes.