using System.Numerics; using Content.Client.Stylesheets.Palette; using Content.Client.Stylesheets.SheetletConfigs; using Content.Client.Stylesheets.Stylesheets; 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 ButtonSheetlet : Sheetlet where T : PalettedStylesheet, IButtonConfig, IIconConfig { public override StyleRule[] GetRules(T sheet, object config) { IButtonConfig buttonCfg = sheet; IIconConfig iconCfg = sheet; var crossTex = sheet.GetTextureOr(iconCfg.CrossIconPath, NanotrasenStylesheet.TextureRoot); var refreshTex = sheet.GetTextureOr(iconCfg.RefreshIconPath, NanotrasenStylesheet.TextureRoot); var rules = new List { // Set textures for the kinds of buttons CButton() .Box(StyleBoxHelpers.BaseStyleBox(sheet)), CButton() .Class(StyleClass.ButtonOpenLeft) .Box(StyleBoxHelpers.OpenLeftStyleBox(sheet)), CButton() .Class(StyleClass.ButtonOpenRight) .Box(StyleBoxHelpers.OpenRightStyleBox(sheet)), CButton() .Class(StyleClass.ButtonOpenBoth) .Box(StyleBoxHelpers.SquareStyleBox(sheet)), CButton() .Class(StyleClass.ButtonSquare) .Box(StyleBoxHelpers.SquareStyleBox(sheet)), CButton() .Class(StyleClass.ButtonSmall) .Box(StyleBoxHelpers.SmallStyleBox(sheet)), CButton() .Class(StyleClass.ButtonSmall) .ParentOf(E