Repository navigation
Take a circle or cone off an agent without deleting the agent - #473
Merged
Merged
Conversation
An agent with a circle now has Detach circle and Remove circle in its right-click menu, and one with a cone gains Detach view cone beside Remove View Cone. Detaching is the reverse of dropping one on an agent: the agent goes back to a plain agent with the same id, and a free circle or cone is added drawn on the same spot, in one undo step. Both are kinds every build already saves.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 47 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
…maps and other marker sizes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Drop a circle or a cone on an agent and the two become one item. A cone could be taken off ("Remove View Cone"), but a circle couldn't: the only way to get rid of it was to delete the agent. LeonTM asked for this on Sep 9: "now you have to delete agents once stuff is attached and you want to remove it", with a right-click menu to detach.
The agent menu now has:
Detaching is attaching run backwards (
_convertFreeUtilityToComposite). The agent goes back to a plainPlacedAgentwith the same id, caption, weapon and team, and a freecustomCircleor view cone utility is added with the same diameter, colour and opacity, or the same preset, rotation, length and eye height. It's one transaction, so it's one undo step. The free item's saved position is the top-left that puts its anchor on the agent's middle (detach_from_agent.dart). Remove circle mirrorsconvertViewConeAgentToPlain.No saved-format change: both kinds already exist and every build draws them.
Seen in a running build
Driver build of this branch, Ascent (
tool/drive/scripts/detach-from-agent.json, clean run):Test
test/detach_from_agent_test.dart:screenPositionForWidget), not the formula detach uses, and fails by 1168 px if detach skips the placement step.Not covered
ci: analyze test


Confidence Score: 5/5
The PR appears safe to merge once CI confirms the added placement test passes.Summary
The PR lets users detach circles and view cones without deleting their agents. It also adds circle removal.
Reviews (2) · Last reviewed commit: "Test that a detached item is drawn on it..." · Reviewed by Greptile