A few non-functional actions are suggested in the left and right panels of the GUI for Gaia entities. These suggestions sometimes cause warnings and errors (#6853) because Gaia is not a civilization and has no phases, technologies or specific units. This patch ensures that only (a) functional suggestions or (b) suggestions with informative value are provided. Examples of non-functional suggestions with informative value include stances (although the stance of a unit owned by Gaia cannot be changed, the panel informs what the current stance is) and formations (the panel reports the current formation of a set of units, if any). This patch also avoids displaying the left or right panels in certain cases where they were completely empty.
Details
Test 1:
- Start a game and select a builder. The right panel shows the build options as usual.
- Resign and stay in the game. Select the same builder. Now the right panel does not show any build option.
Test 2 (thanks to phosit):
- Start a game with ./binaries/system/pyrogenesis -autostart="random/danubius" -autostart-player=-1.
- Check that non-functional and non-informative suggestions are not displayed, while functional or informative suggestions are still displayed.
Diff Detail
- Repository
- rP 0 A.D. Public Repository
- Lint
Lint Skipped - Unit
Unit Tests Skipped - Build Status
Buildable 22480 Build 55032: Vulcan Build Jenkins Build 55031: Vulcan Build (macOS) Jenkins Build 55030: Vulcan Build (Windows) Jenkins
Event Timeline
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/macos-differential/7371/display/redirect
Successful build - Chance fights ever on the side of the prudent.
Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/8460/display/redirect
A gaia unit that wasn't owned by a player won't show the builder panel. Seems like a case of resigning not doing proper cleanup.
Nice find as for the issue but the solution seems like a quick hack.
It would be more consistent if gaia (the civ) hasn't any building, insted of gaia (the player) can't build anything.
Try Danubis, the gaia units don't show a builder panel for me. Maybe what you checked was constructed in a way subject to no cleanup or this faulty behavior was introduced very recently.
Try Danubis, the gaia units don't show a builder panel for me.
It's reproducable this way:
- Start a game via this command ./binaries/system/pyrogenesis -autostart="random/danubius" -autostart-player=-1
- Select a gaia unit that can build.
- See that there is a builder panel.
Indeed I got misled by the check for the builder component and checked while having a player id to confirm my suspicion ...
The fact still remains, if there is use for a builder component for gaia units it should be in a working state (unlike now), if it's considered useless it shouldn't be created or be freed upon transition.
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/macos-differential/7385/display/redirect
Successful build - Chance fights ever on the side of the prudent.
Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/8474/display/redirect
binaries/data/mods/public/gui/session/unit_commands.js | ||
---|---|---|
141–145 | No, I didn't, it's the same. | |
155–160 | Okay, I'll change it. | |
196–198 | Sure, thanks! |
Successful build - Chance fights ever on the side of the prudent.
Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/8485/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/macos-differential/7396/display/redirect
You should prefere === over ==.
binaries/data/mods/public/gui/session/unit_commands.js | ||
---|---|---|
141–145 | Why did you change it then. It will mess up the blame output. Also const isObserverOr... = g_IsObserver || ... feels redundant. | |
159 | In the summary you wrote that a panel is hidden when it's empty. So it should not directly depend if the entity is owned by gaia. | |
196–198 | I would make it consistent. |