1
0

StyleNano.cs 90 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720
  1. using System.Linq;
  2. using System.Numerics;
  3. using Content.Client.ContextMenu.UI;
  4. using Content.Client.Examine;
  5. using Content.Client.PDA;
  6. using Content.Client.Resources;
  7. using Content.Client.Silicons.Laws.SiliconLawEditUi;
  8. using Content.Client.UserInterface.Controls;
  9. using Content.Client.UserInterface.Controls.FancyTree;
  10. using Content.Client.Verbs.UI;
  11. using Content.Shared.Verbs;
  12. using Robust.Client.Graphics;
  13. using Robust.Client.ResourceManagement;
  14. using Robust.Client.UserInterface;
  15. using Robust.Client.UserInterface.Controls;
  16. using Robust.Client.UserInterface.CustomControls;
  17. using Robust.Shared.Graphics;
  18. using static Robust.Client.UserInterface.StylesheetHelpers;
  19. namespace Content.Client.Stylesheets
  20. {
  21. public static class ResCacheExtension
  22. {
  23. public static Font NotoStack(this IResourceCache resCache, string variation = "Regular", int size = 10, bool display = false)
  24. {
  25. var ds = display ? "Display" : "";
  26. var sv = variation.StartsWith("Bold", StringComparison.Ordinal) ? "Bold" : "Regular";
  27. return resCache.GetFont
  28. (
  29. // Ew, but ok
  30. new[]
  31. {
  32. $"/Fonts/NotoSans{ds}/NotoSans{ds}-{variation}.ttf",
  33. $"/Fonts/NotoSans/NotoSansSymbols-{sv}.ttf",
  34. "/Fonts/NotoSans/NotoSansSymbols2-Regular.ttf"
  35. },
  36. size
  37. );
  38. }
  39. }
  40. // STLYE SHEETS WERE A MISTAKE. KILL ALL OF THIS WITH FIRE
  41. public sealed class StyleNano : StyleBase
  42. {
  43. public const string StyleClassBorderedWindowPanel = "BorderedWindowPanel";
  44. public const string StyleClassInventorySlotBackground = "InventorySlotBackground";
  45. public const string StyleClassHandSlotHighlight = "HandSlotHighlight";
  46. public const string StyleClassChatPanel = "ChatPanel";
  47. public const string StyleClassChatSubPanel = "ChatSubPanel";
  48. public const string StyleClassTransparentBorderedWindowPanel = "TransparentBorderedWindowPanel";
  49. public const string StyleClassHotbarPanel = "HotbarPanel";
  50. public const string StyleClassTooltipPanel = "tooltipBox";
  51. public const string StyleClassTooltipAlertTitle = "tooltipAlertTitle";
  52. public const string StyleClassTooltipAlertDescription = "tooltipAlertDesc";
  53. public const string StyleClassTooltipAlertCooldown = "tooltipAlertCooldown";
  54. public const string StyleClassTooltipActionTitle = "tooltipActionTitle";
  55. public const string StyleClassTooltipActionDescription = "tooltipActionDesc";
  56. public const string StyleClassTooltipActionCooldown = "tooltipActionCooldown";
  57. public const string StyleClassTooltipActionRequirements = "tooltipActionCooldown";
  58. public const string StyleClassTooltipActionCharges = "tooltipActionCharges";
  59. public const string StyleClassHotbarSlotNumber = "hotbarSlotNumber";
  60. public const string StyleClassActionSearchBox = "actionSearchBox";
  61. public const string StyleClassActionMenuItemRevoked = "actionMenuItemRevoked";
  62. public const string StyleClassChatLineEdit = "chatLineEdit";
  63. public const string StyleClassChatChannelSelectorButton = "chatSelectorOptionButton";
  64. public const string StyleClassChatFilterOptionButton = "chatFilterOptionButton";
  65. public const string StyleClassStorageButton = "storageButton";
  66. public const string StyleClassSliderRed = "Red";
  67. public const string StyleClassSliderGreen = "Green";
  68. public const string StyleClassSliderBlue = "Blue";
  69. public const string StyleClassSliderWhite = "White";
  70. public const string StyleClassLabelHeadingBigger = "LabelHeadingBigger";
  71. public const string StyleClassLabelKeyText = "LabelKeyText";
  72. public const string StyleClassLabelSecondaryColor = "LabelSecondaryColor";
  73. public const string StyleClassLabelBig = "LabelBig";
  74. public const string StyleClassLabelSmall = "LabelSmall";
  75. public const string StyleClassButtonBig = "ButtonBig";
  76. public const string StyleClassButtonHelp = "HelpButton";
  77. public const string StyleClassPopupMessageSmall = "PopupMessageSmall";
  78. public const string StyleClassPopupMessageSmallCaution = "PopupMessageSmallCaution";
  79. public const string StyleClassPopupMessageMedium = "PopupMessageMedium";
  80. public const string StyleClassPopupMessageMediumCaution = "PopupMessageMediumCaution";
  81. public const string StyleClassPopupMessageLarge = "PopupMessageLarge";
  82. public const string StyleClassPopupMessageLargeCaution = "PopupMessageLargeCaution";
  83. public static readonly Color PanelDark = Color.FromHex("#1E1E22");
  84. public static readonly Color NanoGold = Color.FromHex("#A88B5E");
  85. public static readonly Color GoodGreenFore = Color.FromHex("#31843E");
  86. public static readonly Color ConcerningOrangeFore = Color.FromHex("#A5762F");
  87. public static readonly Color DangerousRedFore = Color.FromHex("#BB3232");
  88. public static readonly Color DisabledFore = Color.FromHex("#5A5A5A");
  89. public static readonly Color ButtonColorDefault = Color.FromHex("#464966");
  90. public static readonly Color ButtonColorDefaultRed = Color.FromHex("#D43B3B");
  91. public static readonly Color ButtonColorHovered = Color.FromHex("#575b7f");
  92. public static readonly Color ButtonColorHoveredRed = Color.FromHex("#DF6B6B");
  93. public static readonly Color ButtonColorPressed = Color.FromHex("#3e6c45");
  94. public static readonly Color ButtonColorDisabled = Color.FromHex("#30313c");
  95. public static readonly Color ButtonColorCautionDefault = Color.FromHex("#ab3232");
  96. public static readonly Color ButtonColorCautionHovered = Color.FromHex("#cf2f2f");
  97. public static readonly Color ButtonColorCautionPressed = Color.FromHex("#3e6c45");
  98. public static readonly Color ButtonColorCautionDisabled = Color.FromHex("#602a2a");
  99. public static readonly Color ButtonColorGoodDefault = Color.FromHex("#3E6C45");
  100. public static readonly Color ButtonColorGoodHovered = Color.FromHex("#31843E");
  101. public static readonly Color ButtonColorGoodDisabled = Color.FromHex("#164420");
  102. //NavMap
  103. public static readonly Color PointRed = Color.FromHex("#B02E26");
  104. public static readonly Color PointGreen = Color.FromHex("#38b026");
  105. public static readonly Color PointMagenta = Color.FromHex("#FF00FF");
  106. // Context menu button colors
  107. public static readonly Color ButtonColorContext = Color.FromHex("#1119");
  108. public static readonly Color ButtonColorContextHover = Color.DarkSlateGray;
  109. public static readonly Color ButtonColorContextPressed = Color.LightSlateGray;
  110. public static readonly Color ButtonColorContextDisabled = Color.Black;
  111. // Examine button colors
  112. public static readonly Color ExamineButtonColorContext = Color.Transparent;
  113. public static readonly Color ExamineButtonColorContextHover = Color.DarkSlateGray;
  114. public static readonly Color ExamineButtonColorContextPressed = Color.LightSlateGray;
  115. public static readonly Color ExamineButtonColorContextDisabled = Color.FromHex("#5A5A5A");
  116. // Fancy Tree elements
  117. public static readonly Color FancyTreeEvenRowColor = Color.FromHex("#25252A");
  118. public static readonly Color FancyTreeOddRowColor = FancyTreeEvenRowColor * new Color(0.8f, 0.8f, 0.8f);
  119. public static readonly Color FancyTreeSelectedRowColor = new Color(55, 55, 68);
  120. //Used by the APC and SMES menus
  121. public const string StyleClassPowerStateNone = "PowerStateNone";
  122. public const string StyleClassPowerStateLow = "PowerStateLow";
  123. public const string StyleClassPowerStateGood = "PowerStateGood";
  124. public const string StyleClassItemStatus = "ItemStatus";
  125. public const string StyleClassItemStatusNotHeld = "ItemStatusNotHeld";
  126. public static readonly Color ItemStatusNotHeldColor = Color.Gray;
  127. //Background
  128. public const string StyleClassBackgroundBaseDark = "PanelBackgroundBaseDark";
  129. //Buttons
  130. public const string StyleClassCrossButtonRed = "CrossButtonRed";
  131. public const string StyleClassButtonColorRed = "ButtonColorRed";
  132. public const string StyleClassButtonColorGreen = "ButtonColorGreen";
  133. public static readonly Color ChatBackgroundColor = Color.FromHex("#25252ADD");
  134. //Bwoink
  135. public const string StyleClassPinButtonPinned = "pinButtonPinned";
  136. public const string StyleClassPinButtonUnpinned = "pinButtonUnpinned";
  137. public override Stylesheet Stylesheet { get; }
  138. public StyleNano(IResourceCache resCache) : base(resCache)
  139. {
  140. var notoSans8 = resCache.NotoStack(size: 8);
  141. var notoSans10 = resCache.NotoStack(size: 10);
  142. var notoSansItalic10 = resCache.NotoStack(variation: "Italic", size: 10);
  143. var notoSans12 = resCache.NotoStack(size: 12);
  144. var notoSansItalic12 = resCache.NotoStack(variation: "Italic", size: 12);
  145. var notoSansBold12 = resCache.NotoStack(variation: "Bold", size: 12);
  146. var notoSansBoldItalic12 = resCache.NotoStack(variation: "BoldItalic", size: 12);
  147. var notoSansBoldItalic14 = resCache.NotoStack(variation: "BoldItalic", size: 14);
  148. var notoSansBoldItalic16 = resCache.NotoStack(variation: "BoldItalic", size: 16);
  149. var notoSansDisplayBold14 = resCache.NotoStack(variation: "Bold", display: true, size: 14);
  150. var notoSansDisplayBold16 = resCache.NotoStack(variation: "Bold", display: true, size: 16);
  151. var notoSans15 = resCache.NotoStack(variation: "Regular", size: 15);
  152. var notoSans16 = resCache.NotoStack(variation: "Regular", size: 16);
  153. var notoSansBold16 = resCache.NotoStack(variation: "Bold", size: 16);
  154. var notoSansBold18 = resCache.NotoStack(variation: "Bold", size: 18);
  155. var notoSansBold20 = resCache.NotoStack(variation: "Bold", size: 20);
  156. var notoSansMono = resCache.GetFont("/EngineFonts/NotoSans/NotoSansMono-Regular.ttf", size: 12);
  157. var windowHeaderTex = resCache.GetTexture("/Textures/Interface/Nano/window_header.png");
  158. var windowHeader = new StyleBoxTexture
  159. {
  160. Texture = windowHeaderTex,
  161. PatchMarginBottom = 3,
  162. ExpandMarginBottom = 3,
  163. ContentMarginBottomOverride = 0
  164. };
  165. var windowHeaderAlertTex = resCache.GetTexture("/Textures/Interface/Nano/window_header_alert.png");
  166. var windowHeaderAlert = new StyleBoxTexture
  167. {
  168. Texture = windowHeaderAlertTex,
  169. PatchMarginBottom = 3,
  170. ExpandMarginBottom = 3,
  171. ContentMarginBottomOverride = 0
  172. };
  173. var windowBackgroundTex = resCache.GetTexture("/Textures/Interface/Nano/window_background.png");
  174. var windowBackground = new StyleBoxTexture
  175. {
  176. Texture = windowBackgroundTex,
  177. };
  178. windowBackground.SetPatchMargin(StyleBox.Margin.Horizontal | StyleBox.Margin.Bottom, 2);
  179. windowBackground.SetExpandMargin(StyleBox.Margin.Horizontal | StyleBox.Margin.Bottom, 2);
  180. var borderedWindowBackgroundTex = resCache.GetTexture("/Textures/Interface/Nano/window_background_bordered.png");
  181. var borderedWindowBackground = new StyleBoxTexture
  182. {
  183. Texture = borderedWindowBackgroundTex,
  184. };
  185. borderedWindowBackground.SetPatchMargin(StyleBox.Margin.All, 2);
  186. var contextMenuBackground = new StyleBoxTexture
  187. {
  188. Texture = borderedWindowBackgroundTex,
  189. };
  190. contextMenuBackground.SetPatchMargin(StyleBox.Margin.All, ContextMenuElement.ElementMargin);
  191. var invSlotBgTex = resCache.GetTexture("/Textures/Interface/Inventory/inv_slot_background.png");
  192. var invSlotBg = new StyleBoxTexture
  193. {
  194. Texture = invSlotBgTex,
  195. };
  196. invSlotBg.SetPatchMargin(StyleBox.Margin.All, 2);
  197. invSlotBg.SetContentMarginOverride(StyleBox.Margin.All, 0);
  198. var handSlotHighlightTex = resCache.GetTexture("/Textures/Interface/Inventory/hand_slot_highlight.png");
  199. var handSlotHighlight = new StyleBoxTexture
  200. {
  201. Texture = handSlotHighlightTex,
  202. };
  203. handSlotHighlight.SetPatchMargin(StyleBox.Margin.All, 2);
  204. var borderedTransparentWindowBackgroundTex = resCache.GetTexture("/Textures/Interface/Nano/transparent_window_background_bordered.png");
  205. var borderedTransparentWindowBackground = new StyleBoxTexture
  206. {
  207. Texture = borderedTransparentWindowBackgroundTex,
  208. };
  209. borderedTransparentWindowBackground.SetPatchMargin(StyleBox.Margin.All, 2);
  210. var hotbarBackground = new StyleBoxTexture
  211. {
  212. Texture = borderedWindowBackgroundTex,
  213. };
  214. hotbarBackground.SetPatchMargin(StyleBox.Margin.All, 2);
  215. hotbarBackground.SetExpandMargin(StyleBox.Margin.All, 4);
  216. var buttonStorage = new StyleBoxTexture(BaseButton);
  217. buttonStorage.SetPatchMargin(StyleBox.Margin.All, 10);
  218. buttonStorage.SetPadding(StyleBox.Margin.All, 0);
  219. buttonStorage.SetContentMarginOverride(StyleBox.Margin.Vertical, 0);
  220. buttonStorage.SetContentMarginOverride(StyleBox.Margin.Horizontal, 4);
  221. var buttonContext = new StyleBoxTexture { Texture = Texture.White };
  222. var buttonRectTex = resCache.GetTexture("/Textures/Interface/Nano/light_panel_background_bordered.png");
  223. var buttonRect = new StyleBoxTexture(BaseButton)
  224. {
  225. Texture = buttonRectTex
  226. };
  227. buttonRect.SetPatchMargin(StyleBox.Margin.All, 2);
  228. buttonRect.SetPadding(StyleBox.Margin.All, 2);
  229. buttonRect.SetContentMarginOverride(StyleBox.Margin.Vertical, 2);
  230. buttonRect.SetContentMarginOverride(StyleBox.Margin.Horizontal, 2);
  231. var buttonRectHover = new StyleBoxTexture(buttonRect)
  232. {
  233. Modulate = ButtonColorHovered
  234. };
  235. var buttonRectPressed = new StyleBoxTexture(buttonRect)
  236. {
  237. Modulate = ButtonColorPressed
  238. };
  239. var buttonRectDisabled = new StyleBoxTexture(buttonRect)
  240. {
  241. Modulate = ButtonColorDisabled
  242. };
  243. var buttonRectActionMenuItemTex = resCache.GetTexture("/Textures/Interface/Nano/black_panel_light_thin_border.png");
  244. var buttonRectActionMenuRevokedItemTex = resCache.GetTexture("/Textures/Interface/Nano/black_panel_red_thin_border.png");
  245. var buttonRectActionMenuItem = new StyleBoxTexture(BaseButton)
  246. {
  247. Texture = buttonRectActionMenuItemTex
  248. };
  249. buttonRectActionMenuItem.SetPatchMargin(StyleBox.Margin.All, 2);
  250. buttonRectActionMenuItem.SetPadding(StyleBox.Margin.All, 2);
  251. buttonRectActionMenuItem.SetContentMarginOverride(StyleBox.Margin.Vertical, 2);
  252. buttonRectActionMenuItem.SetContentMarginOverride(StyleBox.Margin.Horizontal, 2);
  253. var buttonRectActionMenuItemRevoked = new StyleBoxTexture(buttonRectActionMenuItem)
  254. {
  255. Texture = buttonRectActionMenuRevokedItemTex
  256. };
  257. var buttonRectActionMenuItemHover = new StyleBoxTexture(buttonRectActionMenuItem)
  258. {
  259. Modulate = ButtonColorHovered
  260. };
  261. var buttonRectActionMenuItemPressed = new StyleBoxTexture(buttonRectActionMenuItem)
  262. {
  263. Modulate = ButtonColorPressed
  264. };
  265. var buttonTex = resCache.GetTexture("/Textures/Interface/Nano/button.svg.96dpi.png");
  266. var topButtonBase = new StyleBoxTexture
  267. {
  268. Texture = buttonTex,
  269. };
  270. topButtonBase.SetPatchMargin(StyleBox.Margin.All, 10);
  271. topButtonBase.SetPadding(StyleBox.Margin.All, 0);
  272. topButtonBase.SetContentMarginOverride(StyleBox.Margin.All, 0);
  273. var topButtonOpenRight = new StyleBoxTexture(topButtonBase)
  274. {
  275. Texture = new AtlasTexture(buttonTex, UIBox2.FromDimensions(new Vector2(0, 0), new Vector2(14, 24))),
  276. };
  277. topButtonOpenRight.SetPatchMargin(StyleBox.Margin.Right, 0);
  278. var topButtonOpenLeft = new StyleBoxTexture(topButtonBase)
  279. {
  280. Texture = new AtlasTexture(buttonTex, UIBox2.FromDimensions(new Vector2(10, 0), new Vector2(14, 24))),
  281. };
  282. topButtonOpenLeft.SetPatchMargin(StyleBox.Margin.Left, 0);
  283. var topButtonSquare = new StyleBoxTexture(topButtonBase)
  284. {
  285. Texture = new AtlasTexture(buttonTex, UIBox2.FromDimensions(new Vector2(10, 0), new Vector2(3, 24))),
  286. };
  287. topButtonSquare.SetPatchMargin(StyleBox.Margin.Horizontal, 0);
  288. var chatChannelButtonTex = resCache.GetTexture("/Textures/Interface/Nano/rounded_button.svg.96dpi.png");
  289. var chatChannelButton = new StyleBoxTexture
  290. {
  291. Texture = chatChannelButtonTex,
  292. };
  293. chatChannelButton.SetPatchMargin(StyleBox.Margin.All, 5);
  294. chatChannelButton.SetPadding(StyleBox.Margin.All, 2);
  295. var chatFilterButtonTex = resCache.GetTexture("/Textures/Interface/Nano/rounded_button_bordered.svg.96dpi.png");
  296. var chatFilterButton = new StyleBoxTexture
  297. {
  298. Texture = chatFilterButtonTex,
  299. };
  300. chatFilterButton.SetPatchMargin(StyleBox.Margin.All, 5);
  301. chatFilterButton.SetPadding(StyleBox.Margin.All, 2);
  302. var smallButtonTex = resCache.GetTexture("/Textures/Interface/Nano/button_small.svg.96dpi.png");
  303. var smallButtonBase = new StyleBoxTexture
  304. {
  305. Texture = smallButtonTex,
  306. };
  307. var textureInvertedTriangle = resCache.GetTexture("/Textures/Interface/Nano/inverted_triangle.svg.png");
  308. var lineEditTex = resCache.GetTexture("/Textures/Interface/Nano/lineedit.png");
  309. var lineEdit = new StyleBoxTexture
  310. {
  311. Texture = lineEditTex,
  312. };
  313. lineEdit.SetPatchMargin(StyleBox.Margin.All, 3);
  314. lineEdit.SetContentMarginOverride(StyleBox.Margin.Horizontal, 5);
  315. var chatBg = new StyleBoxFlat
  316. {
  317. BackgroundColor = ChatBackgroundColor
  318. };
  319. var chatSubBg = new StyleBoxFlat
  320. {
  321. BackgroundColor = ChatBackgroundColor,
  322. };
  323. chatSubBg.SetContentMarginOverride(StyleBox.Margin.All, 2);
  324. var actionSearchBoxTex = resCache.GetTexture("/Textures/Interface/Nano/black_panel_dark_thin_border.png");
  325. var actionSearchBox = new StyleBoxTexture
  326. {
  327. Texture = actionSearchBoxTex,
  328. };
  329. actionSearchBox.SetPatchMargin(StyleBox.Margin.All, 3);
  330. actionSearchBox.SetContentMarginOverride(StyleBox.Margin.Horizontal, 5);
  331. var tabContainerPanelTex = resCache.GetTexture("/Textures/Interface/Nano/tabcontainer_panel.png");
  332. var tabContainerPanel = new StyleBoxTexture
  333. {
  334. Texture = tabContainerPanelTex,
  335. };
  336. tabContainerPanel.SetPatchMargin(StyleBox.Margin.All, 2);
  337. var tabContainerBoxActive = new StyleBoxFlat { BackgroundColor = new Color(64, 64, 64) };
  338. tabContainerBoxActive.SetContentMarginOverride(StyleBox.Margin.Horizontal, 5);
  339. var tabContainerBoxInactive = new StyleBoxFlat { BackgroundColor = new Color(32, 32, 32) };
  340. tabContainerBoxInactive.SetContentMarginOverride(StyleBox.Margin.Horizontal, 5);
  341. var progressBarBackground = new StyleBoxFlat
  342. {
  343. BackgroundColor = new Color(0.25f, 0.25f, 0.25f)
  344. };
  345. progressBarBackground.SetContentMarginOverride(StyleBox.Margin.Vertical, 14.5f);
  346. var progressBarForeground = new StyleBoxFlat
  347. {
  348. BackgroundColor = new Color(0.25f, 0.50f, 0.25f)
  349. };
  350. progressBarForeground.SetContentMarginOverride(StyleBox.Margin.Vertical, 14.5f);
  351. // CheckBox
  352. var checkBoxTextureChecked = resCache.GetTexture("/Textures/Interface/Nano/checkbox_checked.svg.96dpi.png");
  353. var checkBoxTextureUnchecked = resCache.GetTexture("/Textures/Interface/Nano/checkbox_unchecked.svg.96dpi.png");
  354. // Tooltip box
  355. var tooltipTexture = resCache.GetTexture("/Textures/Interface/Nano/tooltip.png");
  356. var tooltipBox = new StyleBoxTexture
  357. {
  358. Texture = tooltipTexture,
  359. };
  360. tooltipBox.SetPatchMargin(StyleBox.Margin.All, 2);
  361. tooltipBox.SetContentMarginOverride(StyleBox.Margin.Horizontal, 7);
  362. // Whisper box
  363. var whisperTexture = resCache.GetTexture("/Textures/Interface/Nano/whisper.png");
  364. var whisperBox = new StyleBoxTexture
  365. {
  366. Texture = whisperTexture,
  367. };
  368. whisperBox.SetPatchMargin(StyleBox.Margin.All, 2);
  369. whisperBox.SetContentMarginOverride(StyleBox.Margin.Horizontal, 7);
  370. // Placeholder
  371. var placeholderTexture = resCache.GetTexture("/Textures/Interface/Nano/placeholder.png");
  372. var placeholder = new StyleBoxTexture { Texture = placeholderTexture };
  373. placeholder.SetPatchMargin(StyleBox.Margin.All, 19);
  374. placeholder.SetExpandMargin(StyleBox.Margin.All, -5);
  375. placeholder.Mode = StyleBoxTexture.StretchMode.Tile;
  376. var itemListBackgroundSelected = new StyleBoxFlat { BackgroundColor = new Color(75, 75, 86) };
  377. itemListBackgroundSelected.SetContentMarginOverride(StyleBox.Margin.Vertical, 2);
  378. itemListBackgroundSelected.SetContentMarginOverride(StyleBox.Margin.Horizontal, 4);
  379. var itemListItemBackgroundDisabled = new StyleBoxFlat { BackgroundColor = new Color(10, 10, 12) };
  380. itemListItemBackgroundDisabled.SetContentMarginOverride(StyleBox.Margin.Vertical, 2);
  381. itemListItemBackgroundDisabled.SetContentMarginOverride(StyleBox.Margin.Horizontal, 4);
  382. var itemListItemBackground = new StyleBoxFlat { BackgroundColor = new Color(55, 55, 68) };
  383. itemListItemBackground.SetContentMarginOverride(StyleBox.Margin.Vertical, 2);
  384. itemListItemBackground.SetContentMarginOverride(StyleBox.Margin.Horizontal, 4);
  385. var itemListItemBackgroundTransparent = new StyleBoxFlat { BackgroundColor = Color.Transparent };
  386. itemListItemBackgroundTransparent.SetContentMarginOverride(StyleBox.Margin.Vertical, 2);
  387. itemListItemBackgroundTransparent.SetContentMarginOverride(StyleBox.Margin.Horizontal, 4);
  388. var squareTex = resCache.GetTexture("/Textures/Interface/Nano/square.png");
  389. var listContainerButton = new StyleBoxTexture
  390. {
  391. Texture = squareTex,
  392. ContentMarginLeftOverride = 10
  393. };
  394. // NanoHeading
  395. var nanoHeadingTex = resCache.GetTexture("/Textures/Interface/Nano/nanoheading.svg.96dpi.png");
  396. var nanoHeadingBox = new StyleBoxTexture
  397. {
  398. Texture = nanoHeadingTex,
  399. PatchMarginRight = 10,
  400. PatchMarginTop = 10,
  401. ContentMarginTopOverride = 2,
  402. ContentMarginLeftOverride = 10,
  403. PaddingTop = 4
  404. };
  405. nanoHeadingBox.SetPatchMargin(StyleBox.Margin.Left | StyleBox.Margin.Bottom, 2);
  406. // Stripe background
  407. var stripeBackTex = resCache.GetTexture("/Textures/Interface/Nano/stripeback.svg.96dpi.png");
  408. var stripeBack = new StyleBoxTexture
  409. {
  410. Texture = stripeBackTex,
  411. Mode = StyleBoxTexture.StretchMode.Tile
  412. };
  413. // Slider
  414. var sliderOutlineTex = resCache.GetTexture("/Textures/Interface/Nano/slider_outline.svg.96dpi.png");
  415. var sliderFillTex = resCache.GetTexture("/Textures/Interface/Nano/slider_fill.svg.96dpi.png");
  416. var sliderGrabTex = resCache.GetTexture("/Textures/Interface/Nano/slider_grabber.svg.96dpi.png");
  417. var sliderFillBox = new StyleBoxTexture
  418. {
  419. Texture = sliderFillTex,
  420. Modulate = Color.FromHex("#3E6C45")
  421. };
  422. var sliderBackBox = new StyleBoxTexture
  423. {
  424. Texture = sliderFillTex,
  425. Modulate = PanelDark,
  426. };
  427. var sliderForeBox = new StyleBoxTexture
  428. {
  429. Texture = sliderOutlineTex,
  430. Modulate = Color.FromHex("#494949")
  431. };
  432. var sliderGrabBox = new StyleBoxTexture
  433. {
  434. Texture = sliderGrabTex,
  435. };
  436. sliderFillBox.SetPatchMargin(StyleBox.Margin.All, 12);
  437. sliderBackBox.SetPatchMargin(StyleBox.Margin.All, 12);
  438. sliderForeBox.SetPatchMargin(StyleBox.Margin.All, 12);
  439. sliderGrabBox.SetPatchMargin(StyleBox.Margin.All, 12);
  440. var sliderFillGreen = new StyleBoxTexture(sliderFillBox) { Modulate = Color.LimeGreen };
  441. var sliderFillRed = new StyleBoxTexture(sliderFillBox) { Modulate = Color.Red };
  442. var sliderFillBlue = new StyleBoxTexture(sliderFillBox) { Modulate = Color.Blue };
  443. var sliderFillWhite = new StyleBoxTexture(sliderFillBox) { Modulate = Color.White };
  444. var boxFont13 = resCache.GetFont("/Fonts/Boxfont-round/Boxfont Round.ttf", 13);
  445. var insetBack = new StyleBoxTexture
  446. {
  447. Texture = buttonTex,
  448. Modulate = Color.FromHex("#202023"),
  449. };
  450. insetBack.SetPatchMargin(StyleBox.Margin.All, 10);
  451. // Default paper background:
  452. var paperBackground = new StyleBoxTexture
  453. {
  454. Texture = resCache.GetTexture("/Textures/Interface/Paper/paper_background_default.svg.96dpi.png"),
  455. Modulate = Color.FromHex("#eaedde"), // A light cream
  456. };
  457. paperBackground.SetPatchMargin(StyleBox.Margin.All, 16.0f);
  458. var contextMenuExpansionTexture = resCache.GetTexture("/Textures/Interface/VerbIcons/group.svg.192dpi.png");
  459. var verbMenuConfirmationTexture = resCache.GetTexture("/Textures/Interface/VerbIcons/group.svg.192dpi.png");
  460. // south-facing arrow:
  461. var directionIconArrowTex = resCache.GetTexture("/Textures/Interface/VerbIcons/drop.svg.192dpi.png");
  462. var directionIconQuestionTex = resCache.GetTexture("/Textures/Interface/VerbIcons/information.svg.192dpi.png");
  463. var directionIconHereTex = resCache.GetTexture("/Textures/Interface/VerbIcons/dot.svg.192dpi.png");
  464. Stylesheet = new Stylesheet(BaseRules.Concat(new[]
  465. {
  466. Element().Class("monospace")
  467. .Prop("font", notoSansMono),
  468. // Window title.
  469. new StyleRule(
  470. new SelectorElement(typeof(Label), new[] {DefaultWindow.StyleClassWindowTitle}, null, null),
  471. new[]
  472. {
  473. new StyleProperty(Label.StylePropertyFontColor, NanoGold),
  474. new StyleProperty(Label.StylePropertyFont, notoSansDisplayBold14),
  475. }),
  476. // Alert (white) window title.
  477. new StyleRule(
  478. new SelectorElement(typeof(Label), new[] {"windowTitleAlert"}, null, null),
  479. new[]
  480. {
  481. new StyleProperty(Label.StylePropertyFontColor, Color.White),
  482. new StyleProperty(Label.StylePropertyFont, notoSansDisplayBold14),
  483. }),
  484. // Window background.
  485. new StyleRule(
  486. new SelectorElement(null, new[] {DefaultWindow.StyleClassWindowPanel}, null, null),
  487. new[]
  488. {
  489. new StyleProperty(PanelContainer.StylePropertyPanel, windowBackground),
  490. }),
  491. // bordered window background
  492. new StyleRule(
  493. new SelectorElement(null, new[] {StyleClassBorderedWindowPanel}, null, null),
  494. new[]
  495. {
  496. new StyleProperty(PanelContainer.StylePropertyPanel, borderedWindowBackground),
  497. }),
  498. new StyleRule(
  499. new SelectorElement(null, new[] {StyleClassTransparentBorderedWindowPanel}, null, null),
  500. new[]
  501. {
  502. new StyleProperty(PanelContainer.StylePropertyPanel, borderedTransparentWindowBackground),
  503. }),
  504. // inventory slot background
  505. new StyleRule(
  506. new SelectorElement(null, new[] {StyleClassInventorySlotBackground}, null, null),
  507. new[]
  508. {
  509. new StyleProperty(PanelContainer.StylePropertyPanel, invSlotBg),
  510. }),
  511. // hand slot highlight
  512. new StyleRule(
  513. new SelectorElement(null, new[] {StyleClassHandSlotHighlight}, null, null),
  514. new[]
  515. {
  516. new StyleProperty(PanelContainer.StylePropertyPanel, handSlotHighlight),
  517. }),
  518. // Hotbar background
  519. new StyleRule(new SelectorElement(typeof(PanelContainer), new[] {StyleClassHotbarPanel}, null, null),
  520. new[]
  521. {
  522. new StyleProperty(PanelContainer.StylePropertyPanel, hotbarBackground),
  523. }),
  524. // Window header.
  525. new StyleRule(
  526. new SelectorElement(typeof(PanelContainer), new[] {DefaultWindow.StyleClassWindowHeader}, null, null),
  527. new[]
  528. {
  529. new StyleProperty(PanelContainer.StylePropertyPanel, windowHeader),
  530. }),
  531. // Alert (red) window header.
  532. new StyleRule(
  533. new SelectorElement(typeof(PanelContainer), new[] {"windowHeaderAlert"}, null, null),
  534. new[]
  535. {
  536. new StyleProperty(PanelContainer.StylePropertyPanel, windowHeaderAlert),
  537. }),
  538. // Shapes for the buttons.
  539. Element<ContainerButton>().Class(ContainerButton.StyleClassButton)
  540. .Prop(ContainerButton.StylePropertyStyleBox, BaseButton),
  541. Element<ContainerButton>().Class(ContainerButton.StyleClassButton)
  542. .Class(ButtonOpenRight)
  543. .Prop(ContainerButton.StylePropertyStyleBox, BaseButtonOpenRight),
  544. Element<ContainerButton>().Class(ContainerButton.StyleClassButton)
  545. .Class(ButtonOpenLeft)
  546. .Prop(ContainerButton.StylePropertyStyleBox, BaseButtonOpenLeft),
  547. Element<ContainerButton>().Class(ContainerButton.StyleClassButton)
  548. .Class(ButtonOpenBoth)
  549. .Prop(ContainerButton.StylePropertyStyleBox, BaseButtonOpenBoth),
  550. Element<ContainerButton>().Class(ContainerButton.StyleClassButton)
  551. .Class(ButtonSquare)
  552. .Prop(ContainerButton.StylePropertyStyleBox, BaseButtonSquare),
  553. new StyleRule(new SelectorElement(typeof(Label), new[] { Button.StyleClassButton }, null, null), new[]
  554. {
  555. new StyleProperty(Label.StylePropertyAlignMode, Label.AlignMode.Center),
  556. }),
  557. // Colors for the buttons.
  558. Element<ContainerButton>().Class(ContainerButton.StyleClassButton)
  559. .Pseudo(ContainerButton.StylePseudoClassNormal)
  560. .Prop(Control.StylePropertyModulateSelf, ButtonColorDefault),
  561. Element<ContainerButton>().Class(ContainerButton.StyleClassButton)
  562. .Pseudo(ContainerButton.StylePseudoClassHover)
  563. .Prop(Control.StylePropertyModulateSelf, ButtonColorHovered),
  564. Element<ContainerButton>().Class(ContainerButton.StyleClassButton)
  565. .Pseudo(ContainerButton.StylePseudoClassPressed)
  566. .Prop(Control.StylePropertyModulateSelf, ButtonColorPressed),
  567. Element<ContainerButton>().Class(ContainerButton.StyleClassButton)
  568. .Pseudo(ContainerButton.StylePseudoClassDisabled)
  569. .Prop(Control.StylePropertyModulateSelf, ButtonColorDisabled),
  570. // Colors for the caution buttons.
  571. Element<ContainerButton>().Class(ContainerButton.StyleClassButton).Class(ButtonCaution)
  572. .Pseudo(ContainerButton.StylePseudoClassNormal)
  573. .Prop(Control.StylePropertyModulateSelf, ButtonColorCautionDefault),
  574. Element<ContainerButton>().Class(ContainerButton.StyleClassButton).Class(ButtonCaution)
  575. .Pseudo(ContainerButton.StylePseudoClassHover)
  576. .Prop(Control.StylePropertyModulateSelf, ButtonColorCautionHovered),
  577. Element<ContainerButton>().Class(ContainerButton.StyleClassButton).Class(ButtonCaution)
  578. .Pseudo(ContainerButton.StylePseudoClassPressed)
  579. .Prop(Control.StylePropertyModulateSelf, ButtonColorCautionPressed),
  580. Element<ContainerButton>().Class(ContainerButton.StyleClassButton).Class(ButtonCaution)
  581. .Pseudo(ContainerButton.StylePseudoClassDisabled)
  582. .Prop(Control.StylePropertyModulateSelf, ButtonColorCautionDisabled),
  583. // Colors for confirm buttons confirm states.
  584. Element<ConfirmButton>()
  585. .Pseudo(ConfirmButton.ConfirmPrefix + ContainerButton.StylePseudoClassNormal)
  586. .Prop(Control.StylePropertyModulateSelf, ButtonColorCautionDefault),
  587. Element<ConfirmButton>()
  588. .Pseudo(ConfirmButton.ConfirmPrefix + ContainerButton.StylePseudoClassHover)
  589. .Prop(Control.StylePropertyModulateSelf, ButtonColorCautionHovered),
  590. Element<ConfirmButton>()
  591. .Pseudo(ConfirmButton.ConfirmPrefix + ContainerButton.StylePseudoClassPressed)
  592. .Prop(Control.StylePropertyModulateSelf, ButtonColorCautionPressed),
  593. Element<ConfirmButton>()
  594. .Pseudo(ConfirmButton.ConfirmPrefix + ContainerButton.StylePseudoClassDisabled)
  595. .Prop(Control.StylePropertyModulateSelf, ButtonColorCautionDisabled),
  596. new StyleRule(new SelectorChild(
  597. new SelectorElement(typeof(Button), null, null, new[] {ContainerButton.StylePseudoClassDisabled}),
  598. new SelectorElement(typeof(Label), null, null, null)),
  599. new[]
  600. {
  601. new StyleProperty("font-color", Color.FromHex("#E5E5E581")),
  602. }),
  603. // ItemStatus for hands
  604. Element()
  605. .Class(StyleClassItemStatusNotHeld)
  606. .Prop("font", notoSansItalic10)
  607. .Prop("font-color", ItemStatusNotHeldColor)
  608. .Prop(nameof(Control.Margin), new Thickness(4, 0, 0, 2)),
  609. Element()
  610. .Class(StyleClassItemStatus)
  611. .Prop(nameof(RichTextLabel.LineHeightScale), 0.7f)
  612. .Prop(nameof(Control.Margin), new Thickness(4, 0, 0, 2)),
  613. // Context Menu window
  614. Element<PanelContainer>().Class(ContextMenuPopup.StyleClassContextMenuPopup)
  615. .Prop(PanelContainer.StylePropertyPanel, contextMenuBackground),
  616. // Context menu buttons
  617. Element<ContextMenuElement>().Class(ContextMenuElement.StyleClassContextMenuButton)
  618. .Prop(ContainerButton.StylePropertyStyleBox, buttonContext),
  619. Element<ContextMenuElement>().Class(ContextMenuElement.StyleClassContextMenuButton)
  620. .Pseudo(ContainerButton.StylePseudoClassNormal)
  621. .Prop(Control.StylePropertyModulateSelf, ButtonColorContext),
  622. Element<ContextMenuElement>().Class(ContextMenuElement.StyleClassContextMenuButton)
  623. .Pseudo(ContainerButton.StylePseudoClassHover)
  624. .Prop(Control.StylePropertyModulateSelf, ButtonColorContextHover),
  625. Element<ContextMenuElement>().Class(ContextMenuElement.StyleClassContextMenuButton)
  626. .Pseudo(ContainerButton.StylePseudoClassPressed)
  627. .Prop(Control.StylePropertyModulateSelf, ButtonColorContextPressed),
  628. Element<ContextMenuElement>().Class(ContextMenuElement.StyleClassContextMenuButton)
  629. .Pseudo(ContainerButton.StylePseudoClassDisabled)
  630. .Prop(Control.StylePropertyModulateSelf, ButtonColorContextDisabled),
  631. // Context Menu Labels
  632. Element<RichTextLabel>().Class(InteractionVerb.DefaultTextStyleClass)
  633. .Prop(Label.StylePropertyFont, notoSansBoldItalic12),
  634. Element<RichTextLabel>().Class(ActivationVerb.DefaultTextStyleClass)
  635. .Prop(Label.StylePropertyFont, notoSansBold12),
  636. Element<RichTextLabel>().Class(AlternativeVerb.DefaultTextStyleClass)
  637. .Prop(Label.StylePropertyFont, notoSansItalic12),
  638. Element<RichTextLabel>().Class(Verb.DefaultTextStyleClass)
  639. .Prop(Label.StylePropertyFont, notoSans12),
  640. Element<TextureRect>().Class(ContextMenuElement.StyleClassContextMenuExpansionTexture)
  641. .Prop(TextureRect.StylePropertyTexture, contextMenuExpansionTexture),
  642. Element<TextureRect>().Class(VerbMenuElement.StyleClassVerbMenuConfirmationTexture)
  643. .Prop(TextureRect.StylePropertyTexture, verbMenuConfirmationTexture),
  644. // Context menu confirm buttons
  645. Element<ContextMenuElement>().Class(ConfirmationMenuElement.StyleClassConfirmationContextMenuButton)
  646. .Prop(ContainerButton.StylePropertyStyleBox, buttonContext),
  647. Element<ContextMenuElement>().Class(ConfirmationMenuElement.StyleClassConfirmationContextMenuButton)
  648. .Pseudo(ContainerButton.StylePseudoClassNormal)
  649. .Prop(Control.StylePropertyModulateSelf, ButtonColorCautionDefault),
  650. Element<ContextMenuElement>().Class(ConfirmationMenuElement.StyleClassConfirmationContextMenuButton)
  651. .Pseudo(ContainerButton.StylePseudoClassHover)
  652. .Prop(Control.StylePropertyModulateSelf, ButtonColorCautionHovered),
  653. Element<ContextMenuElement>().Class(ConfirmationMenuElement.StyleClassConfirmationContextMenuButton)
  654. .Pseudo(ContainerButton.StylePseudoClassPressed)
  655. .Prop(Control.StylePropertyModulateSelf, ButtonColorCautionPressed),
  656. Element<ContextMenuElement>().Class(ConfirmationMenuElement.StyleClassConfirmationContextMenuButton)
  657. .Pseudo(ContainerButton.StylePseudoClassDisabled)
  658. .Prop(Control.StylePropertyModulateSelf, ButtonColorCautionDisabled),
  659. // Examine buttons
  660. Element<ExamineButton>().Class(ExamineButton.StyleClassExamineButton)
  661. .Prop(ContainerButton.StylePropertyStyleBox, buttonContext),
  662. Element<ExamineButton>().Class(ExamineButton.StyleClassExamineButton)
  663. .Pseudo(ContainerButton.StylePseudoClassNormal)
  664. .Prop(Control.StylePropertyModulateSelf, ExamineButtonColorContext),
  665. Element<ExamineButton>().Class(ExamineButton.StyleClassExamineButton)
  666. .Pseudo(ContainerButton.StylePseudoClassHover)
  667. .Prop(Control.StylePropertyModulateSelf, ExamineButtonColorContextHover),
  668. Element<ExamineButton>().Class(ExamineButton.StyleClassExamineButton)
  669. .Pseudo(ContainerButton.StylePseudoClassPressed)
  670. .Prop(Control.StylePropertyModulateSelf, ExamineButtonColorContextPressed),
  671. Element<ExamineButton>().Class(ExamineButton.StyleClassExamineButton)
  672. .Pseudo(ContainerButton.StylePseudoClassDisabled)
  673. .Prop(Control.StylePropertyModulateSelf, ExamineButtonColorContextDisabled),
  674. // Direction / arrow icon
  675. Element<DirectionIcon>().Class(DirectionIcon.StyleClassDirectionIconArrow)
  676. .Prop(TextureRect.StylePropertyTexture, directionIconArrowTex),
  677. Element<DirectionIcon>().Class(DirectionIcon.StyleClassDirectionIconUnknown)
  678. .Prop(TextureRect.StylePropertyTexture, directionIconQuestionTex),
  679. Element<DirectionIcon>().Class(DirectionIcon.StyleClassDirectionIconHere)
  680. .Prop(TextureRect.StylePropertyTexture, directionIconHereTex),
  681. // Thin buttons (No padding nor vertical margin)
  682. Element<ContainerButton>().Class(StyleClassStorageButton)
  683. .Prop(ContainerButton.StylePropertyStyleBox, buttonStorage),
  684. Element<ContainerButton>().Class(StyleClassStorageButton)
  685. .Pseudo(ContainerButton.StylePseudoClassNormal)
  686. .Prop(Control.StylePropertyModulateSelf, ButtonColorDefault),
  687. Element<ContainerButton>().Class(StyleClassStorageButton)
  688. .Pseudo(ContainerButton.StylePseudoClassHover)
  689. .Prop(Control.StylePropertyModulateSelf, ButtonColorHovered),
  690. Element<ContainerButton>().Class(StyleClassStorageButton)
  691. .Pseudo(ContainerButton.StylePseudoClassPressed)
  692. .Prop(Control.StylePropertyModulateSelf, ButtonColorPressed),
  693. Element<ContainerButton>().Class(StyleClassStorageButton)
  694. .Pseudo(ContainerButton.StylePseudoClassDisabled)
  695. .Prop(Control.StylePropertyModulateSelf, ButtonColorDisabled),
  696. // ListContainer
  697. Element<ContainerButton>().Class(ListContainer.StyleClassListContainerButton)
  698. .Prop(ContainerButton.StylePropertyStyleBox, listContainerButton),
  699. Element<ContainerButton>().Class(ListContainer.StyleClassListContainerButton)
  700. .Pseudo(ContainerButton.StylePseudoClassNormal)
  701. .Prop(Control.StylePropertyModulateSelf, new Color(55, 55, 68)),
  702. Element<ContainerButton>().Class(ListContainer.StyleClassListContainerButton)
  703. .Pseudo(ContainerButton.StylePseudoClassHover)
  704. .Prop(Control.StylePropertyModulateSelf, new Color(75, 75, 86)),
  705. Element<ContainerButton>().Class(ListContainer.StyleClassListContainerButton)
  706. .Pseudo(ContainerButton.StylePseudoClassPressed)
  707. .Prop(Control.StylePropertyModulateSelf, new Color(75, 75, 86)),
  708. Element<ContainerButton>().Class(ListContainer.StyleClassListContainerButton)
  709. .Pseudo(ContainerButton.StylePseudoClassDisabled)
  710. .Prop(Control.StylePropertyModulateSelf, new Color(10, 10, 12)),
  711. // Main menu: Make those buttons bigger.
  712. new StyleRule(new SelectorChild(
  713. new SelectorElement(typeof(Button), null, "mainMenu", null),
  714. new SelectorElement(typeof(Label), null, null, null)),
  715. new[]
  716. {
  717. new StyleProperty("font", notoSansBold16),
  718. }),
  719. // Main menu: also make those buttons slightly more separated.
  720. new StyleRule(new SelectorElement(typeof(BoxContainer), null, "mainMenuVBox", null),
  721. new[]
  722. {
  723. new StyleProperty(BoxContainer.StylePropertySeparation, 2),
  724. }),
  725. // Fancy LineEdit
  726. new StyleRule(new SelectorElement(typeof(LineEdit), null, null, null),
  727. new[]
  728. {
  729. new StyleProperty(LineEdit.StylePropertyStyleBox, lineEdit),
  730. }),
  731. new StyleRule(
  732. new SelectorElement(typeof(LineEdit), new[] {LineEdit.StyleClassLineEditNotEditable}, null, null),
  733. new[]
  734. {
  735. new StyleProperty("font-color", new Color(192, 192, 192)),
  736. }),
  737. new StyleRule(
  738. new SelectorElement(typeof(LineEdit), null, null, new[] {LineEdit.StylePseudoClassPlaceholder}),
  739. new[]
  740. {
  741. new StyleProperty("font-color", Color.Gray),
  742. }),
  743. Element<TextEdit>().Pseudo(TextEdit.StylePseudoClassPlaceholder)
  744. .Prop("font-color", Color.Gray),
  745. // chat subpanels (chat lineedit backing, popup backings)
  746. new StyleRule(new SelectorElement(typeof(PanelContainer), new[] {StyleClassChatPanel}, null, null),
  747. new[]
  748. {
  749. new StyleProperty(PanelContainer.StylePropertyPanel, chatBg),
  750. }),
  751. // Chat lineedit - we don't actually draw a stylebox around the lineedit itself, we put it around the
  752. // input + other buttons, so we must clear the default stylebox
  753. new StyleRule(new SelectorElement(typeof(LineEdit), new[] {StyleClassChatLineEdit}, null, null),
  754. new[]
  755. {
  756. new StyleProperty(LineEdit.StylePropertyStyleBox, new StyleBoxEmpty()),
  757. }),
  758. // Action searchbox lineedit
  759. new StyleRule(new SelectorElement(typeof(LineEdit), new[] {StyleClassActionSearchBox}, null, null),
  760. new[]
  761. {
  762. new StyleProperty(LineEdit.StylePropertyStyleBox, actionSearchBox),
  763. }),
  764. // TabContainer
  765. new StyleRule(new SelectorElement(typeof(TabContainer), null, null, null),
  766. new[]
  767. {
  768. new StyleProperty(TabContainer.StylePropertyPanelStyleBox, tabContainerPanel),
  769. new StyleProperty(TabContainer.StylePropertyTabStyleBox, tabContainerBoxActive),
  770. new StyleProperty(TabContainer.StylePropertyTabStyleBoxInactive, tabContainerBoxInactive),
  771. }),
  772. // ProgressBar
  773. new StyleRule(new SelectorElement(typeof(ProgressBar), null, null, null),
  774. new[]
  775. {
  776. new StyleProperty(ProgressBar.StylePropertyBackground, progressBarBackground),
  777. new StyleProperty(ProgressBar.StylePropertyForeground, progressBarForeground)
  778. }),
  779. // CheckBox
  780. new StyleRule(new SelectorElement(typeof(TextureRect), new [] { CheckBox.StyleClassCheckBox }, null, null), new[]
  781. {
  782. new StyleProperty(TextureRect.StylePropertyTexture, checkBoxTextureUnchecked),
  783. }),
  784. new StyleRule(new SelectorElement(typeof(TextureRect), new [] { CheckBox.StyleClassCheckBox, CheckBox.StyleClassCheckBoxChecked }, null, null), new[]
  785. {
  786. new StyleProperty(TextureRect.StylePropertyTexture, checkBoxTextureChecked),
  787. }),
  788. new StyleRule(new SelectorElement(typeof(BoxContainer), new [] { CheckBox.StyleClassCheckBox }, null, null), new[]
  789. {
  790. new StyleProperty(BoxContainer.StylePropertySeparation, 10),
  791. }),
  792. // Tooltip
  793. new StyleRule(new SelectorElement(typeof(Tooltip), null, null, null), new[]
  794. {
  795. new StyleProperty(PanelContainer.StylePropertyPanel, tooltipBox)
  796. }),
  797. new StyleRule(new SelectorElement(typeof(PanelContainer), new [] { StyleClassTooltipPanel }, null, null), new[]
  798. {
  799. new StyleProperty(PanelContainer.StylePropertyPanel, tooltipBox)
  800. }),
  801. new StyleRule(new SelectorElement(typeof(PanelContainer), new[] {"speechBox", "sayBox"}, null, null), new[]
  802. {
  803. new StyleProperty(PanelContainer.StylePropertyPanel, tooltipBox)
  804. }),
  805. new StyleRule(new SelectorElement(typeof(PanelContainer), new[] {"speechBox", "whisperBox"}, null, null), new[]
  806. {
  807. new StyleProperty(PanelContainer.StylePropertyPanel, whisperBox)
  808. }),
  809. new StyleRule(new SelectorChild(
  810. new SelectorElement(typeof(PanelContainer), new[] {"speechBox", "whisperBox"}, null, null),
  811. new SelectorElement(typeof(RichTextLabel), new[] {"bubbleContent"}, null, null)),
  812. new[]
  813. {
  814. new StyleProperty("font", notoSansItalic12),
  815. }),
  816. new StyleRule(new SelectorChild(
  817. new SelectorElement(typeof(PanelContainer), new[] {"speechBox", "emoteBox"}, null, null),
  818. new SelectorElement(typeof(RichTextLabel), null, null, null)),
  819. new[]
  820. {
  821. new StyleProperty("font", notoSansItalic12),
  822. }),
  823. new StyleRule(new SelectorElement(typeof(RichTextLabel), new[] {StyleClassLabelKeyText}, null, null), new[]
  824. {
  825. new StyleProperty(Label.StylePropertyFont, notoSansBold12),
  826. new StyleProperty( Control.StylePropertyModulateSelf, NanoGold)
  827. }),
  828. // alert tooltip
  829. new StyleRule(new SelectorElement(typeof(RichTextLabel), new[] {StyleClassTooltipAlertTitle}, null, null), new[]
  830. {
  831. new StyleProperty("font", notoSansBold18)
  832. }),
  833. new StyleRule(new SelectorElement(typeof(RichTextLabel), new[] {StyleClassTooltipAlertDescription}, null, null), new[]
  834. {
  835. new StyleProperty("font", notoSans16)
  836. }),
  837. new StyleRule(new SelectorElement(typeof(RichTextLabel), new[] {StyleClassTooltipAlertCooldown}, null, null), new[]
  838. {
  839. new StyleProperty("font", notoSans16)
  840. }),
  841. // action tooltip
  842. new StyleRule(new SelectorElement(typeof(RichTextLabel), new[] {StyleClassTooltipActionTitle}, null, null), new[]
  843. {
  844. new StyleProperty("font", notoSansBold16)
  845. }),
  846. new StyleRule(new SelectorElement(typeof(RichTextLabel), new[] {StyleClassTooltipActionDescription}, null, null), new[]
  847. {
  848. new StyleProperty("font", notoSans15)
  849. }),
  850. new StyleRule(new SelectorElement(typeof(RichTextLabel), new[] {StyleClassTooltipActionCooldown}, null, null), new[]
  851. {
  852. new StyleProperty("font", notoSans15)
  853. }),
  854. new StyleRule(new SelectorElement(typeof(RichTextLabel), new[] {StyleClassTooltipActionRequirements}, null, null), new[]
  855. {
  856. new StyleProperty("font", notoSans15)
  857. }),
  858. new StyleRule(new SelectorElement(typeof(RichTextLabel), new[] {StyleClassTooltipActionCharges}, null, null), new[]
  859. {
  860. new StyleProperty("font", notoSans15)
  861. }),
  862. // small number for the entity counter in the entity menu
  863. new StyleRule(new SelectorElement(typeof(Label), new[] {ContextMenuElement.StyleClassEntityMenuIconLabel}, null, null), new[]
  864. {
  865. new StyleProperty("font", notoSans10),
  866. new StyleProperty(Label.StylePropertyAlignMode, Label.AlignMode.Right),
  867. }),
  868. // hotbar slot
  869. new StyleRule(new SelectorElement(typeof(RichTextLabel), new[] {StyleClassHotbarSlotNumber}, null, null), new[]
  870. {
  871. new StyleProperty("font", notoSansDisplayBold16)
  872. }),
  873. // Entity tooltip
  874. new StyleRule(
  875. new SelectorElement(typeof(PanelContainer), new[] {ExamineSystem.StyleClassEntityTooltip}, null,
  876. null), new[]
  877. {
  878. new StyleProperty(PanelContainer.StylePropertyPanel, tooltipBox)
  879. }),
  880. // ItemList
  881. new StyleRule(new SelectorElement(typeof(ItemList), null, null, null), new[]
  882. {
  883. new StyleProperty(ItemList.StylePropertyBackground,
  884. new StyleBoxFlat {BackgroundColor = new Color(32, 32, 40)}),
  885. new StyleProperty(ItemList.StylePropertyItemBackground,
  886. itemListItemBackground),
  887. new StyleProperty(ItemList.StylePropertyDisabledItemBackground,
  888. itemListItemBackgroundDisabled),
  889. new StyleProperty(ItemList.StylePropertySelectedItemBackground,
  890. itemListBackgroundSelected)
  891. }),
  892. new StyleRule(new SelectorElement(typeof(ItemList), new[] {"transparentItemList"}, null, null), new[]
  893. {
  894. new StyleProperty(ItemList.StylePropertyBackground,
  895. new StyleBoxFlat {BackgroundColor = Color.Transparent}),
  896. new StyleProperty(ItemList.StylePropertyItemBackground,
  897. itemListItemBackgroundTransparent),
  898. new StyleProperty(ItemList.StylePropertyDisabledItemBackground,
  899. itemListItemBackgroundDisabled),
  900. new StyleProperty(ItemList.StylePropertySelectedItemBackground,
  901. itemListBackgroundSelected)
  902. }),
  903. new StyleRule(new SelectorElement(typeof(ItemList), new[] {"transparentBackgroundItemList"}, null, null), new[]
  904. {
  905. new StyleProperty(ItemList.StylePropertyBackground,
  906. new StyleBoxFlat {BackgroundColor = Color.Transparent}),
  907. new StyleProperty(ItemList.StylePropertyItemBackground,
  908. itemListItemBackground),
  909. new StyleProperty(ItemList.StylePropertyDisabledItemBackground,
  910. itemListItemBackgroundDisabled),
  911. new StyleProperty(ItemList.StylePropertySelectedItemBackground,
  912. itemListBackgroundSelected)
  913. }),
  914. // Tree
  915. new StyleRule(new SelectorElement(typeof(Tree), null, null, null), new[]
  916. {
  917. new StyleProperty(Tree.StylePropertyBackground,
  918. new StyleBoxFlat {BackgroundColor = new Color(32, 32, 40)}),
  919. new StyleProperty(Tree.StylePropertyItemBoxSelected, new StyleBoxFlat
  920. {
  921. BackgroundColor = new Color(55, 55, 68),
  922. ContentMarginLeftOverride = 4
  923. })
  924. }),
  925. // Placeholder
  926. new StyleRule(new SelectorElement(typeof(Placeholder), null, null, null), new[]
  927. {
  928. new StyleProperty(PanelContainer.StylePropertyPanel, placeholder),
  929. }),
  930. new StyleRule(
  931. new SelectorElement(typeof(Label), new[] {Placeholder.StyleClassPlaceholderText}, null, null), new[]
  932. {
  933. new StyleProperty(Label.StylePropertyFont, notoSans16),
  934. new StyleProperty(Label.StylePropertyFontColor, new Color(103, 103, 103, 128)),
  935. }),
  936. // Big Label
  937. new StyleRule(new SelectorElement(typeof(Label), new[] {StyleClassLabelHeading}, null, null), new[]
  938. {
  939. new StyleProperty(Label.StylePropertyFont, notoSansBold16),
  940. new StyleProperty(Label.StylePropertyFontColor, NanoGold),
  941. }),
  942. // Bigger Label
  943. new StyleRule(new SelectorElement(typeof(Label), new[] {StyleClassLabelHeadingBigger}, null, null),
  944. new[]
  945. {
  946. new StyleProperty(Label.StylePropertyFont, notoSansBold20),
  947. new StyleProperty(Label.StylePropertyFontColor, NanoGold),
  948. }),
  949. // Small Label
  950. new StyleRule(new SelectorElement(typeof(Label), new[] {StyleClassLabelSubText}, null, null), new[]
  951. {
  952. new StyleProperty(Label.StylePropertyFont, notoSans10),
  953. new StyleProperty(Label.StylePropertyFontColor, Color.DarkGray),
  954. }),
  955. // Label Key
  956. new StyleRule(new SelectorElement(typeof(Label), new[] {StyleClassLabelKeyText}, null, null), new[]
  957. {
  958. new StyleProperty(Label.StylePropertyFont, notoSansBold12),
  959. new StyleProperty(Label.StylePropertyFontColor, NanoGold)
  960. }),
  961. new StyleRule(new SelectorElement(typeof(Label), new[] {StyleClassLabelSecondaryColor}, null, null),
  962. new[]
  963. {
  964. new StyleProperty(Label.StylePropertyFont, notoSans12),
  965. new StyleProperty(Label.StylePropertyFontColor, Color.DarkGray),
  966. }),
  967. // Big Button
  968. new StyleRule(new SelectorChild(
  969. new SelectorElement(typeof(Button), new[] {StyleClassButtonBig}, null, null),
  970. new SelectorElement(typeof(Label), null, null, null)),
  971. new[]
  972. {
  973. new StyleProperty("font", notoSans16)
  974. }),
  975. //APC and SMES power state label colors
  976. new StyleRule(new SelectorElement(typeof(Label), new[] {StyleClassPowerStateNone}, null, null), new[]
  977. {
  978. new StyleProperty(Label.StylePropertyFontColor, new Color(0.8f, 0.0f, 0.0f))
  979. }),
  980. new StyleRule(new SelectorElement(typeof(Label), new[] {StyleClassPowerStateLow}, null, null), new[]
  981. {
  982. new StyleProperty(Label.StylePropertyFontColor, new Color(0.9f, 0.36f, 0.0f))
  983. }),
  984. new StyleRule(new SelectorElement(typeof(Label), new[] {StyleClassPowerStateGood}, null, null), new[]
  985. {
  986. new StyleProperty(Label.StylePropertyFontColor, new Color(0.024f, 0.8f, 0.0f))
  987. }),
  988. // Those top menu buttons.
  989. // these use slight variations on the various BaseButton styles so that the content within them appears centered,
  990. // which is NOT the case for the default BaseButton styles (OpenLeft/OpenRight adds extra padding on one of the sides
  991. // which makes the TopButton icons appear off-center, which we don't want).
  992. new StyleRule(
  993. new SelectorElement(typeof(MenuButton), new[] {ButtonSquare}, null, null),
  994. new[]
  995. {
  996. new StyleProperty(Button.StylePropertyStyleBox, topButtonSquare),
  997. }),
  998. new StyleRule(
  999. new SelectorElement(typeof(MenuButton), new[] {ButtonOpenLeft}, null, null),
  1000. new[]
  1001. {
  1002. new StyleProperty(Button.StylePropertyStyleBox, topButtonOpenLeft),
  1003. }),
  1004. new StyleRule(
  1005. new SelectorElement(typeof(MenuButton), new[] {ButtonOpenRight}, null, null),
  1006. new[]
  1007. {
  1008. new StyleProperty(Button.StylePropertyStyleBox, topButtonOpenRight),
  1009. }),
  1010. new StyleRule(
  1011. new SelectorElement(typeof(MenuButton), null, null, new[] {Button.StylePseudoClassNormal}),
  1012. new[]
  1013. {
  1014. new StyleProperty(Button.StylePropertyModulateSelf, ButtonColorDefault),
  1015. }),
  1016. new StyleRule(
  1017. new SelectorElement(typeof(MenuButton), new[] {MenuButton.StyleClassRedTopButton}, null, new[] {Button.StylePseudoClassNormal}),
  1018. new[]
  1019. {
  1020. new StyleProperty(Button.StylePropertyModulateSelf, ButtonColorDefaultRed),
  1021. }),
  1022. new StyleRule(
  1023. new SelectorElement(typeof(MenuButton), null, null, new[] {Button.StylePseudoClassNormal}),
  1024. new[]
  1025. {
  1026. new StyleProperty(Button.StylePropertyModulateSelf, ButtonColorDefault),
  1027. }),
  1028. new StyleRule(
  1029. new SelectorElement(typeof(MenuButton), null, null, new[] {Button.StylePseudoClassPressed}),
  1030. new[]
  1031. {
  1032. new StyleProperty(Button.StylePropertyModulateSelf, ButtonColorPressed),
  1033. }),
  1034. new StyleRule(
  1035. new SelectorElement(typeof(MenuButton), null, null, new[] {Button.StylePseudoClassHover}),
  1036. new[]
  1037. {
  1038. new StyleProperty(Button.StylePropertyModulateSelf, ButtonColorHovered),
  1039. }),
  1040. new StyleRule(
  1041. new SelectorElement(typeof(MenuButton), new[] {MenuButton.StyleClassRedTopButton}, null, new[] {Button.StylePseudoClassHover}),
  1042. new[]
  1043. {
  1044. new StyleProperty(Button.StylePropertyModulateSelf, ButtonColorHoveredRed),
  1045. }),
  1046. new StyleRule(
  1047. new SelectorElement(typeof(Label), new[] {MenuButton.StyleClassLabelTopButton}, null, null),
  1048. new[]
  1049. {
  1050. new StyleProperty(Label.StylePropertyFont, notoSansDisplayBold14),
  1051. }),
  1052. // NanoHeading
  1053. new StyleRule(
  1054. new SelectorChild(
  1055. SelectorElement.Type(typeof(NanoHeading)),
  1056. SelectorElement.Type(typeof(PanelContainer))),
  1057. new[]
  1058. {
  1059. new StyleProperty(PanelContainer.StylePropertyPanel, nanoHeadingBox),
  1060. }),
  1061. // StripeBack
  1062. new StyleRule(
  1063. SelectorElement.Type(typeof(StripeBack)),
  1064. new[]
  1065. {
  1066. new StyleProperty(StripeBack.StylePropertyBackground, stripeBack),
  1067. }),
  1068. // StyleClassItemStatus
  1069. new StyleRule(SelectorElement.Class(StyleClassItemStatus), new[]
  1070. {
  1071. new StyleProperty("font", notoSans10),
  1072. }),
  1073. Element()
  1074. .Class(StyleClassItemStatusNotHeld)
  1075. .Prop("font", notoSansItalic10)
  1076. .Prop("font-color", ItemStatusNotHeldColor),
  1077. Element<RichTextLabel>()
  1078. .Class(StyleClassItemStatus)
  1079. .Prop(nameof(RichTextLabel.LineHeightScale), 0.7f)
  1080. .Prop(nameof(Control.Margin), new Thickness(0, 0, 0, -6)),
  1081. // Slider
  1082. new StyleRule(SelectorElement.Type(typeof(Slider)), new []
  1083. {
  1084. new StyleProperty(Slider.StylePropertyBackground, sliderBackBox),
  1085. new StyleProperty(Slider.StylePropertyForeground, sliderForeBox),
  1086. new StyleProperty(Slider.StylePropertyGrabber, sliderGrabBox),
  1087. new StyleProperty(Slider.StylePropertyFill, sliderFillBox),
  1088. }),
  1089. new StyleRule(SelectorElement.Type(typeof(ColorableSlider)), new []
  1090. {
  1091. new StyleProperty(ColorableSlider.StylePropertyFillWhite, sliderFillWhite),
  1092. new StyleProperty(ColorableSlider.StylePropertyBackgroundWhite, sliderFillWhite),
  1093. }),
  1094. new StyleRule(new SelectorElement(typeof(Slider), new []{StyleClassSliderRed}, null, null), new []
  1095. {
  1096. new StyleProperty(Slider.StylePropertyFill, sliderFillRed),
  1097. }),
  1098. new StyleRule(new SelectorElement(typeof(Slider), new []{StyleClassSliderGreen}, null, null), new []
  1099. {
  1100. new StyleProperty(Slider.StylePropertyFill, sliderFillGreen),
  1101. }),
  1102. new StyleRule(new SelectorElement(typeof(Slider), new []{StyleClassSliderBlue}, null, null), new []
  1103. {
  1104. new StyleProperty(Slider.StylePropertyFill, sliderFillBlue),
  1105. }),
  1106. new StyleRule(new SelectorElement(typeof(Slider), new []{StyleClassSliderWhite}, null, null), new []
  1107. {
  1108. new StyleProperty(Slider.StylePropertyFill, sliderFillWhite),
  1109. }),
  1110. // chat channel option selector
  1111. new StyleRule(new SelectorElement(typeof(Button), new[] {StyleClassChatChannelSelectorButton}, null, null), new[]
  1112. {
  1113. new StyleProperty(Button.StylePropertyStyleBox, chatChannelButton),
  1114. }),
  1115. // chat filter button
  1116. new StyleRule(new SelectorElement(typeof(ContainerButton), new[] {StyleClassChatFilterOptionButton}, null, null), new[]
  1117. {
  1118. new StyleProperty(ContainerButton.StylePropertyStyleBox, chatFilterButton),
  1119. }),
  1120. new StyleRule(new SelectorElement(typeof(ContainerButton), new[] {StyleClassChatFilterOptionButton}, null, new[] {ContainerButton.StylePseudoClassNormal}), new[]
  1121. {
  1122. new StyleProperty(Control.StylePropertyModulateSelf, ButtonColorDefault),
  1123. }),
  1124. new StyleRule(new SelectorElement(typeof(ContainerButton), new[] {StyleClassChatFilterOptionButton}, null, new[] {ContainerButton.StylePseudoClassHover}), new[]
  1125. {
  1126. new StyleProperty(Control.StylePropertyModulateSelf, ButtonColorHovered),
  1127. }),
  1128. new StyleRule(new SelectorElement(typeof(ContainerButton), new[] {StyleClassChatFilterOptionButton}, null, new[] {ContainerButton.StylePseudoClassPressed}), new[]
  1129. {
  1130. new StyleProperty(Control.StylePropertyModulateSelf, ButtonColorPressed),
  1131. }),
  1132. new StyleRule(new SelectorElement(typeof(ContainerButton), new[] {StyleClassChatFilterOptionButton}, null, new[] {ContainerButton.StylePseudoClassDisabled}), new[]
  1133. {
  1134. new StyleProperty(Control.StylePropertyModulateSelf, ButtonColorDisabled),
  1135. }),
  1136. // OptionButton
  1137. new StyleRule(new SelectorElement(typeof(OptionButton), null, null, null), new[]
  1138. {
  1139. new StyleProperty(ContainerButton.StylePropertyStyleBox, BaseButton),
  1140. }),
  1141. new StyleRule(new SelectorElement(typeof(OptionButton), null, null, new[] {ContainerButton.StylePseudoClassNormal}), new[]
  1142. {
  1143. new StyleProperty(Control.StylePropertyModulateSelf, ButtonColorDefault),
  1144. }),
  1145. new StyleRule(new SelectorElement(typeof(OptionButton), null, null, new[] {ContainerButton.StylePseudoClassHover}), new[]
  1146. {
  1147. new StyleProperty(Control.StylePropertyModulateSelf, ButtonColorHovered),
  1148. }),
  1149. new StyleRule(new SelectorElement(typeof(OptionButton), null, null, new[] {ContainerButton.StylePseudoClassPressed}), new[]
  1150. {
  1151. new StyleProperty(Control.StylePropertyModulateSelf, ButtonColorPressed),
  1152. }),
  1153. new StyleRule(new SelectorElement(typeof(OptionButton), null, null, new[] {ContainerButton.StylePseudoClassDisabled}), new[]
  1154. {
  1155. new StyleProperty(Control.StylePropertyModulateSelf, ButtonColorDisabled),
  1156. }),
  1157. new StyleRule(new SelectorElement(typeof(TextureRect), new[] {OptionButton.StyleClassOptionTriangle}, null, null), new[]
  1158. {
  1159. new StyleProperty(TextureRect.StylePropertyTexture, textureInvertedTriangle),
  1160. //new StyleProperty(Control.StylePropertyModulateSelf, Color.FromHex("#FFFFFF")),
  1161. }),
  1162. new StyleRule(new SelectorElement(typeof(Label), new[] { OptionButton.StyleClassOptionButton }, null, null), new[]
  1163. {
  1164. new StyleProperty(Label.StylePropertyAlignMode, Label.AlignMode.Center),
  1165. }),
  1166. Element<PanelContainer>().Class(OptionButton.StyleClassOptionsBackground)
  1167. .Prop(PanelContainer.StylePropertyPanel, new StyleBoxFlat(Color.FromHex("#25252A"))),
  1168. new StyleRule(new SelectorElement(typeof(PanelContainer), new []{ ClassHighDivider}, null, null), new []
  1169. {
  1170. new StyleProperty(PanelContainer.StylePropertyPanel, new StyleBoxFlat { BackgroundColor = NanoGold, ContentMarginBottomOverride = 2, ContentMarginLeftOverride = 2}),
  1171. }),
  1172. Element<TextureButton>()
  1173. .Class(StyleClassButtonHelp)
  1174. .Prop(TextureButton.StylePropertyTexture, resCache.GetTexture("/Textures/Interface/VerbIcons/information.svg.192dpi.png")),
  1175. // Labels ---
  1176. Element<Label>().Class(StyleClassLabelBig)
  1177. .Prop(Label.StylePropertyFont, notoSans16),
  1178. Element<Label>().Class(StyleClassLabelSmall)
  1179. .Prop(Label.StylePropertyFont, notoSans10),
  1180. // ---
  1181. // Different Background shapes ---
  1182. Element<PanelContainer>().Class(ClassAngleRect)
  1183. .Prop(PanelContainer.StylePropertyPanel, BaseAngleRect)
  1184. .Prop(Control.StylePropertyModulateSelf, Color.FromHex("#25252A")),
  1185. Element<PanelContainer>().Class("BackgroundOpenRight")
  1186. .Prop(PanelContainer.StylePropertyPanel, BaseButtonOpenRight)
  1187. .Prop(Control.StylePropertyModulateSelf, Color.FromHex("#25252A")),
  1188. Element<PanelContainer>().Class("BackgroundOpenLeft")
  1189. .Prop(PanelContainer.StylePropertyPanel, BaseButtonOpenLeft)
  1190. .Prop(Control.StylePropertyModulateSelf, Color.FromHex("#25252A")),
  1191. // ---
  1192. // Dividers
  1193. Element<PanelContainer>().Class(ClassLowDivider)
  1194. .Prop(PanelContainer.StylePropertyPanel, new StyleBoxFlat
  1195. {
  1196. BackgroundColor = Color.FromHex("#444"),
  1197. ContentMarginLeftOverride = 2,
  1198. ContentMarginBottomOverride = 2
  1199. }),
  1200. // Window Headers
  1201. Element<Label>().Class("FancyWindowTitle")
  1202. .Prop("font", boxFont13)
  1203. .Prop("font-color", NanoGold),
  1204. Element<PanelContainer>().Class("WindowHeadingBackground")
  1205. .Prop("panel", new StyleBoxTexture(BaseButtonOpenLeft) { Padding = default })
  1206. .Prop(Control.StylePropertyModulateSelf, Color.FromHex("#1F1F23")),
  1207. Element<PanelContainer>().Class("WindowHeadingBackgroundLight")
  1208. .Prop("panel", new StyleBoxTexture(BaseButtonOpenLeft) { Padding = default }),
  1209. // Window Header Help Button
  1210. Element<TextureButton>().Class(FancyWindow.StyleClassWindowHelpButton)
  1211. .Prop(TextureButton.StylePropertyTexture, resCache.GetTexture("/Textures/Interface/Nano/help.png"))
  1212. .Prop(Control.StylePropertyModulateSelf, Color.FromHex("#4B596A")),
  1213. Element<TextureButton>().Class(FancyWindow.StyleClassWindowHelpButton).Pseudo(ContainerButton.StylePseudoClassHover)
  1214. .Prop(Control.StylePropertyModulateSelf, Color.FromHex("#7F3636")),
  1215. Element<TextureButton>().Class(FancyWindow.StyleClassWindowHelpButton).Pseudo(ContainerButton.StylePseudoClassPressed)
  1216. .Prop(Control.StylePropertyModulateSelf, Color.FromHex("#753131")),
  1217. //The lengths you have to go through to change a background color smh
  1218. Element<PanelContainer>().Class("PanelBackgroundBaseDark")
  1219. .Prop("panel", new StyleBoxTexture(BaseButtonOpenBoth) { Padding = default })
  1220. .Prop(Control.StylePropertyModulateSelf, Color.FromHex("#1F1F23")),
  1221. Element<PanelContainer>().Class("PanelBackgroundLight")
  1222. .Prop("panel", new StyleBoxTexture(BaseButtonOpenBoth) { Padding = default })
  1223. .Prop(Control.StylePropertyModulateSelf, Color.FromHex("#2F2F3B")),
  1224. // Window Footer
  1225. Element<TextureRect>().Class("NTLogoDark")
  1226. .Prop(TextureRect.StylePropertyTexture, resCache.GetTexture("/Textures/Interface/Nano/ntlogo.svg.png"))
  1227. .Prop(Control.StylePropertyModulateSelf, Color.FromHex("#757575")),
  1228. Element<Label>().Class("WindowFooterText")
  1229. .Prop(Label.StylePropertyFont, notoSans8)
  1230. .Prop(Label.StylePropertyFontColor, Color.FromHex("#757575")),
  1231. // X Texture button ---
  1232. Element<TextureButton>().Class("CrossButtonRed")
  1233. .Prop(TextureButton.StylePropertyTexture, resCache.GetTexture("/Textures/Interface/Nano/cross.svg.png"))
  1234. .Prop(Control.StylePropertyModulateSelf, DangerousRedFore),
  1235. Element<TextureButton>().Class("CrossButtonRed").Pseudo(TextureButton.StylePseudoClassHover)
  1236. .Prop(Control.StylePropertyModulateSelf, Color.FromHex("#7F3636")),
  1237. Element<TextureButton>().Class("CrossButtonRed").Pseudo(TextureButton.StylePseudoClassHover)
  1238. .Prop(Control.StylePropertyModulateSelf, Color.FromHex("#753131")),
  1239. // ---
  1240. // Profile Editor
  1241. Element<TextureButton>().Class("SpeciesInfoDefault")
  1242. .Prop(TextureButton.StylePropertyTexture, resCache.GetTexture("/Textures/Interface/VerbIcons/information.svg.192dpi.png")),
  1243. Element<TextureButton>().Class("SpeciesInfoWarning")
  1244. .Prop(TextureButton.StylePropertyTexture, resCache.GetTexture("/Textures/Interface/info.svg.192dpi.png"))
  1245. .Prop(Control.StylePropertyModulateSelf, Color.FromHex("#eeee11")),
  1246. // The default look of paper in UIs. Pages can have components which override this
  1247. Element<PanelContainer>().Class("PaperDefaultBorder")
  1248. .Prop(PanelContainer.StylePropertyPanel, paperBackground),
  1249. Element<RichTextLabel>().Class("PaperWrittenText")
  1250. .Prop(Label.StylePropertyFont, notoSans12)
  1251. .Prop(Control.StylePropertyModulateSelf, Color.FromHex("#111111")),
  1252. Element<RichTextLabel>().Class("LabelSubText")
  1253. .Prop(Label.StylePropertyFont, notoSans10)
  1254. .Prop(Label.StylePropertyFontColor, Color.DarkGray),
  1255. Element<LineEdit>().Class("PaperLineEdit")
  1256. .Prop(LineEdit.StylePropertyStyleBox, new StyleBoxEmpty()),
  1257. // Red Button ---
  1258. Element<Button>().Class("ButtonColorRed")
  1259. .Prop(Control.StylePropertyModulateSelf, ButtonColorDefaultRed),
  1260. Element<Button>().Class("ButtonColorRed").Pseudo(ContainerButton.StylePseudoClassNormal)
  1261. .Prop(Control.StylePropertyModulateSelf, ButtonColorDefaultRed),
  1262. Element<Button>().Class("ButtonColorRed").Pseudo(ContainerButton.StylePseudoClassHover)
  1263. .Prop(Control.StylePropertyModulateSelf, ButtonColorHoveredRed),
  1264. // ---
  1265. // Green Button ---
  1266. Element<Button>().Class("ButtonColorGreen")
  1267. .Prop(Control.StylePropertyModulateSelf, ButtonColorGoodDefault),
  1268. Element<Button>().Class("ButtonColorGreen").Pseudo(ContainerButton.StylePseudoClassNormal)
  1269. .Prop(Control.StylePropertyModulateSelf, ButtonColorGoodDefault),
  1270. Element<Button>().Class("ButtonColorGreen").Pseudo(ContainerButton.StylePseudoClassHover)
  1271. .Prop(Control.StylePropertyModulateSelf, ButtonColorGoodHovered),
  1272. // Accept button (merge with green button?) ---
  1273. Element<Button>().Class("ButtonAccept")
  1274. .Prop(Control.StylePropertyModulateSelf, ButtonColorGoodDefault),
  1275. Element<Button>().Class("ButtonAccept").Pseudo(ContainerButton.StylePseudoClassNormal)
  1276. .Prop(Control.StylePropertyModulateSelf, ButtonColorGoodDefault),
  1277. Element<Button>().Class("ButtonAccept").Pseudo(ContainerButton.StylePseudoClassHover)
  1278. .Prop(Control.StylePropertyModulateSelf, ButtonColorGoodHovered),
  1279. Element<Button>().Class("ButtonAccept").Pseudo(ContainerButton.StylePseudoClassDisabled)
  1280. .Prop(Control.StylePropertyModulateSelf, ButtonColorGoodDisabled),
  1281. // ---
  1282. // Small Button ---
  1283. Element<Button>().Class("ButtonSmall")
  1284. .Prop(ContainerButton.StylePropertyStyleBox, smallButtonBase),
  1285. Child().Parent(Element<Button>().Class("ButtonSmall"))
  1286. .Child(Element<Label>())
  1287. .Prop(Label.StylePropertyFont, notoSans8),
  1288. // ---
  1289. Element<Label>().Class("StatusFieldTitle")
  1290. .Prop("font-color", NanoGold),
  1291. Element<Label>().Class("Good")
  1292. .Prop("font-color", GoodGreenFore),
  1293. Element<Label>().Class("Caution")
  1294. .Prop("font-color", ConcerningOrangeFore),
  1295. Element<Label>().Class("Danger")
  1296. .Prop("font-color", DangerousRedFore),
  1297. Element<Label>().Class("Disabled")
  1298. .Prop("font-color", DisabledFore),
  1299. // Radial menu buttons
  1300. Element<TextureButton>().Class("RadialMenuButton")
  1301. .Prop(TextureButton.StylePropertyTexture, resCache.GetTexture("/Textures/Interface/Radial/button_normal.png")),
  1302. Element<TextureButton>().Class("RadialMenuButton")
  1303. .Pseudo(TextureButton.StylePseudoClassHover)
  1304. .Prop(TextureButton.StylePropertyTexture, resCache.GetTexture("/Textures/Interface/Radial/button_hover.png")),
  1305. Element<TextureButton>().Class("RadialMenuCloseButton")
  1306. .Prop(TextureButton.StylePropertyTexture, resCache.GetTexture("/Textures/Interface/Radial/close_normal.png")),
  1307. Element<TextureButton>().Class("RadialMenuCloseButton")
  1308. .Pseudo(TextureButton.StylePseudoClassHover)
  1309. .Prop(TextureButton.StylePropertyTexture, resCache.GetTexture("/Textures/Interface/Radial/close_hover.png")),
  1310. Element<TextureButton>().Class("RadialMenuBackButton")
  1311. .Prop(TextureButton.StylePropertyTexture, resCache.GetTexture("/Textures/Interface/Radial/back_normal.png")),
  1312. Element<TextureButton>().Class("RadialMenuBackButton")
  1313. .Pseudo(TextureButton.StylePseudoClassHover)
  1314. .Prop(TextureButton.StylePropertyTexture, resCache.GetTexture("/Textures/Interface/Radial/back_hover.png")),
  1315. //PDA - Backgrounds
  1316. Element<PanelContainer>().Class("PdaContentBackground")
  1317. .Prop(PanelContainer.StylePropertyPanel, BaseButtonOpenBoth)
  1318. .Prop(Control.StylePropertyModulateSelf, Color.FromHex("#25252a")),
  1319. Element<PanelContainer>().Class("PdaBackground")
  1320. .Prop(PanelContainer.StylePropertyPanel, BaseButtonOpenBoth)
  1321. .Prop(Control.StylePropertyModulateSelf, Color.FromHex("#000000")),
  1322. Element<PanelContainer>().Class("PdaBackgroundRect")
  1323. .Prop(PanelContainer.StylePropertyPanel, BaseAngleRect)
  1324. .Prop(Control.StylePropertyModulateSelf, Color.FromHex("#717059")),
  1325. Element<PanelContainer>().Class("PdaBorderRect")
  1326. .Prop(PanelContainer.StylePropertyPanel, AngleBorderRect),
  1327. Element<PanelContainer>().Class("BackgroundDark")
  1328. .Prop(PanelContainer.StylePropertyPanel, new StyleBoxFlat(Color.FromHex("#25252A"))),
  1329. //PDA - Buttons
  1330. Element<PdaSettingsButton>().Pseudo(ContainerButton.StylePseudoClassNormal)
  1331. .Prop(PdaSettingsButton.StylePropertyBgColor, Color.FromHex(PdaSettingsButton.NormalBgColor))
  1332. .Prop(PdaSettingsButton.StylePropertyFgColor, Color.FromHex(PdaSettingsButton.EnabledFgColor)),
  1333. Element<PdaSettingsButton>().Pseudo(ContainerButton.StylePseudoClassHover)
  1334. .Prop(PdaSettingsButton.StylePropertyBgColor, Color.FromHex(PdaSettingsButton.HoverColor))
  1335. .Prop(PdaSettingsButton.StylePropertyFgColor, Color.FromHex(PdaSettingsButton.EnabledFgColor)),
  1336. Element<PdaSettingsButton>().Pseudo(ContainerButton.StylePseudoClassPressed)
  1337. .Prop(PdaSettingsButton.StylePropertyBgColor, Color.FromHex(PdaSettingsButton.PressedColor))
  1338. .Prop(PdaSettingsButton.StylePropertyFgColor, Color.FromHex(PdaSettingsButton.EnabledFgColor)),
  1339. Element<PdaSettingsButton>().Pseudo(ContainerButton.StylePseudoClassDisabled)
  1340. .Prop(PdaSettingsButton.StylePropertyBgColor, Color.FromHex(PdaSettingsButton.NormalBgColor))
  1341. .Prop(PdaSettingsButton.StylePropertyFgColor, Color.FromHex(PdaSettingsButton.DisabledFgColor)),
  1342. Element<PdaProgramItem>().Pseudo(ContainerButton.StylePseudoClassNormal)
  1343. .Prop(PdaProgramItem.StylePropertyBgColor, Color.FromHex(PdaProgramItem.NormalBgColor)),
  1344. Element<PdaProgramItem>().Pseudo(ContainerButton.StylePseudoClassHover)
  1345. .Prop(PdaProgramItem.StylePropertyBgColor, Color.FromHex(PdaProgramItem.HoverColor)),
  1346. Element<PdaProgramItem>().Pseudo(ContainerButton.StylePseudoClassPressed)
  1347. .Prop(PdaProgramItem.StylePropertyBgColor, Color.FromHex(PdaProgramItem.HoverColor)),
  1348. //PDA - Text
  1349. Element<Label>().Class("PdaContentFooterText")
  1350. .Prop(Label.StylePropertyFont, notoSans10)
  1351. .Prop(Label.StylePropertyFontColor, Color.FromHex("#757575")),
  1352. Element<Label>().Class("PdaWindowFooterText")
  1353. .Prop(Label.StylePropertyFont, notoSans10)
  1354. .Prop(Label.StylePropertyFontColor, Color.FromHex("#333d3b")),
  1355. // Fancy Tree
  1356. Element<ContainerButton>().Identifier(TreeItem.StyleIdentifierTreeButton)
  1357. .Class(TreeItem.StyleClassEvenRow)
  1358. .Prop(ContainerButton.StylePropertyStyleBox, new StyleBoxFlat
  1359. {
  1360. BackgroundColor = FancyTreeEvenRowColor,
  1361. }),
  1362. Element<ContainerButton>().Identifier(TreeItem.StyleIdentifierTreeButton)
  1363. .Class(TreeItem.StyleClassOddRow)
  1364. .Prop(ContainerButton.StylePropertyStyleBox, new StyleBoxFlat
  1365. {
  1366. BackgroundColor = FancyTreeOddRowColor,
  1367. }),
  1368. Element<ContainerButton>().Identifier(TreeItem.StyleIdentifierTreeButton)
  1369. .Class(TreeItem.StyleClassSelected)
  1370. .Prop(ContainerButton.StylePropertyStyleBox, new StyleBoxFlat
  1371. {
  1372. BackgroundColor = FancyTreeSelectedRowColor,
  1373. }),
  1374. Element<ContainerButton>().Identifier(TreeItem.StyleIdentifierTreeButton)
  1375. .Pseudo(ContainerButton.StylePseudoClassHover)
  1376. .Prop(ContainerButton.StylePropertyStyleBox, new StyleBoxFlat
  1377. {
  1378. BackgroundColor = FancyTreeSelectedRowColor,
  1379. }),
  1380. // Shitmed Change Start
  1381. Element<TextureButton>().Class("TargetDollButtonHead")
  1382. .Pseudo(TextureButton.StylePseudoClassHover)
  1383. .Prop(TextureButton.StylePropertyTexture, resCache.GetTexture("/Textures/_Shitmed/Interface/Targeting/Doll/head_hover.png")),
  1384. Element<TextureButton>().Class("TargetDollButtonChest")
  1385. .Pseudo(TextureButton.StylePseudoClassHover)
  1386. .Prop(TextureButton.StylePropertyTexture, resCache.GetTexture("/Textures/_Shitmed/Interface/Targeting/Doll/torso_hover.png")),
  1387. Element<TextureButton>().Class("TargetDollButtonGroin")
  1388. .Pseudo(TextureButton.StylePseudoClassHover)
  1389. .Prop(TextureButton.StylePropertyTexture, resCache.GetTexture("/Textures/_Shitmed/Interface/Targeting/Doll/groin_hover.png")),
  1390. Element<TextureButton>().Class("TargetDollButtonLeftArm")
  1391. .Pseudo(TextureButton.StylePseudoClassHover)
  1392. .Prop(TextureButton.StylePropertyTexture, resCache.GetTexture("/Textures/_Shitmed/Interface/Targeting/Doll/leftarm_hover.png")),
  1393. Element<TextureButton>().Class("TargetDollButtonLeftHand")
  1394. .Pseudo(TextureButton.StylePseudoClassHover)
  1395. .Prop(TextureButton.StylePropertyTexture, resCache.GetTexture("/Textures/_Shitmed/Interface/Targeting/Doll/lefthand_hover.png")),
  1396. Element<TextureButton>().Class("TargetDollButtonRightArm")
  1397. .Pseudo(TextureButton.StylePseudoClassHover)
  1398. .Prop(TextureButton.StylePropertyTexture, resCache.GetTexture("/Textures/_Shitmed/Interface/Targeting/Doll/rightarm_hover.png")),
  1399. Element<TextureButton>().Class("TargetDollButtonRightHand")
  1400. .Pseudo(TextureButton.StylePseudoClassHover)
  1401. .Prop(TextureButton.StylePropertyTexture, resCache.GetTexture("/Textures/_Shitmed/Interface/Targeting/Doll/righthand_hover.png")),
  1402. Element<TextureButton>().Class("TargetDollButtonLeftLeg")
  1403. .Pseudo(TextureButton.StylePseudoClassHover)
  1404. .Prop(TextureButton.StylePropertyTexture, resCache.GetTexture("/Textures/_Shitmed/Interface/Targeting/Doll/leftleg_hover.png")),
  1405. Element<TextureButton>().Class("TargetDollButtonLeftFoot")
  1406. .Pseudo(TextureButton.StylePseudoClassHover)
  1407. .Prop(TextureButton.StylePropertyTexture, resCache.GetTexture("/Textures/_Shitmed/Interface/Targeting/Doll/leftfoot_hover.png")),
  1408. Element<TextureButton>().Class("TargetDollButtonRightLeg")
  1409. .Pseudo(TextureButton.StylePseudoClassHover)
  1410. .Prop(TextureButton.StylePropertyTexture, resCache.GetTexture("/Textures/_Shitmed/Interface/Targeting/Doll/rightleg_hover.png")),
  1411. Element<TextureButton>().Class("TargetDollButtonRightFoot")
  1412. .Pseudo(TextureButton.StylePseudoClassHover)
  1413. .Prop(TextureButton.StylePropertyTexture, resCache.GetTexture("/Textures/_Shitmed/Interface/Targeting/Doll/rightfoot_hover.png")),
  1414. Element<TextureButton>().Class("TargetDollButtonEyes")
  1415. .Pseudo(TextureButton.StylePseudoClassHover)
  1416. .Prop(TextureButton.StylePropertyTexture, resCache.GetTexture("/Textures/_Shitmed/Interface/Targeting/Doll/eyes_hover.png")),
  1417. Element<TextureButton>().Class("TargetDollButtonMouth")
  1418. .Pseudo(TextureButton.StylePseudoClassHover)
  1419. .Prop(TextureButton.StylePropertyTexture, resCache.GetTexture("/Textures/_Shitmed/Interface/Targeting/Doll/mouth_hover.png")),
  1420. // Shitmed Change End
  1421. // Silicon law edit ui
  1422. Element<Label>().Class(SiliconLawContainer.StyleClassSiliconLawPositionLabel)
  1423. .Prop(Label.StylePropertyFontColor, NanoGold),
  1424. // Pinned button style
  1425. new StyleRule(
  1426. new SelectorElement(typeof(TextureButton), new[] { StyleClassPinButtonPinned }, null, null),
  1427. new[]
  1428. {
  1429. new StyleProperty(TextureButton.StylePropertyTexture, resCache.GetTexture("/Textures/Interface/Bwoink/pinned.png"))
  1430. }),
  1431. // Unpinned button style
  1432. new StyleRule(
  1433. new SelectorElement(typeof(TextureButton), new[] { StyleClassPinButtonUnpinned }, null, null),
  1434. new[]
  1435. {
  1436. new StyleProperty(TextureButton.StylePropertyTexture, resCache.GetTexture("/Textures/Interface/Bwoink/un_pinned.png"))
  1437. })
  1438. }).ToList());
  1439. }
  1440. }
  1441. }