Files
crystall-punk-14/Content.Client/UserInterface/NanoStyle.cs

692 lines
32 KiB
C#
Raw Normal View History

using Content.Client.GameObjects.EntitySystems;
using Content.Client.Utility;
using Robust.Client.Graphics.Drawing;
using Robust.Client.Interfaces.ResourceManagement;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
using Robust.Shared.IoC;
using Robust.Shared.Maths;
2019-02-18 09:16:06 +01:00
namespace Content.Client.UserInterface
{
public sealed class NanoStyle
{
2020-01-15 14:27:47 +01:00
public const string StyleClassSliderRed = "Red";
public const string StyleClassSliderGreen = "Green";
public const string StyleClassSliderBlue = "Blue";
public const string StyleClassLabelHeading = "LabelHeading";
2019-10-18 14:28:24 +02:00
public const string StyleClassLabelHeadingBigger = "LabelHeadingBigger";
2019-07-20 14:06:54 +02:00
public const string StyleClassLabelSubText = "LabelSubText";
public const string StyleClassLabelKeyText = "LabelKeyText";
Reagent dispensers (#360) * Expose more private values of Solution and SolutionComponent Expose SolutionComponent.ContainedSolution and Solution.Contents. Both needed by ReagentDispenserComponent. * Implement IExamine for SolutionComponent Allows players to see the contents of a solution by examining the entity which contains it. * Implement ReagentDispenserComponent Adds ReagentDispenserComponent. A component which can add or remove reagents from a solution container. It's written in a general way so that it can be used for things such as the Chemical dispensers in chemistry, but also the booze and soda dispensers in the bar. The chemicals it may dispense are defined in yaml, similar to the way that vending machines define which entities they can dispense, by defining a reagent pack. * Add chemical dispenser and equipment Adds the chemical dispenser, beaker, large beaker, dropper, and a few more chemicals. * Add booze and soda dispensers. Adds the booze and soda dispensers, and a few chemicals for them to dispense. There's no drink mixing or drunkenness yet. * Update engine submodule. * Remove unneeded and commented out code Had a few WIP notes and debug code bits I forgot to remove beforehand. * Make SolutionComponent._containedSolution and it's values private again - Remove `SolutionComponent.ContainedSolution` property, replace with specific access functions to maintain safety. - Make Solution.Contents return a `ReadOnlyCollection` instead of `_contents` to prevent uncontrolled access to the Solution values. - Add `SolutionComponent.RemoveAllSolution()` * Update Content.Shared/Chemistry/Solution.cs Commits a suggestion from RemieRichards to match the coding style of the rest of the codebase. Using `IReadOnlyList` instead of `IReadOnlyCollection`. Co-Authored-By: Remie Richards <remierichards@gmail.com> * Update Content.Shared/GameObjects/Components/Chemistry/SolutionComponent.cs Commits a suggestion from RemieRichards to match the coding style of the rest of the codebase. Using `IReadOnlyList` instead of `IReadOnlyCollection`. Co-Authored-By: Remie Richards <remierichards@gmail.com> * Add import for IReadOnlyList to Shared/SolutionComponent.cs * Add documentation * Improve localization Improve use of ILocalizationManager. * Resolve ReagentDispenserWindow._localizationManager before using it Forgot to do this in the last commit, resulting in a crash. Oops. * Add SolutionCaps.FitsInDispenser. Use in ReagentDispenserComponent. Used to limit large containers like buckets or mop buckets from being placed in a dispenser. Both have large capacities (500) and weren't designed to hold certain chemicals like a beaker is, so for now they can be blocked from being put in a dispenser by giving them that flag. * Add colors to new reagents * Update engine submodule
2019-10-05 09:10:05 -04:00
public const string StyleClassLabelSecondaryColor = "LabelSecondaryColor";
2019-10-18 14:28:24 +02:00
public const string StyleClassLabelBig = "LabelBig";
public const string StyleClassButtonBig = "ButtonBig";
2019-10-18 14:28:24 +02:00
public static readonly Color NanoGold = Color.FromHex("#A88B5E");
2019-10-22 23:16:12 +02:00
public static readonly Color ButtonColorDefault = Color.FromHex("#464966");
public static readonly Color ButtonColorHovered = Color.FromHex("#575b7f");
public static readonly Color ButtonColorPressed = Color.FromHex("#3e6c45");
public static readonly Color ButtonColorDisabled = Color.FromHex("#30313c");
2019-02-18 09:16:06 +01:00
//Used by the APC and SMES menus
public const string StyleClassPowerStateNone = "PowerStateNone";
public const string StyleClassPowerStateLow = "PowerStateLow";
public const string StyleClassPowerStateGood = "PowerStateGood";
2020-01-09 00:27:52 +01:00
public const string StyleClassItemStatus = "ItemStatus";
2019-02-18 09:16:06 +01:00
public Stylesheet Stylesheet { get; }
public NanoStyle()
{
var resCache = IoCManager.Resolve<IResourceCache>();
2020-01-09 00:27:52 +01:00
var notoSans8 = resCache.GetFont("/Nano/NotoSans/NotoSans-Regular.ttf", 8);
2019-07-20 14:06:54 +02:00
var notoSans10 = resCache.GetFont("/Nano/NotoSans/NotoSans-Regular.ttf", 10);
var notoSans12 = resCache.GetFont("/Nano/NotoSans/NotoSans-Regular.ttf", 12);
var notoSansBold12 = resCache.GetFont("/Nano/NotoSans/NotoSans-Bold.ttf", 12);
2019-07-18 23:33:32 +02:00
var notoSansDisplayBold14 = resCache.GetFont("/Fonts/NotoSansDisplay/NotoSansDisplay-Bold.ttf", 14);
var notoSans16 = resCache.GetFont("/Nano/NotoSans/NotoSans-Regular.ttf", 16);
var notoSansBold16 = resCache.GetFont("/Nano/NotoSans/NotoSans-Bold.ttf", 16);
2019-10-18 14:28:24 +02:00
var notoSansBold20 = resCache.GetFont("/Nano/NotoSans/NotoSans-Bold.ttf", 20);
var textureCloseButton = resCache.GetTexture("/Nano/cross.svg.png");
var windowHeaderTex = resCache.GetTexture("/Nano/window_header.png");
2019-02-18 09:16:06 +01:00
var windowHeader = new StyleBoxTexture
{
Texture = windowHeaderTex,
PatchMarginBottom = 3,
ExpandMarginBottom = 3,
ContentMarginBottomOverride = 0
2019-02-18 09:16:06 +01:00
};
var windowBackgroundTex = resCache.GetTexture("/Nano/window_background.png");
2019-02-21 18:13:37 +01:00
var windowBackground = new StyleBoxTexture
{
2019-03-05 09:39:12 +01:00
Texture = windowBackgroundTex,
2019-02-21 18:13:37 +01:00
};
2019-02-21 22:01:13 +01:00
windowBackground.SetPatchMargin(StyleBox.Margin.Horizontal | StyleBox.Margin.Bottom, 2);
2019-02-21 18:13:37 +01:00
windowBackground.SetExpandMargin(StyleBox.Margin.Horizontal | StyleBox.Margin.Bottom, 2);
2019-10-15 13:12:48 +02:00
// Button styles.
var buttonTex = resCache.GetTexture("/Nano/button.svg.96dpi.png");
2019-02-18 09:16:06 +01:00
var buttonNormal = new StyleBoxTexture
{
2019-10-15 13:12:48 +02:00
Texture = buttonTex,
2019-10-22 23:16:12 +02:00
Modulate = ButtonColorDefault
2019-02-18 09:16:06 +01:00
};
2019-10-18 14:28:24 +02:00
buttonNormal.SetPatchMargin(StyleBox.Margin.All, 10);
2019-10-15 13:12:48 +02:00
buttonNormal.SetPadding(StyleBox.Margin.All, 1);
buttonNormal.SetContentMarginOverride(StyleBox.Margin.Vertical, 2);
2019-10-18 14:28:24 +02:00
buttonNormal.SetContentMarginOverride(StyleBox.Margin.Horizontal, 14);
2019-02-18 09:16:06 +01:00
2019-10-15 13:12:48 +02:00
var buttonHover = new StyleBoxTexture(buttonNormal)
2019-02-18 09:16:06 +01:00
{
2019-10-22 23:16:12 +02:00
Modulate = ButtonColorHovered
2019-02-18 09:16:06 +01:00
};
2019-10-15 13:12:48 +02:00
var buttonPressed = new StyleBoxTexture(buttonNormal)
2019-02-18 09:16:06 +01:00
{
2019-10-22 23:16:12 +02:00
Modulate = ButtonColorPressed
2019-02-18 09:16:06 +01:00
};
2019-10-15 13:12:48 +02:00
var buttonDisabled = new StyleBoxTexture(buttonNormal)
2019-02-18 09:16:06 +01:00
{
2019-10-22 23:16:12 +02:00
Modulate = ButtonColorDisabled
2019-02-18 09:16:06 +01:00
};
var lineEditTex = resCache.GetTexture("/Nano/lineedit.png");
2019-02-23 16:35:51 +01:00
var lineEdit = new StyleBoxTexture
{
Texture = lineEditTex,
};
lineEdit.SetPatchMargin(StyleBox.Margin.All, 3);
lineEdit.SetContentMarginOverride(StyleBox.Margin.Horizontal, 5);
2019-02-18 09:16:06 +01:00
2019-03-05 09:39:12 +01:00
var tabContainerPanelTex = resCache.GetTexture("/Nano/tabcontainer_panel.png");
var tabContainerPanel = new StyleBoxTexture
{
Texture = tabContainerPanelTex,
};
tabContainerPanel.SetPatchMargin(StyleBox.Margin.All, 2);
var tabContainerBoxActive = new StyleBoxFlat {BackgroundColor = new Color(64, 64, 64)};
2019-08-30 09:39:22 +02:00
tabContainerBoxActive.SetContentMarginOverride(StyleBox.Margin.Horizontal, 5);
2019-03-05 09:39:12 +01:00
var tabContainerBoxInactive = new StyleBoxFlat {BackgroundColor = new Color(32, 32, 32)};
2019-08-30 09:39:22 +02:00
tabContainerBoxInactive.SetContentMarginOverride(StyleBox.Margin.Horizontal, 5);
2019-03-05 09:39:12 +01:00
var vScrollBarGrabberNormal = new StyleBoxFlat
{
2020-01-09 00:27:52 +01:00
BackgroundColor = Color.Gray.WithAlpha(0.35f), ContentMarginLeftOverride = 10,
ContentMarginTopOverride = 10
2019-03-05 09:39:12 +01:00
};
var vScrollBarGrabberHover = new StyleBoxFlat
{
2019-11-28 15:28:33 +02:00
BackgroundColor = new Color(140, 140, 140).WithAlpha(0.35f), ContentMarginLeftOverride = 10,
ContentMarginTopOverride = 10
2019-03-05 09:39:12 +01:00
};
var vScrollBarGrabberGrabbed = new StyleBoxFlat
{
2019-11-28 15:28:33 +02:00
BackgroundColor = new Color(160, 160, 160).WithAlpha(0.35f), ContentMarginLeftOverride = 10,
ContentMarginTopOverride = 10
2019-03-05 09:39:12 +01:00
};
var hScrollBarGrabberNormal = new StyleBoxFlat
{
2019-07-19 01:21:48 +02:00
BackgroundColor = Color.Gray.WithAlpha(0.35f), ContentMarginTopOverride = 10
2019-03-05 09:39:12 +01:00
};
var hScrollBarGrabberHover = new StyleBoxFlat
{
2019-07-19 01:21:48 +02:00
BackgroundColor = new Color(140, 140, 140).WithAlpha(0.35f), ContentMarginTopOverride = 10
2019-03-05 09:39:12 +01:00
};
var hScrollBarGrabberGrabbed = new StyleBoxFlat
{
2019-07-19 01:21:48 +02:00
BackgroundColor = new Color(160, 160, 160).WithAlpha(0.35f), ContentMarginTopOverride = 10
2019-03-05 09:39:12 +01:00
};
2019-03-11 09:07:56 +01:00
var progressBarBackground = new StyleBoxFlat
{
BackgroundColor = new Color(0.25f, 0.25f, 0.25f)
};
progressBarBackground.SetContentMarginOverride(StyleBox.Margin.Vertical, 5);
var progressBarForeground = new StyleBoxFlat
{
BackgroundColor = new Color(0.25f, 0.50f, 0.25f)
};
progressBarForeground.SetContentMarginOverride(StyleBox.Margin.Vertical, 5);
2019-03-11 11:55:29 +01:00
// CheckBox
var checkBoxTextureChecked = resCache.GetTexture("/Nano/checkbox_checked.svg.96dpi.png");
var checkBoxTextureUnchecked = resCache.GetTexture("/Nano/checkbox_unchecked.svg.96dpi.png");
// Tooltip box
var tooltipTexture = resCache.GetTexture("/Nano/tooltip.png");
var tooltipBox = new StyleBoxTexture
{
Texture = tooltipTexture,
};
tooltipBox.SetPatchMargin(StyleBox.Margin.All, 2);
tooltipBox.SetContentMarginOverride(StyleBox.Margin.Horizontal, 5);
// Placeholder
var placeholderTexture = resCache.GetTexture("/Nano/placeholder.png");
2019-10-15 13:12:48 +02:00
var placeholder = new StyleBoxTexture {Texture = placeholderTexture};
2019-10-18 14:28:24 +02:00
placeholder.SetPatchMargin(StyleBox.Margin.All, 19);
placeholder.SetExpandMargin(StyleBox.Margin.All, -5);
2019-10-18 14:28:24 +02:00
placeholder.Mode = StyleBoxTexture.StretchMode.Tile;
2019-05-14 12:54:47 +02:00
var itemListBackgroundSelected = new StyleBoxFlat {BackgroundColor = new Color(75, 75, 86)};
itemListBackgroundSelected.SetContentMarginOverride(StyleBox.Margin.Vertical, 2);
itemListBackgroundSelected.SetContentMarginOverride(StyleBox.Margin.Horizontal, 4);
var itemListItemBackgroundDisabled = new StyleBoxFlat {BackgroundColor = new Color(10, 10, 12)};
itemListItemBackgroundDisabled.SetContentMarginOverride(StyleBox.Margin.Vertical, 2);
itemListItemBackgroundDisabled.SetContentMarginOverride(StyleBox.Margin.Horizontal, 4);
var itemListItemBackground = new StyleBoxFlat {BackgroundColor = new Color(55, 55, 68)};
itemListItemBackground.SetContentMarginOverride(StyleBox.Margin.Vertical, 2);
itemListItemBackground.SetContentMarginOverride(StyleBox.Margin.Horizontal, 4);
2020-01-09 00:27:52 +01:00
var itemListItemBackgroundTransparent = new StyleBoxFlat {BackgroundColor = Color.Transparent};
itemListItemBackgroundTransparent.SetContentMarginOverride(StyleBox.Margin.Vertical, 2);
itemListItemBackgroundTransparent.SetContentMarginOverride(StyleBox.Margin.Horizontal, 4);
2019-05-14 12:54:47 +02:00
2019-10-18 14:28:24 +02:00
// NanoHeading
var nanoHeadingTex = resCache.GetTexture("/Nano/nanoheading.svg.96dpi.png");
var nanoHeadingBox = new StyleBoxTexture
{
Texture = nanoHeadingTex,
PatchMarginRight = 10,
PatchMarginTop = 10,
ContentMarginTopOverride = 2,
ContentMarginLeftOverride = 10,
PaddingTop = 4
};
nanoHeadingBox.SetPatchMargin(StyleBox.Margin.Left | StyleBox.Margin.Bottom, 2);
// Stripe background
var stripeBackTex = resCache.GetTexture("/Nano/stripeback.svg.96dpi.png");
var stripeBack = new StyleBoxTexture
{
Texture = stripeBackTex,
Mode = StyleBoxTexture.StretchMode.Tile
};
2020-01-15 14:27:47 +01:00
// Slider
var sliderOutlineTex = resCache.GetTexture("/Nano/slider_outline.svg.96dpi.png");
var sliderFillTex = resCache.GetTexture("/Nano/slider_fill.svg.96dpi.png");
var sliderGrabTex = resCache.GetTexture("/Nano/slider_grabber.svg.96dpi.png");
var sliderFillBox = new StyleBoxTexture
{
Texture = sliderFillTex,
Modulate = Color.FromHex("#3E6C45")
};
var sliderBackBox = new StyleBoxTexture
{
Texture = sliderFillTex,
Modulate = Color.FromHex("#1E1E22")
};
var sliderForeBox = new StyleBoxTexture
{
Texture = sliderOutlineTex,
Modulate = Color.FromHex("#494949")
};
var sliderGrabBox = new StyleBoxTexture
{
Texture = sliderGrabTex,
};
sliderFillBox.SetPatchMargin(StyleBox.Margin.All, 12);
sliderBackBox.SetPatchMargin(StyleBox.Margin.All, 12);
sliderForeBox.SetPatchMargin(StyleBox.Margin.All, 12);
sliderGrabBox.SetPatchMargin(StyleBox.Margin.All, 12);
var sliderFillGreen = new StyleBoxTexture(sliderFillBox) {Modulate = Color.Green};
var sliderFillRed = new StyleBoxTexture(sliderFillBox) {Modulate = Color.Red};
var sliderFillBlue = new StyleBoxTexture(sliderFillBox) {Modulate = Color.Blue};
2019-02-18 09:16:06 +01:00
Stylesheet = new Stylesheet(new[]
{
// Default font.
new StyleRule(
new SelectorElement(null, null, null, null),
new[]
{
2019-02-24 15:55:23 +01:00
new StyleProperty("font", notoSans12),
2019-02-18 09:16:06 +01:00
}),
// Window title.
new StyleRule(
new SelectorElement(typeof(Label), new[] {SS14Window.StyleClassWindowTitle}, null, null),
new[]
{
new StyleProperty(Label.StylePropertyFontColor, NanoGold),
2019-07-18 23:33:32 +02:00
new StyleProperty(Label.StylePropertyFont, notoSansDisplayBold14),
2019-02-18 09:16:06 +01:00
}),
// Window background.
new StyleRule(
new SelectorElement(null, new[] {SS14Window.StyleClassWindowPanel}, null, null),
new[]
{
new StyleProperty(PanelContainer.StylePropertyPanel, windowBackground),
2019-02-18 09:16:06 +01:00
}),
// Window header.
new StyleRule(
new SelectorElement(typeof(PanelContainer), new[] {SS14Window.StyleClassWindowHeader}, null, null),
2019-02-18 09:16:06 +01:00
new[]
{
new StyleProperty(PanelContainer.StylePropertyPanel, windowHeader),
2019-02-18 09:16:06 +01:00
}),
// Window close button base texture.
new StyleRule(
new SelectorElement(typeof(TextureButton), new[] {SS14Window.StyleClassWindowCloseButton}, null,
null),
new[]
{
new StyleProperty(TextureButton.StylePropertyTexture, textureCloseButton),
new StyleProperty(Control.StylePropertyModulateSelf, Color.FromHex("#4B596A")),
}),
// Window close button hover.
new StyleRule(
new SelectorElement(typeof(TextureButton), new[] {SS14Window.StyleClassWindowCloseButton}, null,
2019-10-15 13:12:48 +02:00
new[] {TextureButton.StylePseudoClassHover}),
2019-02-18 09:16:06 +01:00
new[]
{
new StyleProperty(Control.StylePropertyModulateSelf, Color.FromHex("#7F3636")),
}),
// Window close button pressed.
new StyleRule(
new SelectorElement(typeof(TextureButton), new[] {SS14Window.StyleClassWindowCloseButton}, null,
2019-10-15 13:12:48 +02:00
new[] {TextureButton.StylePseudoClassPressed}),
2019-02-18 09:16:06 +01:00
new[]
{
new StyleProperty(Control.StylePropertyModulateSelf, Color.FromHex("#753131")),
}),
// Regular buttons!
new StyleRule(
2019-10-15 13:12:48 +02:00
new SelectorElement(typeof(Button), null, null, new[] {Button.StylePseudoClassNormal}),
2019-02-18 09:16:06 +01:00
new[]
{
new StyleProperty(Button.StylePropertyStyleBox, buttonNormal),
}),
new StyleRule(
2019-10-15 13:12:48 +02:00
new SelectorElement(typeof(Button), null, null, new[] {Button.StylePseudoClassHover}),
2019-02-18 09:16:06 +01:00
new[]
{
new StyleProperty(Button.StylePropertyStyleBox, buttonHover),
}),
new StyleRule(
2019-10-15 13:12:48 +02:00
new SelectorElement(typeof(Button), null, null, new[] {Button.StylePseudoClassPressed}),
2019-02-18 09:16:06 +01:00
new[]
{
new StyleProperty(Button.StylePropertyStyleBox, buttonPressed),
}),
new StyleRule(
2019-10-15 13:12:48 +02:00
new SelectorElement(typeof(Button), null, null, new[] {Button.StylePseudoClassDisabled}),
2019-02-18 09:16:06 +01:00
new[]
{
new StyleProperty(Button.StylePropertyStyleBox, buttonDisabled),
new StyleProperty("font-color", Color.FromHex("#E5E5E581")),
}),
// Main menu: Make those buttons bigger.
new StyleRule(
new SelectorChild(
new SelectorElement(null, null, "mainMenuVBox", null),
new SelectorElement(typeof(Button), null, null, null)),
new[]
{
2019-04-01 15:53:50 +02:00
new StyleProperty("font", notoSansBold16),
2019-02-18 09:16:06 +01:00
}),
// Main menu: also make those buttons slightly more separated.
new StyleRule(new SelectorElement(typeof(BoxContainer), null, "mainMenuVBox", null),
new[]
{
new StyleProperty(BoxContainer.StylePropertySeparation, 2),
}),
2019-02-23 16:35:51 +01:00
// Fancy LineEdit
new StyleRule(new SelectorElement(typeof(LineEdit), null, null, null),
new[]
{
new StyleProperty(LineEdit.StylePropertyStyleBox, lineEdit),
}),
2019-03-05 09:39:12 +01:00
new StyleRule(
new SelectorElement(typeof(LineEdit), new[] {LineEdit.StyleClassLineEditNotEditable}, null, null),
new[]
{
new StyleProperty("font-color", new Color(192, 192, 192)),
}),
2019-10-15 13:12:48 +02:00
new StyleRule(
new SelectorElement(typeof(LineEdit), null, null, new[] {LineEdit.StylePseudoClassPlaceholder}),
2019-03-05 09:39:12 +01:00
new[]
{
new StyleProperty("font-color", Color.Gray),
}),
// TabContainer
new StyleRule(new SelectorElement(typeof(TabContainer), null, null, null),
new[]
{
new StyleProperty(TabContainer.StylePropertyPanelStyleBox, tabContainerPanel),
new StyleProperty(TabContainer.StylePropertyTabStyleBox, tabContainerBoxActive),
new StyleProperty(TabContainer.StylePropertyTabStyleBoxInactive, tabContainerBoxInactive),
}),
// Scroll bars
new StyleRule(new SelectorElement(typeof(VScrollBar), null, null, null),
new[]
{
new StyleProperty(ScrollBar.StylePropertyGrabber,
vScrollBarGrabberNormal),
}),
2019-10-15 13:12:48 +02:00
new StyleRule(
new SelectorElement(typeof(VScrollBar), null, null, new[] {ScrollBar.StylePseudoClassHover}),
2019-03-05 09:39:12 +01:00
new[]
{
new StyleProperty(ScrollBar.StylePropertyGrabber,
vScrollBarGrabberHover),
}),
2019-10-15 13:12:48 +02:00
new StyleRule(
new SelectorElement(typeof(VScrollBar), null, null, new[] {ScrollBar.StylePseudoClassGrabbed}),
2019-03-05 09:39:12 +01:00
new[]
{
new StyleProperty(ScrollBar.StylePropertyGrabber,
vScrollBarGrabberGrabbed),
}),
new StyleRule(new SelectorElement(typeof(HScrollBar), null, null, null),
new[]
{
new StyleProperty(ScrollBar.StylePropertyGrabber,
hScrollBarGrabberNormal),
}),
2019-10-15 13:12:48 +02:00
new StyleRule(
new SelectorElement(typeof(HScrollBar), null, null, new[] {ScrollBar.StylePseudoClassHover}),
2019-03-05 09:39:12 +01:00
new[]
{
new StyleProperty(ScrollBar.StylePropertyGrabber,
hScrollBarGrabberHover),
}),
2019-10-15 13:12:48 +02:00
new StyleRule(
new SelectorElement(typeof(HScrollBar), null, null, new[] {ScrollBar.StylePseudoClassGrabbed}),
2019-03-05 09:39:12 +01:00
new[]
{
new StyleProperty(ScrollBar.StylePropertyGrabber,
hScrollBarGrabberGrabbed),
}),
2019-03-11 09:07:56 +01:00
// ProgressBar
new StyleRule(new SelectorElement(typeof(ProgressBar), null, null, null),
new[]
{
new StyleProperty(ProgressBar.StylePropertyBackground, progressBarBackground),
2019-03-11 09:07:56 +01:00
new StyleProperty(ProgressBar.StylePropertyForeground, progressBarForeground)
}),
2019-03-11 11:55:29 +01:00
// CheckBox
new StyleRule(new SelectorElement(typeof(CheckBox), null, null, null), new[]
2019-03-11 11:55:29 +01:00
{
new StyleProperty(CheckBox.StylePropertyIcon, checkBoxTextureUnchecked),
}),
2019-10-15 13:12:48 +02:00
new StyleRule(new SelectorElement(typeof(CheckBox), null, null, new[] {Button.StylePseudoClassPressed}),
new[]
{
new StyleProperty(CheckBox.StylePropertyIcon, checkBoxTextureChecked),
}),
2019-03-11 11:55:29 +01:00
new StyleRule(new SelectorElement(typeof(CheckBox), null, null, null), new[]
2019-03-11 11:55:29 +01:00
{
new StyleProperty(CheckBox.StylePropertyHSeparation, 3),
}),
2019-04-01 20:05:45 +02:00
// Tooltip
new StyleRule(new SelectorElement(typeof(Tooltip), null, null, null), new[]
2019-04-01 20:05:45 +02:00
{
new StyleProperty(PanelContainer.StylePropertyPanel, tooltipBox)
}),
2019-10-15 13:12:48 +02:00
new StyleRule(new SelectorElement(typeof(PanelContainer), new[] {"tooltipBox"}, null, null), new[]
2019-07-30 23:13:05 +02:00
{
new StyleProperty(PanelContainer.StylePropertyPanel, tooltipBox)
}),
// Entity tooltip
new StyleRule(
new SelectorElement(typeof(PanelContainer), new[] {ExamineSystem.StyleClassEntityTooltip}, null,
null), new[]
{
new StyleProperty(PanelContainer.StylePropertyPanel, tooltipBox)
}),
2019-04-06 17:07:43 +02:00
// ItemList
new StyleRule(new SelectorElement(typeof(ItemList), null, null, null), new[]
2019-04-06 17:07:43 +02:00
{
new StyleProperty(ItemList.StylePropertyBackground,
new StyleBoxFlat {BackgroundColor = new Color(32, 32, 40)}),
new StyleProperty(ItemList.StylePropertyItemBackground,
2019-05-14 12:54:47 +02:00
itemListItemBackground),
new StyleProperty(ItemList.StylePropertyDisabledItemBackground,
2019-05-14 12:54:47 +02:00
itemListItemBackgroundDisabled),
new StyleProperty(ItemList.StylePropertySelectedItemBackground,
2019-05-14 12:54:47 +02:00
itemListBackgroundSelected)
2019-04-06 17:07:43 +02:00
}),
2020-01-09 00:27:52 +01:00
new StyleRule(new SelectorElement(typeof(ItemList), new[] {"transparentItemList"}, null, null), new[]
{
new StyleProperty(ItemList.StylePropertyBackground,
new StyleBoxFlat {BackgroundColor = Color.Transparent}),
new StyleProperty(ItemList.StylePropertyItemBackground,
itemListItemBackgroundTransparent),
new StyleProperty(ItemList.StylePropertyDisabledItemBackground,
itemListItemBackgroundDisabled),
new StyleProperty(ItemList.StylePropertySelectedItemBackground,
itemListBackgroundSelected)
}),
// Tree
new StyleRule(new SelectorElement(typeof(Tree), null, null, null), new[]
{
new StyleProperty(Tree.StylePropertyBackground,
new StyleBoxFlat {BackgroundColor = new Color(32, 32, 40)}),
new StyleProperty(Tree.StylePropertyItemBoxSelected, new StyleBoxFlat
{
BackgroundColor = new Color(55, 55, 68),
ContentMarginLeftOverride = 4
})
}),
// Placeholder
2019-10-15 13:12:48 +02:00
new StyleRule(new SelectorElement(typeof(Placeholder), null, null, null), new[]
{
new StyleProperty(PanelContainer.StylePropertyPanel, placeholder),
}),
2019-10-15 13:12:48 +02:00
new StyleRule(
new SelectorElement(typeof(Label), new[] {Placeholder.StyleClassPlaceholderText}, null, null), new[]
{
new StyleProperty(Label.StylePropertyFont, notoSans16),
new StyleProperty(Label.StylePropertyFontColor, new Color(103, 103, 103, 128)),
}),
// Big Label
2019-10-15 13:12:48 +02:00
new StyleRule(new SelectorElement(typeof(Label), new[] {StyleClassLabelHeading}, null, null), new[]
{
new StyleProperty(Label.StylePropertyFont, notoSansBold16),
new StyleProperty(Label.StylePropertyFontColor, NanoGold),
2019-10-15 13:12:48 +02:00
}),
2019-10-18 14:28:24 +02:00
// Bigger Label
2020-01-09 00:27:52 +01:00
new StyleRule(new SelectorElement(typeof(Label), new[] {StyleClassLabelHeadingBigger}, null, null),
new[]
{
new StyleProperty(Label.StylePropertyFont, notoSansBold20),
new StyleProperty(Label.StylePropertyFontColor, NanoGold),
}),
2019-10-18 14:28:24 +02:00
2019-07-20 14:06:54 +02:00
// Small Label
2019-10-15 13:12:48 +02:00
new StyleRule(new SelectorElement(typeof(Label), new[] {StyleClassLabelSubText}, null, null), new[]
2019-07-20 14:06:54 +02:00
{
new StyleProperty(Label.StylePropertyFont, notoSans10),
new StyleProperty(Label.StylePropertyFontColor, Color.DarkGray),
2019-10-15 13:12:48 +02:00
}),
2019-07-20 14:06:54 +02:00
// Label Key
2020-01-09 00:27:52 +01:00
new StyleRule(new SelectorElement(typeof(Label), new[] {StyleClassLabelKeyText}, null, null), new[]
{
new StyleProperty(Label.StylePropertyFont, notoSansBold12),
new StyleProperty(Label.StylePropertyFontColor, NanoGold)
}),
2020-01-09 00:27:52 +01:00
new StyleRule(new SelectorElement(typeof(Label), new[] {StyleClassLabelSecondaryColor}, null, null),
new[]
{
new StyleProperty(Label.StylePropertyFont, notoSans12),
new StyleProperty(Label.StylePropertyFontColor, Color.DarkGray),
}),
Reagent dispensers (#360) * Expose more private values of Solution and SolutionComponent Expose SolutionComponent.ContainedSolution and Solution.Contents. Both needed by ReagentDispenserComponent. * Implement IExamine for SolutionComponent Allows players to see the contents of a solution by examining the entity which contains it. * Implement ReagentDispenserComponent Adds ReagentDispenserComponent. A component which can add or remove reagents from a solution container. It's written in a general way so that it can be used for things such as the Chemical dispensers in chemistry, but also the booze and soda dispensers in the bar. The chemicals it may dispense are defined in yaml, similar to the way that vending machines define which entities they can dispense, by defining a reagent pack. * Add chemical dispenser and equipment Adds the chemical dispenser, beaker, large beaker, dropper, and a few more chemicals. * Add booze and soda dispensers. Adds the booze and soda dispensers, and a few chemicals for them to dispense. There's no drink mixing or drunkenness yet. * Update engine submodule. * Remove unneeded and commented out code Had a few WIP notes and debug code bits I forgot to remove beforehand. * Make SolutionComponent._containedSolution and it's values private again - Remove `SolutionComponent.ContainedSolution` property, replace with specific access functions to maintain safety. - Make Solution.Contents return a `ReadOnlyCollection` instead of `_contents` to prevent uncontrolled access to the Solution values. - Add `SolutionComponent.RemoveAllSolution()` * Update Content.Shared/Chemistry/Solution.cs Commits a suggestion from RemieRichards to match the coding style of the rest of the codebase. Using `IReadOnlyList` instead of `IReadOnlyCollection`. Co-Authored-By: Remie Richards <remierichards@gmail.com> * Update Content.Shared/GameObjects/Components/Chemistry/SolutionComponent.cs Commits a suggestion from RemieRichards to match the coding style of the rest of the codebase. Using `IReadOnlyList` instead of `IReadOnlyCollection`. Co-Authored-By: Remie Richards <remierichards@gmail.com> * Add import for IReadOnlyList to Shared/SolutionComponent.cs * Add documentation * Improve localization Improve use of ILocalizationManager. * Resolve ReagentDispenserWindow._localizationManager before using it Forgot to do this in the last commit, resulting in a crash. Oops. * Add SolutionCaps.FitsInDispenser. Use in ReagentDispenserComponent. Used to limit large containers like buckets or mop buckets from being placed in a dispenser. Both have large capacities (500) and weren't designed to hold certain chemicals like a beaker is, so for now they can be blocked from being put in a dispenser by giving them that flag. * Add colors to new reagents * Update engine submodule
2019-10-05 09:10:05 -04:00
// Big Button
2019-10-15 13:12:48 +02:00
new StyleRule(new SelectorElement(typeof(Button), new[] {StyleClassButtonBig}, null, null), new[]
{
new StyleProperty("font", notoSans16)
}),
//APC and SMES power state label colors
2019-10-15 13:12:48 +02:00
new StyleRule(new SelectorElement(typeof(Label), new[] {StyleClassPowerStateNone}, null, null), new[]
{
new StyleProperty(Label.StylePropertyFontColor, new Color(0.8f, 0.0f, 0.0f))
}),
2019-10-15 13:12:48 +02:00
new StyleRule(new SelectorElement(typeof(Label), new[] {StyleClassPowerStateLow}, null, null), new[]
{
new StyleProperty(Label.StylePropertyFontColor, new Color(0.9f, 0.36f, 0.0f))
}),
2019-10-15 13:12:48 +02:00
new StyleRule(new SelectorElement(typeof(Label), new[] {StyleClassPowerStateGood}, null, null), new[]
{
new StyleProperty(Label.StylePropertyFontColor, new Color(0.024f, 0.8f, 0.0f))
}),
2019-07-17 16:38:08 +02:00
// Those top menu buttons.
new StyleRule(
2019-10-15 13:12:48 +02:00
new SelectorElement(typeof(GameHud.TopButton), null, null, new[] {Button.StylePseudoClassNormal}),
new[]
{
new StyleProperty(Button.StylePropertyStyleBox, buttonNormal),
}),
2019-07-17 16:38:08 +02:00
new StyleRule(
2019-10-15 13:12:48 +02:00
new SelectorElement(typeof(GameHud.TopButton), null, null, new[] {Button.StylePseudoClassPressed}),
new[]
{
new StyleProperty(Button.StylePropertyStyleBox, buttonPressed),
}),
2019-07-17 16:38:08 +02:00
new StyleRule(
2019-10-15 13:12:48 +02:00
new SelectorElement(typeof(GameHud.TopButton), null, null, new[] {Button.StylePseudoClassHover}),
new[]
{
new StyleProperty(Button.StylePropertyStyleBox, buttonHover),
}),
2019-07-18 23:33:32 +02:00
new StyleRule(
2019-10-15 13:12:48 +02:00
new SelectorElement(typeof(Label), new[] {GameHud.TopButton.StyleClassLabelTopButton}, null, null),
new[]
{
new StyleProperty(Label.StylePropertyFont, notoSansDisplayBold14),
}),
// Targeting doll
2019-10-15 13:12:48 +02:00
new StyleRule(
new SelectorElement(typeof(TextureButton), new[] {TargetingDoll.StyleClassTargetDollZone}, null,
new[] {TextureButton.StylePseudoClassNormal}), new[]
{
2019-10-22 23:16:12 +02:00
new StyleProperty(Control.StylePropertyModulateSelf, ButtonColorDefault),
2019-10-15 13:12:48 +02:00
}),
2019-10-15 13:12:48 +02:00
new StyleRule(
new SelectorElement(typeof(TextureButton), new[] {TargetingDoll.StyleClassTargetDollZone}, null,
new[] {TextureButton.StylePseudoClassHover}), new[]
{
2019-10-22 23:16:12 +02:00
new StyleProperty(Control.StylePropertyModulateSelf, ButtonColorHovered),
2019-10-15 13:12:48 +02:00
}),
2019-10-15 13:12:48 +02:00
new StyleRule(
new SelectorElement(typeof(TextureButton), new[] {TargetingDoll.StyleClassTargetDollZone}, null,
new[] {TextureButton.StylePseudoClassPressed}), new[]
{
2019-10-22 23:16:12 +02:00
new StyleProperty(Control.StylePropertyModulateSelf, ButtonColorPressed),
2019-10-15 13:12:48 +02:00
}),
2019-10-18 14:28:24 +02:00
// NanoHeading
new StyleRule(
new SelectorChild(
SelectorElement.Type(typeof(NanoHeading)),
SelectorElement.Type(typeof(PanelContainer))),
new[]
{
new StyleProperty(PanelContainer.StylePropertyPanel, nanoHeadingBox),
}),
// StripeBack
new StyleRule(
SelectorElement.Type(typeof(StripeBack)),
2020-01-09 00:27:52 +01:00
new[]
2019-10-18 14:28:24 +02:00
{
new StyleProperty(StripeBack.StylePropertyBackground, stripeBack),
}),
// StyleClassLabelBig
new StyleRule(
SelectorElement.Class(StyleClassLabelBig),
2020-01-09 00:27:52 +01:00
new[]
2019-10-18 14:28:24 +02:00
{
new StyleProperty("font", notoSans16),
}),
2020-01-09 00:27:52 +01:00
// StyleClassItemStatus
new StyleRule(SelectorElement.Class(StyleClassItemStatus), new[]
{
new StyleProperty("font", notoSans10),
}),
2020-01-15 14:27:47 +01:00
// Slider
new StyleRule(SelectorElement.Type(typeof(Slider)), new []
{
new StyleProperty(Slider.StylePropertyBackground, sliderBackBox),
new StyleProperty(Slider.StylePropertyForeground, sliderForeBox),
new StyleProperty(Slider.StylePropertyGrabber, sliderGrabBox),
new StyleProperty(Slider.StylePropertyFill, sliderFillBox),
}),
new StyleRule(new SelectorElement(typeof(Slider), new []{StyleClassSliderRed}, null, null), new []
{
new StyleProperty(Slider.StylePropertyFill, sliderFillRed),
}),
new StyleRule(new SelectorElement(typeof(Slider), new []{StyleClassSliderGreen}, null, null), new []
{
new StyleProperty(Slider.StylePropertyFill, sliderFillGreen),
}),
new StyleRule(new SelectorElement(typeof(Slider), new []{StyleClassSliderBlue}, null, null), new []
{
new StyleProperty(Slider.StylePropertyFill, sliderFillBlue),
})
2019-02-18 09:16:06 +01:00
});
}
}
}