Page MenuHomeWildfire Games

Get dropsite resources from simulation.
ClosedPublic

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

Details

Reviewers
Angen
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.Fri, Aug 28, 5:43 PM
Owners added a subscriber: Restricted Owners Package.Fri, Aug 28, 5:43 PM

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

Freagarach requested review of this revision.Fri, Aug 28, 5:48 PM
Freagarach updated this revision to Diff 13367.Thu, Sep 3, 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.Thu, Sep 3, 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.Thu, Sep 3, 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.Thu, Sep 3, 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.Thu, Sep 3, 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.Fri, Sep 4, 8:52 AM
Freagarach marked 2 inline comments as done.

Reordering.

Nescio added inline comments.Fri, Sep 4, 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.Fri, Sep 4, 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.Fri, Sep 4, 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.

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

??

This revision now requires changes to proceed.Wed, Sep 9, 3:37 PM
Angen added inline comments.Wed, Sep 9, 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.

Angen added a comment.Fri, Sep 11, 9:33 PM

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

Angen accepted this revision.Fri, Sep 11, 9:37 PM

anyway

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

Thanks for the review @Angen :)