Annotation: OnSelectionChanged and GetSelectedUnits - #6967
Conversation
WalkthroughA comment was added to the Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
lua/ui/game/gamemain.lua (1)
608-608: Helpful tip for modders, consider minor wording clarification.The annotation is valuable documentation that warns modders about a gotcha behavior. The current phrasing is slightly ambiguous—it could be clearer that it's the result of calling
GetSelectedUnitswithin this function, not that the engine calls it.Consider rephrasing to: "Within this function (called by the engine),
GetSelectedUnits()will always returnnil." This makes it explicit that callingGetSelectedUnitsfrom within this callback won't work as expected.
Description of the proposed changes
Add annotation about
GetSelectedUnitsbeing used withinOnSelectionChanged.Testing done on the proposed changes
No testing needed.
Additional context
Useful tip for modders, so they don't stumble as I did.
Checklist
Summary by CodeRabbit
Note: This release contains no user-visible changes.