Skip to content
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

Show battle info on hover #1885

Merged
merged 8 commits into from
Oct 22, 2024
Merged

Show battle info on hover #1885

merged 8 commits into from
Oct 22, 2024

Conversation

aymericdelab
Copy link
Collaborator

This pull request adds the functionality to show battle information on hover, similar to how realm information is displayed.

Fixes #1865

Copy link

vercel bot commented Oct 22, 2024

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 Oct 22, 2024 9:35am

Copy link

Failed to generate code suggestions for PR

Copy link
Contributor

@mentatbot mentatbot bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pull request successfully implements the functionality to show battle information on hover, addressing issue #1865. The changes are well-structured and consistent with the project's coding style. The refactoring of BattleProgressBar into smaller components (BattleProgress, DurationLeft, ProgressBar) improves code organization and reusability. The new BattleInfoLabel component provides a good user experience for viewing battle information. Overall, this is a solid implementation that enhances the game's UI. Consider adding some comments to explain complex logic in certain areas, and it might be beneficial to add unit tests for the new components and functionality in the future.

Thanks for using MentatBot. Give comments a 👍 or 👎 to help me improve!

client/src/three/scenes/Worldmap.ts Show resolved Hide resolved
client/src/three/scenes/Worldmap.ts Show resolved Hide resolved
const getStructure = useStructureByPosition();
const hoveredBattlePosition = useUIStore((state) => state.hoveredBattle);
const currentTimestamp = useUIStore.getState().nextBlockTimestamp || 0;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding a comment to explain the purpose of filtering battles with duration_left > 0.

@@ -17,48 +17,62 @@ function formatTimeDifference(time: Date) {
}
}

export const BattleProgressBar = ({
export const DurationLeft = ({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The DurationLeft component is well-implemented, but consider adding a brief comment explaining its purpose and how it handles different battle states.

@edisontim edisontim merged commit dcc3c60 into rc-1 Oct 22, 2024
7 checks passed
@edisontim edisontim deleted the raschel/issue1865 branch October 22, 2024 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants