Skip to content

Conversation

@11EJDE11
Copy link
Contributor

Originally here: #323 by devo1929. I've updated it to work with the latest client and made a couple other minor changes.
Closes #290

gameinfopanel
(poor gif encoding - that red X actually looks fine)

Fix issue with lblSkillLevel visibility
Add layout constants

Co-authored-by: devo1929 <devo1929@users.noreply.github.com>
@github-actions
Copy link

github-actions bot commented Oct 23, 2025

Nightly build for this pull request:

  • artifacts.zip
    This comment is automatic and is meant to allow guests to get latest automatic builds without registering. It is updated on every successful build.

@SadPencil SadPencil requested a review from Copilot October 26, 2025 09:22
Copy link
Contributor

Copilot AI left a 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 GameInformationIconPanel component 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.

Comment on lines 3 to 4
using System.Linq;
using System.Collections.Generic;
Copy link

Copilot AI Oct 26, 2025

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.

Suggested change
using System.Linq;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

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);
Copy link

Copilot AI Oct 26, 2025

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.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

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);
Copy link

Copilot AI Oct 26, 2025

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.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 95bf699

@MahBoiDeveloper MahBoiDeveloper added this to the 2.13.0 milestone Oct 27, 2025
Add extra param to CreateDivider to specify a custom height
Add constant for spacing in icon panel
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.

Add icons to Game Information popup window

2 participants