-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix army weight when exploring, add weigh + capacity in UI #1117
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
PR Reviewer Guide 🔍
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pull request addresses the issue of army weight when exploring and adds weight and capacity information to the UI. The changes look good overall, with improvements in accuracy for army capacity calculations and better user feedback. The addition of capacity checks before exploration is a good safeguard. The code is well-structured and the comments are helpful. Consider adding more context about the weight check in the contract for future maintainers.
Thanks for using MentatBot. Give comments a 👍 or 👎 to help me improve!
PR Code Suggestions ✨
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
User description
Closes #1078
PR Type
Enhancement, Bug fix
Description
capacity
andweight
properties toArmyInfo
type and includedWeight
component in various hooks and functions.ArmyCapacity
component to display army capacity and weight.setCapacityConfig
to remove precision modification for army weight.ArmyCapacity
component to display army capacity in multiple UI components includingEntity
,ArmyChip
,ArmyList
, andArmyInfoLabel
.ActionInfo
component.useTravelPath
hook andcanExplore
function.Changes walkthrough 📝
9 files
useArmies.tsx
Add weight and capacity properties to ArmyInfo type
client/src/hooks/helpers/useArmies.tsx
capacity
andweight
properties toArmyInfo
type.Weight
component in various hooks and functions.capacity
andweight
values informatArmies
function.
Entity.tsx
Display army capacity in Entity component
client/src/ui/components/entities/Entity.tsx
ArmyCapacity
component to display army capacity in the UI.ArmyChip.tsx
Display army capacity in ArmyChip component
client/src/ui/components/military/ArmyChip.tsx
ArmyCapacity
component to display army capacity in the ArmyChipcomponent.
ArmyList.tsx
Display army capacity in ArmyList component
client/src/ui/components/military/ArmyList.tsx
ArmyCapacity
component to display army capacity in the ArmyListcomponent.
ArmyInfoLabel.tsx
Display army capacity in ArmyInfoLabel component
client/src/ui/components/worldmap/armies/ArmyInfoLabel.tsx
ArmyCapacity
component to display army capacity in theArmyInfoLabel component.
useArmyByArmyEntityId
hook.ActionInfo.tsx
Display exploration reward in ActionInfo component
client/src/ui/components/worldmap/hexagon/ActionInfo.tsx
useTravelPath.tsx
Add capacity check for exploration in useTravelPath hook
client/src/ui/components/worldmap/hexagon/useTravelPath.tsx
utils.tsx
Add capacity check in canExplore function
client/src/ui/components/worldmap/hexagon/utils.tsx
canExplore
function.ArmyCapacity.tsx
Create ArmyCapacity component to display capacity and weight
client/src/ui/elements/ArmyCapacity.tsx
ArmyCapacity
component to display army capacity and weight.1 files
index.ts
Update setCapacityConfig to remove precision modification
sdk/packages/eternum/src/config/index.ts
setCapacityConfig
to remove precision modification for armyweight.