Page MenuHomeWildfire Games

Get dropsite resources from simulation.
ClosedPublic

Authored by Freagarach on Aug 28 2020, 5:43 PM.

Details

Reviewers
Silier
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Commits
rP24045: Get dropsites' accepting resources from simulation instead of hardcoding them…
Summary

This computes the resource types an entity can accept instead of hardcoding them in tooltips. (Since they can be changed via techs.)

Test Plan
  • Verify that the types are shown and change when the they're changed in the simulation.
  • Look at the tooltips and check if their presentation is acceptable.
  • Verify that translation is done properly.

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

Freagarach created this revision.Aug 28 2020, 5:43 PM
Owners added a subscriber: Restricted Owners Package.Aug 28 2020, 5:43 PM

One can also add this tooltip to the stucture viewer window(s).

Freagarach requested review of this revision.Aug 28 2020, 5:48 PM
Freagarach updated this revision to Diff 13367.Sep 3 2020, 9:52 AM
Freagarach retitled this revision from [WIP] - Get dropsite resources from simulation. to Get dropsite resources from simulation..
Freagarach edited the summary of this revision. (Show Details)
  • Update tooltips.
  • Also add information to structure viewer.
Owners added a subscriber: Restricted Owners Package.Sep 3 2020, 9:52 AM

Successful build - Chance fights ever on the side of the prudent.

builderr-debug-macos.txt
../../../source/simulation2/scripting/JSInterface_Simulation.cpp:155:4: warning: suggest braces around initialization of subobject [-Wmissing-braces]
                        CFixedVector2D(-halfSize.X, -halfSize.Y),
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
In file included from ../../../source/graphics/tests/test_Camera.cpp:17:
/Users/wfg/Jenkins/workspace/macos-differential/source/graphics/tests/test_Camera.h:168:4: warning: suggest braces around initialization of subobject [-Wmissing-braces]
                        CVector3D(-101.0f, -101.0f, 101.0f),
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
In file included from ../../../source/simulation2/tests/test_SerializeTemplates.cpp:17:
/Users/wfg/Jenkins/workspace/macos-differential/source/simulation2/tests/test_SerializeTemplates.h:39:4: warning: suggest braces around initialization of subobject [-Wmissing-braces]
                        3, 0, 1, 4, 1, 5
                        ^~~~~~~~~~~~~~~~
                        {               }
1 warning generated.
builderr-release-macos.txt
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/liblobby.a(precompiled.o) has no symbols
../../../source/simulation2/scripting/JSInterface_Simulation.cpp:155:4: warning: suggest braces around initialization of subobject [-Wmissing-braces]
                        CFixedVector2D(-halfSize.X, -halfSize.Y),
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/libsimulation2.a(precompiled.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/libengine.a(precompiled.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/libgraphics.a(precompiled.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/libatlas.a(precompiled.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/libgui.a(precompiled.o) has no symbols
In file included from ../../../source/graphics/tests/test_Camera.cpp:17:
/Users/wfg/Jenkins/workspace/macos-differential/source/graphics/tests/test_Camera.h:168:4: warning: suggest braces around initialization of subobject [-Wmissing-braces]
                        CVector3D(-101.0f, -101.0f, 101.0f),
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
In file included from ../../../source/simulation2/tests/test_SerializeTemplates.cpp:17:
/Users/wfg/Jenkins/workspace/macos-differential/source/simulation2/tests/test_SerializeTemplates.h:39:4: warning: suggest braces around initialization of subobject [-Wmissing-braces]
                        3, 0, 1, 4, 1, 5
                        ^~~~~~~~~~~~~~~~
                        {               }
1 warning generated.

Link to build: https://jenkins.wildfiregames.com/job/macos-differential/1453/display/redirect

Nescio added a subscriber: Nescio.Sep 3 2020, 10:39 AM

This is a nice improvement, I just tried it out, and it seems to work without errors and warnings:


However, I recommend displaying it directly after Cost, i.e. above Garrison Limit, instead of at the end.

Nescio added inline comments.Sep 3 2020, 10:52 AM
binaries/data/mods/public/simulation/templates/units/maur_support_elephant.xml
21 ↗(On Diff #13367)

List <VisibleClasses> after <SpecificName> and <Tooltip> but before <Formations> and <Icon>; see simulation/components/Identity.js.

25 ↗(On Diff #13367)

The <Tooltip> can be removed entirely.

Freagarach added inline comments.Sep 3 2020, 6:50 PM
binaries/data/mods/public/simulation/templates/units/maur_support_elephant.xml
21 ↗(On Diff #13367)

(It would be way easier if we'd just sort everything alphabetically,,,)

Freagarach updated this revision to Diff 13388.Sep 4 2020, 8:52 AM
Freagarach marked 2 inline comments as done.

Reordering.

Nescio added inline comments.Sep 4 2020, 12:15 PM
binaries/data/mods/public/gui/reference/common/ReferencePage.js
59 ↗(On Diff #13388)

Is this the most logical position?

binaries/data/mods/public/gui/session/selection_details.js
321 ↗(On Diff #13388)

Actually I'm not sure including it in the attack & resistance pop-up is necessary.
Also the order is different from the one in ReferencePage.js.

binaries/data/mods/public/gui/session/selection_panels.js
247 ↗(On Diff #13388)

Good.

978–989 ↗(On Diff #13388)

Where is this tooltip displayed?

Freagarach marked 2 inline comments as done.Sep 4 2020, 2:52 PM
Freagarach added inline comments.
binaries/data/mods/public/gui/reference/common/ReferencePage.js
59 ↗(On Diff #13388)

Depends whom you ask ;)

binaries/data/mods/public/gui/session/selection_panels.js
923 ↗(On Diff #13388)

^

Nescio added inline comments.Sep 4 2020, 3:10 PM
binaries/data/mods/public/gui/reference/common/ReferencePage.js
59 ↗(On Diff #13388)

If you ask me, I'd say list it above Health, since it's more qualitative than quantitative, unlike the others.

binaries/data/mods/public/gui/session/selection_panels.js
978 ↗(On Diff #13388)

Found it! I had to enable this under Options/In-Game.

Silier requested changes to this revision.Sep 9 2020, 3:37 PM
Silier added a subscriber: Silier.
Silier added inline comments.
binaries/data/mods/public/gui/common/tooltips.js
1003 ↗(On Diff #13388)

??

This revision now requires changes to proceed.Sep 9 2020, 3:37 PM
Silier added inline comments.Sep 9 2020, 3:41 PM
binaries/data/mods/public/globalscripts/Templates.js
351 ↗(On Diff #13388)

object creation is not needed, just assign to resourceDropsite

Freagarach marked 6 inline comments as done.
  • Remove redundant typeIcon in tooltip.
  • Remove tooltip from attackAndResistanceStats.
  • Show before health in reference page.
binaries/data/mods/public/globalscripts/Templates.js
351 ↗(On Diff #13388)

It needs to be in sync with GUIInterface.

1.) Looks fine
2.) I think dropsite types could be displayed somewhere for already build structure, just like gather rates are

Silier accepted this revision.Sep 11 2020, 9:37 PM

anyway

This revision is now accepted and ready to land.Sep 11 2020, 9:37 PM

Thanks for the review @Angen :)