using Content.Client.Resources; using Content.Client.Stylesheets.Fonts; using Content.Client.Stylesheets.Palette; using Content.Client.Stylesheets.SheetletConfigs; using Content.Client.Stylesheets.Stylesheets; using Content.Client.UserInterface.Controls; using Robust.Client.Graphics; using Robust.Client.UserInterface; using Robust.Client.UserInterface.Controls; using Robust.Client.UserInterface.CustomControls; using static Content.Client.Stylesheets.StylesheetHelpers; namespace Content.Client.Stylesheets.Sheetlets; [CommonSheetlet] public sealed class WindowSheetlet : Sheetlet where T : PalettedStylesheet, IButtonConfig, IWindowConfig, IIconConfig { public override StyleRule[] GetRules(T sheet, object config) { IButtonConfig buttonCfg = sheet; IWindowConfig windowCfg = sheet; IIconConfig iconCfg = sheet; var headerStylebox = new StyleBoxTexture { Texture = sheet.GetTextureOr(windowCfg.WindowHeaderTexturePath, NanotrasenStylesheet.TextureRoot), PatchMarginBottom = 3, ExpandMarginBottom = 3, ContentMarginBottomOverride = 0, }; // TODO: This would probably be better palette-based but we can leave it for now. var headerAlertStylebox = new StyleBoxTexture { Texture = sheet.GetTextureOr(windowCfg.WindowHeaderAlertTexturePath, NanotrasenStylesheet.TextureRoot), PatchMarginBottom = 3, ExpandMarginBottom = 3, ContentMarginBottomOverride = 0, }; var backgroundBox = new StyleBoxTexture() { Texture = sheet.GetTextureOr(windowCfg.WindowBackgroundPath, NanotrasenStylesheet.TextureRoot), }; backgroundBox.SetPatchMargin(StyleBox.Margin.Horizontal | StyleBox.Margin.Bottom, 2); backgroundBox.SetExpandMargin(StyleBox.Margin.Horizontal | StyleBox.Margin.Bottom, 2); var borderedBackgroundBox = new StyleBoxTexture { Texture = sheet.GetTextureOr(windowCfg.WindowBackgroundBorderedPath, NanotrasenStylesheet.TextureRoot), }; borderedBackgroundBox.SetPatchMargin(StyleBox.Margin.All, 2); var closeButtonTex = sheet.GetTextureOr(iconCfg.CrossIconPath, NanotrasenStylesheet.TextureRoot); var leftPanel = StyleBoxHelpers.OpenLeftStyleBox(sheet); leftPanel.SetPadding(StyleBox.Margin.All, 0.0f); // TODO: maybe also change everything here to `NanoWindow` or something return [ // TODO: KILL DEFAULT WINDOW (in a bit) E