Add role icon utilities and enhance PlacedUtility class#48
Add role icon utilities and enhance PlacedUtility class#48SunkenInTime merged 3 commits intomainfrom
Conversation
- Introduced new UtilityType values for agent roles: controller, duelist, initiator, and sentinel. - Updated PlacedUtility class to include an isAlly property with default value. - Enhanced serialization and deserialization for PlacedUtility to handle the new isAlly property. - Added RoleIconUtility class for creating role icon widgets. - Updated various utility-related classes and methods to support ability size and isAlly parameters. These changes improve the utility system by allowing for role-specific icons and better handling of ally status in the game mechanics.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThis PR extends the utility system with four agent role icon types ( Key changes:
Confidence Score: 2/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant AgentRoleIconTools
participant Draggable
participant PlacedWidgetBuilder
participant UtilityProvider
participant UtilityData
User->>AgentRoleIconTools: Drag _RoleIconTile
AgentRoleIconTools->>Draggable: data = RoleIconToolData(type, centerPoint)
Note over AgentRoleIconTools: dragAnchorStrategy scales centerPoint<br/>feedback renders RoleIconUtilityWidget
User->>PlacedWidgetBuilder: Drop on map
PlacedWidgetBuilder->>PlacedWidgetBuilder: details.data is RoleIconToolData
PlacedWidgetBuilder->>UtilityProvider: addUtility(PlacedUtility(type, position, isAlly: teamProvider))
alt Tap to place
User->>AgentRoleIconTools: Tap _RoleIconTile
AgentRoleIconTools->>AgentRoleIconTools: _placeAtCenter(ref, toolData)
AgentRoleIconTools->>UtilityProvider: addUtility(PlacedUtility(type, centeredTopLeft, isAlly: teamProvider))
end
UtilityProvider->>UtilityData: utilityWidgets[type].createWidget(isAlly, abilitySize)
UtilityData->>RoleIconUtilityWidget: build with FramedIconShell
RoleIconUtilityWidget-->>User: renders ally/enemy colored icon on map
Last reviewed commit: c5acb98 |
There was a problem hiding this comment.
Pull request overview
Adds role-based utility icons and threads ally/enemy state + ability sizing through the utility rendering/serialization pipeline, enabling “agent role” widgets to be placed like other utilities.
Changes:
- Added new
UtilityTypevalues (controller/duelist/initiator/sentinel) and aRoleIconUtility+ widgets/tools to place them. - Extended
PlacedUtilitywithisAlly(defaulting totrue) and updated Hive + JSON serialization/deserialization. - Updated various utility builders/previews to pass
isAllyandabilitySize, and added a new sidebar tool mode/button for role icons.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/widgets/sidebar_widgets/tool_grid.dart | Adds a new “Agent Roles” tool button and context bar mode for role icon tools. |
| lib/widgets/sidebar_widgets/agent_role_icon_tools.dart | New sidebar tool UI for dragging/clicking role icons onto the canvas. |
| lib/widgets/page_transition_overlay.dart | Passes isAlly and abilitySize into utility preview rendering. |
| lib/widgets/draggable_widgets/utilities/utility_widget_builder.dart | Threads abilitySize and isAlly into utility widget construction. |
| lib/widgets/draggable_widgets/utilities/role_icon_utility_widget.dart | New rendered widget for role icons, using a framed shell and delete-target wiring. |
| lib/widgets/draggable_widgets/shared/framed_icon_shell.dart | New shared framed container used for abilities/role icons to unify styling/hover behavior. |
| lib/widgets/draggable_widgets/placed_widget_builder.dart | Accepts dropped RoleIconToolData and passes abilitySize into utility bounds logic. |
| lib/widgets/draggable_widgets/ability/ability_widget.dart | Refactors ability rendering to use FramedIconShell. |
| lib/providers/interaction_state_provider.dart | Adds InteractionState.roleIcons. |
| lib/hive/hive_adapters.g.yaml | Updates Hive schema indices for PlacedUtility.isAlly and new UtilityType values. |
| lib/hive/hive_adapters.g.dart | Implements Hive read/write for isAlly and new UtilityType enum cases. |
| lib/const/utilities.dart | Adds role icon utilities/tool data and expands utility APIs to accept isAlly/abilitySize. |
| lib/const/placed_classes.g.dart | Updates JSON (de)serialization for PlacedUtility (isAlly, compat converter). |
| lib/const/placed_classes.dart | Adds PlacedUtility.isAlly field and updates copy/constructor + compat converter annotation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
- Updated the PlacedUtility class to include an abilitySize parameter in the _getEffectiveUtilitySize method. - Modified the switchSides method to accept the new abilitySize parameter. - Adjusted the UtilityProvider to read abilitySize from the strategySettingsProvider and pass it to the switchSides method. These changes improve the utility system by allowing for more precise handling of ability sizes in the game mechanics.
|
@greptile how does it look now |
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
These changes improve the utility system by allowing for role-specific icons and better handling of ally status in the game mechanics.