-
-
Notifications
You must be signed in to change notification settings - Fork 112
Add icon legend to GameInformationPanel #861
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
base: develop
Are you sure you want to change the base?
Conversation
Fix issue with lblSkillLevel visibility Add layout constants Co-authored-by: devo1929 <devo1929@users.noreply.github.com>
|
Nightly build for this pull request:
|
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.
Pull Request Overview
This PR adds an icon legend to the GameInformationPanel that displays visual indicators for locked, passworded, and incompatible games. The legend appears dynamically below the player list when applicable game states are detected.
Key Changes:
- Introduced
GameInformationIconPanelcomponent to render icon-label pairs - Added dynamic legend rendering based on game state (locked/passworded/incompatible)
- Replaced magic numbers with named constants for improved maintainability
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| GameInformationPanel.cs | Added icon legend functionality with dynamic panel resizing, replaced hardcoded values with constants, and implemented legend visibility toggling based on game state |
| GameInformationIconPanel.cs | New component for rendering game state icons with associated labels |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| using System.Linq; | ||
| using System.Collections.Generic; |
Copilot
AI
Oct 26, 2025
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.
[nitpick] The using statements are not in alphabetical order. Move using System.Collections.Generic; before using System.Linq; to follow C# conventions.
| using System.Linq; | |
| using System.Collections.Generic; | |
| using System.Collections.Generic; | |
| using System.Linq; |
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.
Fixed in 95bf699
| { | ||
| var dividerPanel = new XNAPanel(WindowManager); | ||
| dividerPanel.DrawBorders = true; | ||
| dividerPanel.ClientRectangle = new Rectangle(0, y, ClientRectangle.Width, 1); |
Copilot
AI
Oct 26, 2025
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.
[nitpick] The divider height is hardcoded as 1. Consider extracting this to a named constant like dividerHeight for consistency with other constants in the class.
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.
Fixed in 95bf699.
| int panelHeight = Math.Max(icon.Height, textHeight); | ||
| float textY = (panelHeight - textHeight) / 2f; | ||
|
|
||
| DrawString(label, FontIndex, new Vector2(icon.Width + 6, textY), UISettings.ActiveSettings.TextColor); |
Copilot
AI
Oct 26, 2025
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.
[nitpick] The spacing value of 6 between the icon and label is hardcoded. Consider extracting this to a named constant like iconLabelSpacing for better maintainability.
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.
Fixed in 95bf699
Add extra param to CreateDivider to specify a custom height Add constant for spacing in icon panel
Originally here: #323 by devo1929. I've updated it to work with the latest client and made a couple other minor changes.
Closes #290
(poor gif encoding - that red X actually looks fine)