mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-12 20:01:11 +03:00
21 lines
675 B
C#
21 lines
675 B
C#
using Robust.Client.Graphics;
|
|
using Robust.Client.UserInterface.Controls;
|
|
|
|
namespace Content.Client.Corvax.Lobby.UI;
|
|
|
|
/// <summary>
|
|
/// Applies opacity only to the panel background while preserving the tint
|
|
/// supplied by the active UI stylesheet and leaving child controls opaque.
|
|
/// </summary>
|
|
public sealed class TranslucentPanelContainer : PanelContainer
|
|
{
|
|
public float BackgroundOpacity { get; set; } = 1f;
|
|
|
|
protected override void Draw(DrawingHandleScreen handle)
|
|
{
|
|
var previous = handle.Modulate;
|
|
handle.Modulate = previous.WithAlpha(previous.A * BackgroundOpacity);
|
|
base.Draw(handle);
|
|
handle.Modulate = previous;
|
|
}
|
|
}
|