Page MenuHomeWildfire Games

Support Resource Tooltips
ClosedPublic

Authored by elexis on Mar 7 2017, 10:38 AM.

Details

Summary

As requested in https://wildfiregames.com/forum/index.php?/topic/21935-resource-tooltips/
some mods might want to add descriptions for resources and display them in related places.

The attached patch adds support for adding resource descriptions, marking them as translatable and showing them in the top panel.

These strings in particular seem a bit useless, we can remove them and still add the code to support descriptions.
If someone has some proposals that wouldn't hurt.

The descriptions could also be shown in the summary screen code (which would need some rewiring), could be done in a simple ticket.

Test Plan

Start a match, hover the mouse over the resources. Research shared ally vision to see that the allied resources tooltip is visible too.
Execute the updateTemplates.py script, open the public-gui-other.pot file and search for simulation/data/resources/metal.json:description to confirm that the strings are extracted.

Diff Detail

Repository
rP 0 A.D. Public Repository
Branch
/ps/trunk
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 701
Build 1111: Vulcan BuildJenkins
Build 1110: arc lint + arc unit

Event Timeline

elexis created this revision.Mar 7 2017, 10:38 AM
Vulcan added a subscriber: Vulcan.Mar 7 2017, 11:24 AM

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (302 tests)..............................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (302 tests)..............................................................................................................................................................................................................................................................................................................OK!

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

Sandarac added inline comments.
binaries/data/mods/public/gui/session/session.js
1119

Extra space.

Works as advertised. I cannot comment on the code itself, but the end result gives the desired functionality as requested.

This revision is now accepted and ready to land.Apr 29 2017, 8:53 AM
This revision was automatically updated to reflect the committed changes.

Thanks for the test!

binaries/data/mods/public/gui/session/session.js
1119

thx

binaries/data/mods/public/simulation/data/resources/food.json
4

fields

binaries/data/mods/public/simulation/data/resources/metal.json
4

Periods

binaries/data/mods/public/simulation/data/resources/stone.json
4

or ruins.