using Content.Client.Examine; using Content.Client.Stylesheets.Fonts; using Content.Client.Stylesheets.SheetletConfigs; using Content.Client.Stylesheets.Stylesheets; 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.Hud; [CommonSheetlet] public sealed class TooltipSheetlet : Sheetlet where T: PalettedStylesheet, ITooltipConfig { public override StyleRule[] GetRules(T sheet, object config) { ITooltipConfig tooltipCfg = sheet; var tooltipBox = sheet.GetTextureOr(tooltipCfg.TooltipBoxPath, NanotrasenStylesheet.TextureRoot) .IntoPatch(StyleBox.Margin.All, 2); tooltipBox.SetContentMarginOverride(StyleBox.Margin.Horizontal, 7); var whisperBox = sheet.GetTextureOr(tooltipCfg.WhisperBoxPath, NanotrasenStylesheet.TextureRoot) .IntoPatch(StyleBox.Margin.All, 2); whisperBox.SetContentMarginOverride(StyleBox.Margin.Horizontal, 7); return [ E() .Class(StyleClass.TooltipPanel) .Modulate(Color.Gray.WithAlpha(0.9f)) // TODO: you know the drill by now .Panel(tooltipBox), E() .Class(StyleClass.TooltipTitle) .Font(sheet.BaseFont.GetFont(14, FontKind.Bold)), E() .Class(StyleClass.TooltipDesc) .Font(sheet.BaseFont.GetFont(12)), E() // ReSharper disable once AccessToStaticMemberViaDerivedType .Prop(Tooltip.StylePropertyPanel, tooltipBox), E() .Class(ExamineSystem.StyleClassEntityTooltip) .Panel(tooltipBox), E() .Class("speechBox", "sayBox") .Panel(tooltipBox), E() .Class("speechBox", "whisperBox") .Panel(whisperBox), E() .Class("speechBox", "whisperBox") .ParentOf(E().Class("bubbleContent")) .Prop(Label.StylePropertyFont, sheet.BaseFont.GetFont(12, FontKind.Italic)), E() .Class("speechBox", "emoteBox") .ParentOf(E().Class("bubbleContent")) .Prop(Label.StylePropertyFont, sheet.BaseFont.GetFont(12, FontKind.Italic)), ]; } }