Flash a pawn red when its move command fails #100
Labels
No labels
assets
bug
duplicate
enhancement
help wanted
invalid
question
testing
ui
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
liamjd/UntitledColonyBuilder#100
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Part of milestone #4. Split out of #83, which implemented the re-path itself but left the "flash it red" half of its design undone.
#83's design says: "If the re-path is empty (the building sealed the only route), stop the pawn and flash it red, the same feedback as an unreachable command." As merged (
30b67c6),Pawns.repath_pawns()callsstop()thenmove_to(), and whenmove_to()returnsfalsethe pawn just stands there with no feedback — indistinguishable from a pawn that arrived.What to build
A short, self-reverting tint on the pawn's view, triggered wherever a move command fails:
PawnView.flash(colour, duration)(or a narrowerflash_rejected()) that tints the capsule and restores the original look when it ends. OneTweenon the view, cancelled and restarted if a second flash lands while one is running, so repeated failed commands don't leave the pawn stuck red.Pawns.repath_pawns()flashes the pawn whenmove_to()returnsfalseafter the re-path.false— the "unreachable command" case #83 refers to. Which caller owns that depends on how #78's picker/move command lands; if it isn't in place yet, wire only the re-path case and note the other in a comment.Implementation notes
MeshInstance3D.material_override, not by mutating the mesh's material.pawn.tscn'sCapsuleMeshand itsStandardMaterial3Dare sub-resources shared by every instance of the scene, so writingalbedo_colorthroughmesh.materialwould flash all pawns red. (pawn_view.gd:24already mutates the shared mesh'sheightfor the same reason — worth a separate look, out of scope here.) Setting and then clearingmaterial_overridekeeps it per-instance.GameClock. Use the rawdelta/Tween, notGameClock.delta_for().Pawnis a record; nothing about a transient tint belongs on it.gl_compatibilityrenders nothing, so unit tests can only assert the state, not the pixels.AC
Tweenis owned by the view, not leaked).Not in scope
Toast/UI messaging for the same failure — that's #57.