fish-station/Content.Client/_Sunrise/MentorHelp/StatisticsEntryControl.xaml.cs
Copilot aba00f7e8f
Implement Mentor Help System (MHelp) - Complete Ticket-based Help for Game Questions (#2915)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: VigersRay <60344369+VigersRay@users.noreply.github.com>
Co-authored-by: Vigers Ray <vigersray@gmail.com>
2025-09-09 20:54:52 +03:00

46 lines
1.5 KiB
C#

using Content.Shared._Sunrise.MentorHelp;
using Content.Shared.Administration;
using Robust.Client.AutoGenerated;
using Robust.Client.Graphics;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
namespace Content.Client._Sunrise.MentorHelp
{
[GenerateTypedNameReferences]
public sealed partial class StatisticsEntryControl : PanelContainer
{
private static readonly Color NormalColor = Color.FromHex("#202023");
private static readonly Color HoverColor = Color.FromHex("#2F2F33");
public StatisticsEntryControl()
{
RobustXamlLoader.Load(this);
TooltipDelay = 0.5f;
BackgroundColorPanel.PanelOverride = new StyleBoxFlat
{
BackgroundColor = NormalColor
};
BackgroundColorPanel.OnMouseEntered += args =>
{
var panel = (StyleBoxFlat)BackgroundColorPanel.PanelOverride!;
panel.BackgroundColor = HoverColor;
};
BackgroundColorPanel.OnMouseExited += args =>
{
var panel = (StyleBoxFlat)BackgroundColorPanel.PanelOverride!;
panel.BackgroundColor = NormalColor;
};
}
public void UpdateData(MentorHelpStatisticsData data)
{
MentorNameLabel.Text = data.MentorName;
TicketsClaimedLabel.Text = data.TicketsClaimed.ToString();
MessagesCountLabel.Text = data.MessagesCount.ToString();
}
}
}