Closed edisontim closed 4 days ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
eternum | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Nov 18, 2024 1:35pm |
eternum-docs | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Nov 18, 2024 1:35pm |
The pull request introduces several enhancements across multiple components and hooks in the application. A new hook, useUserBattles
, retrieves battles associated with user armies. Modifications to existing hooks improve structure filtering and sorting. The BattleListItem
and UserBattles
components are updated to streamline rendering and interaction with battle data. The Checkbox
component is enhanced for better user interaction, while the Entities
component gains interactivity through toggleable sections. Other changes include adjustments to the Military
component for a tabbed interface and various updates to the troop management system in the contract.
File | Change Summary |
---|---|
client/src/hooks/helpers/battles/useBattles.tsx |
Added useUserBattles hook to retrieve user-associated battles. |
client/src/hooks/helpers/useEntities.tsx |
Updated getPlayerStructures and getOtherStructures for filtering and sorting. |
client/src/ui/components/battles/BattleListItem.tsx |
Removed getUserArmyInBattle , added showCompass prop, simplified button rendering logic. |
client/src/ui/components/military/UserBattles.tsx |
Introduced UserBattles component to display user battles. |
client/src/ui/elements/Checkbox.tsx |
Updated Checkbox to include onClick and text props, enhanced layout. |
client/src/ui/modules/entity-details/Battles.tsx |
Modified outer <div> class for layout adjustments. |
client/src/ui/modules/entity-details/CombatEntityDetails.tsx |
Removed useEffect , simplified state management. |
client/src/ui/modules/entity-details/EnemyArmies.tsx |
Adjusted rendering logic in getArmyChip and updated structure for displaying enemy armies. |
client/src/ui/modules/entity-details/Entities.tsx |
Updated function signature to include battles , added state for visibility toggles. |
client/src/ui/modules/military/Military.tsx |
Introduced tabbed interface with UserBattles and state management for selected tab. |
contracts/src/systems/combat/contracts/troop_systems.cairo |
Removed owner_address from troop-related methods, streamlined army management logic. |
scripts/indexer.sh |
Added --external argument for enhanced script execution, updated command parameters. |
client/src/ui/components/structures/worldmap/StructureCard.tsx |
Made StructureMergeTroopsPanel local, updated props and troop merging logic. |
contracts/src/systems/map/map_generation.cairo |
Simplified add_mercenaries_to_structure method call, updated logic for mine discovery. |
Objective | Addressed | Explanation |
---|---|---|
Show battles you are involved in in military tab (2023) | ✅ | |
Sort realms in alphabetical order (2085) | ✅ | |
Fix multiple battles bug (2086) | ❓ | Unclear if the changes fully address the simultaneous battle interaction issue. |
useUserBattles
hook in the main PR is related to the changes in the UserBattles
component, which utilizes this hook to fetch and display battles associated with the user.BattleProgressBar
component regarding time display may relate to the overall battle management context, which is relevant to the useUserBattles
hook's functionality.ClientConfigManager
and its methods may indirectly affect how battle data is managed, which is relevant to the useUserBattles
hook's context.BattleManager
class regarding troop health and battle states may impact the functionality of the useUserBattles
hook, as it retrieves battles related to user armies.ArmyMovementManager
class may relate to the overall battle management system, which is relevant to the context of battles retrieved by the useUserBattles
hook.useUserBattles
hook, ensuring that battles are accurately associated with the correct user armies.EntitiesArmyTable
component may provide additional context for battles retrieved by the useUserBattles
hook.useUserBattles
hook's functionality.useUserBattles
hook.useUserBattles
hook.🐇 In the fields where battles bloom,
A new hook brings forth the loom.
User armies now take flight,
With each battle, a new delight.
Click the checkbox, see them merge,
In this world, our troops converge! 🌼
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Failed to generate code suggestions for PR
closes #2023 closes #2085 closes #2086
Summary by CodeRabbit
Release Notes
New Features
useUserBattles
hook for retrieving user-associated battles.UserBattles
component to display user battles.Military
component for switching between army and battles views.Checkbox
component with click handling and optional text display.Improvements
BattleListItem
for button visibility and rendering.EnemyArmies
with clear section headings.Entities
andCombatEntityDetails
components.StructureCard
for better troop merging functionality and user feedback.Bug Fixes
getPlayerStructures
andgetOtherStructures
functions.