Files
space-station-14/Content.Client/Stylesheets/Sheetlets/PanelSheetlet.cs
pathetic meowmeow 8cf744ec55 Visual nubody (humanoid appearance refactor) (#42476)
* initial visual nubody

* oops overlay

* im so pheeming rn

* conversion...

* tests

* comeback of the underwear

* oops eyes

* blabbl

* zeds

* yaml linted

* search and visible count constraints

* reordering

* preserve previously selected markings colors

* fix test

* some ui niceties

* ordering

* make DB changes backwards-compatible/downgrade-friendly

* fix things again

* fix migration

* vulpkanin markings limit increase

* wrapping

* code cleanup and more code cleanup and more code cleanup and more code cleanup and

* fix slop ports

* better sampling API

* make filter work + use the method i made for its intended purpose

* fix test fails real quick

* magic mirror cleanup, remove TODO

* don't 0-init the organ profile data

* remove deltastates

---------

Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
2026-01-20 07:07:53 +00:00

69 lines
3.0 KiB
C#

using Content.Client.Stylesheets.SheetletConfigs;
using Robust.Client.Graphics;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using static Content.Client.Stylesheets.StylesheetHelpers;
namespace Content.Client.Stylesheets.Sheetlets;
[CommonSheetlet]
public sealed class PanelSheetlet<T> : Sheetlet<T> where T : PalettedStylesheet, IButtonConfig
{
public override StyleRule[] GetRules(T sheet, object config)
{
IButtonConfig buttonCfg = sheet;
var boxLight = new StyleBoxFlat()
{
BackgroundColor = sheet.SecondaryPalette.BackgroundLight,
};
var boxDark = new StyleBoxFlat()
{
BackgroundColor = sheet.SecondaryPalette.BackgroundDark,
};
var boxPositive = new StyleBoxFlat { BackgroundColor = sheet.PositivePalette.Background };
var boxNegative = new StyleBoxFlat { BackgroundColor = sheet.NegativePalette.Background };
var boxHighlight = new StyleBoxFlat { BackgroundColor = sheet.HighlightPalette.Background };
var boxDropTarget = new StyleBoxFlat
{
BackgroundColor = sheet.ButtonPalette.BackgroundDark.WithAlpha(0.5f),
BorderColor = sheet.ButtonPalette.Base,
BorderThickness = new(2)
};
return
[
E<PanelContainer>().Class(StyleClass.PanelLight).Panel(boxLight),
E<PanelContainer>().Class(StyleClass.PanelDark).Panel(boxDark),
E<PanelContainer>().Class(StyleClass.PanelDropTarget).Panel(boxDropTarget),
E<PanelContainer>().Class(StyleClass.Positive).Panel(boxPositive),
E<PanelContainer>().Class(StyleClass.Negative).Panel(boxNegative),
E<PanelContainer>().Class(StyleClass.Highlight).Panel(boxHighlight),
// TODO: this should probably be cleaned up but too many UIs rely on this hardcoded color so I'm scared to touch it
E<PanelContainer>()
.Class("BackgroundDark")
.Prop(PanelContainer.StylePropertyPanel, new StyleBoxFlat(Color.FromHex("#25252A"))),
// panels that have the same corner bezels as buttons
E()
.Class(StyleClass.BackgroundPanel)
.Prop(PanelContainer.StylePropertyPanel, StyleBoxHelpers.BaseStyleBox(sheet))
.Modulate(sheet.SecondaryPalette.Background),
E()
.Class(StyleClass.BackgroundPanelDark)
.Prop(PanelContainer.StylePropertyPanel, StyleBoxHelpers.BaseStyleBox(sheet))
.Modulate(sheet.SecondaryPalette.BackgroundDark),
E()
.Class(StyleClass.BackgroundPanelOpenLeft)
.Prop(PanelContainer.StylePropertyPanel, StyleBoxHelpers.OpenLeftStyleBox(sheet))
.Modulate(sheet.SecondaryPalette.Background),
E()
.Class(StyleClass.BackgroundPanelOpenRight)
.Prop(PanelContainer.StylePropertyPanel, StyleBoxHelpers.OpenRightStyleBox(sheet))
.Modulate(sheet.SecondaryPalette.Background),
];
}
}