isUndeletable is now getDeletionPolicy, and it's called twice instead of three times. This function is used to hide the (previously grayed-out) deletion icon for player-owned animals, since (a) Gaia-owned animals, which are the majority, don't display this icon either; and (b) already dead animals previously displayed this icon with an inconsistent tooltip ("The entity has to be killed before it can be gathered from"), and hiding the icon is the simplest and least confusing option for the player. Periods (.) have been added to full sentences in tooltips (I will help copy old translations).
Details
- Reviewers
Freagarach - Trac Tickets
- #6852
Tested in the game. Animals don't have a deletion icon, regardless of who owns them. The option to delete previously deletable entities remains unchanged. Undeletable entities owned by the player and those entities owned by the player with less than 50% of capture points have the grayed-out icon with explanatory tooltip(s), as before. If deletable and non-deletable entities are selected, the deletion icon is shown enabled, as before.
Diff Detail
- Repository
- rP 0 A.D. Public Repository
- Lint
Lint Skipped - Unit
Unit Tests Skipped - Build Status
Buildable 22251 Build 54382: Vulcan Build Jenkins Build 54381: Vulcan Build (macOS) Build 54380: Vulcan Build (Windows)
Event Timeline
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/docker-differential/8868/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/macos-differential/7197/display/redirect
(If a revision takes too long to get out of 'draft' status, one can manually 'request review' using the dropdown at the bottom of the page 'Add Action'.)
I haven't reviewed the logic yet, I'll try that later.
/home/abian/0ad/binaries/data/mods/public/gui/session/unit_actions.js | ||
---|---|---|
1417 ↗ | (On Diff #22128) | We prefer const where applicable (https://trac.wildfiregames.com/wiki/Coding_Conventions#JavaScript). |
1419 ↗ | (On Diff #22128) | One can inline the above query. |
1423 ↗ | (On Diff #22128) | (Inline) |
1437 ↗ | (On Diff #22128) | You don't need an else after a return. :) |
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/docker-differential/8872/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/macos-differential/7201/display/redirect
You removed quotation marks in object-keys (e.g. "tooltip": to tooltip:) is there consent on that?
Could you document what a policy is. Or write a comment what getDeletionPolicy returns.
The policy should have a isDeleteable method. Because the client-code should not have to know that if there is no undeletableReason it is deleteable.
Successful build - Chance fights ever on the side of the prudent.
Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/8292/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/macos-differential/7203/display/redirect
binaries/data/mods/public/gui/session/unit_actions.js | ||
---|---|---|
1433 | (With inline I meant this. We do want to keep the returns on a new line.) |