public BorderedCheckBox(HudParentBase parent) : base(parent) { border = new BorderBox(this) { Thickness = 1f, DimAlignment = DimAlignments.Both, }; tickBox = new TexturedBox() { DimAlignment = DimAlignments.Both, Padding = new Vector2(17f), }; tickBox.Register(this, true); Size = new Vector2(37f); Color = TerminalFormatting.OuterSpace; HighlightColor = TerminalFormatting.Atomic; FocusColor = TerminalFormatting.Mint; TickBoxColor = TerminalFormatting.StormGrey; TickBoxHighlightColor = Color.White; TickBoxFocusColor = TerminalFormatting.Cinder; BorderColor = TerminalFormatting.LimedSpruce; UseFocusFormatting = true; MouseInput.LeftClicked += ToggleValue; MouseInput.GainedInputFocus += GainFocus; MouseInput.LostInputFocus += LoseFocus; }
public SliderBar(HudParentBase parent) : base(parent) { bar = new TexturedBox(this); slider = new TexturedBox(bar) { UseCursor = true, ShareCursor = true }; mouseInput = new MouseInputElement(this) { DimAlignment = DimAlignments.Both }; _barSize = new Vector2(100f, 12f); _sliderSize = new Vector2(6f, 12f); SliderVisible = true; bar.Size = _barSize; slider.Size = _sliderSize; SliderColor = new Color(180, 180, 180, 255); BarColor = new Color(140, 140, 140, 255); SliderHighlight = new Color(200, 200, 200, 255); EnableHighlight = true; _min = 0f; _max = 1f; Current = 0f; Percent = 0f; }
protected override void Init() { ScrollBar = new ScrollBar(this); Divider = new TexturedBox(ScrollBar) { Color = new Color(53, 66, 75) }; }
public LabelBoxBase(HudParentBase parent) : base(parent) { background = new TexturedBox(this) { DimAlignment = DimAlignments.Both | DimAlignments.IgnorePadding, }; FitToTextElement = true; Color = Color.Gray; }
public WindowBase(HudParentBase parent) : base(parent) { header = new LabelBoxButton(this) { DimAlignment = DimAlignments.Width, Height = 32f, ParentAlignment = ParentAlignments.Top | ParentAlignments.Inner, ZOffset = 1, Format = GlyphFormat.White.WithAlignment(TextAlignment.Center), HighlightEnabled = false, AutoResize = false, }; body = new EmptyHudElement(header) { DimAlignment = DimAlignments.Width, ParentAlignment = ParentAlignments.Bottom, }; bodyBg = new TexturedBox(body) { DimAlignment = DimAlignments.Both | DimAlignments.IgnorePadding, ZOffset = -2, }; border = new BorderBox(this) { ZOffset = 1, Thickness = 1f, DimAlignment = DimAlignments.Both, }; resizeInput = new MouseInputElement(this) { ZOffset = sbyte.MaxValue, Padding = new Vector2(16f), DimAlignment = DimAlignments.Both, CanIgnoreMasking = true }; inputInner = new MouseInputElement(resizeInput) { DimAlignment = DimAlignments.Both | DimAlignments.IgnorePadding, }; AllowResizing = true; CanDrag = true; UseCursor = true; ShareCursor = false; IsMasking = true; MinimumSize = new Vector2(200f, 200f); LoseFocusCallback = LoseFocus; GetFocus(); }
public DropdownDisplay(HudParentBase parent = null) : base(parent) { border = new BorderBox(this) { Thickness = 1f, DimAlignment = DimAlignments.Both | DimAlignments.IgnorePadding, }; name = new Label() { AutoResize = false, Padding = new Vector2(10f, 0f) }; divider = new TexturedBox() { Padding = new Vector2(4f, 17f), Width = 2f, Color = new Color(104, 113, 120), }; arrow = new TexturedBox() { Width = 38f, MatAlignment = MaterialAlignment.FitVertical, Material = arrowMat, }; layout = new HudChain(false, this) { SizingMode = HudChainSizingModes.FitMembersOffAxis | HudChainSizingModes.FitChainBoth, DimAlignment = DimAlignments.Height | DimAlignments.IgnorePadding, CollectionContainer = { name, divider, arrow } }; Format = TerminalFormatting.ControlFormat; FocusTextColor = TerminalFormatting.Charcoal; Color = TerminalFormatting.OuterSpace; HighlightColor = TerminalFormatting.Atomic; FocusColor = TerminalFormatting.Mint; BorderColor = TerminalFormatting.LimedSpruce; HighlightEnabled = true; UseFocusFormatting = true; _mouseInput.GainedInputFocus += GainFocus; _mouseInput.LostInputFocus += LoseFocus; }
public ScrollBox(bool alignVertical, HudParentBase parent = null) : base(alignVertical, parent) { Background = new TexturedBox(this) { Color = TerminalFormatting.DarkSlateGrey, DimAlignment = DimAlignments.Both, ZOffset = -1, }; MinVisibleCount = 1; UseCursor = true; ShareCursor = false; EnableScrolling = true; UseSmoothScrolling = true; ZOffset = 1; }
public SliderBox(HudParentBase parent) : base(parent) { background = new TexturedBox(this) { DimAlignment = DimAlignments.Both }; border = new BorderBox(background) { Thickness = 1f, DimAlignment = DimAlignments.Both, }; slide = new SliderBar(this) { DimAlignment = DimAlignments.Both, SliderSize = new Vector2(14f, 28f), BarHeight = 5f }; BackgroundColor = TerminalFormatting.OuterSpace; BorderColor = TerminalFormatting.LimedSpruce; BackgroundHighlight = TerminalFormatting.Atomic; BackgroundFocusColor = TerminalFormatting.Mint; SliderColor = TerminalFormatting.MistBlue; SliderHighlight = Color.White; SliderFocusColor = TerminalFormatting.Cinder; BarColor = TerminalFormatting.MidGrey; BarHighlight = Color.White; BarFocusColor = TerminalFormatting.BlackPerl; UseFocusFormatting = true; HighlightEnabled = true; Padding = new Vector2(18f, 18f); Size = new Vector2(317f, 47f); slide.MouseInput.CursorEntered += CursorEnter; slide.MouseInput.CursorExited += CursorExit; slide.MouseInput.GainedInputFocus += GainFocus; slide.MouseInput.LostInputFocus += LoseFocus; }
public TreeBoxDisplay(HudParentBase parent = null) : base(parent) { background = new TexturedBox(this) { Color = TerminalFormatting.EbonyClay, DimAlignment = DimAlignments.Both, }; name = new Label() { AutoResize = false, Padding = new Vector2(10f, 0f), Format = GlyphFormat.Blueish.WithSize(1.1f), }; divider = new TexturedBox() { Padding = new Vector2(2f, 6f), Size = new Vector2(2f, 39f), Color = new Color(104, 113, 120), }; arrow = new TexturedBox() { Width = 20f, Padding = new Vector2(8f, 0f), MatAlignment = MaterialAlignment.FitHorizontal, Color = new Color(227, 230, 233), Material = rightArrow, }; layout = new HudChain(false, this) { SizingMode = HudChainSizingModes.FitMembersOffAxis | HudChainSizingModes.FitChainBoth, DimAlignment = DimAlignments.Height | DimAlignments.IgnorePadding, CollectionContainer = { arrow, divider, name } }; mouseInput = new MouseInputElement(this) { DimAlignment = DimAlignments.Both }; }
public ColorPickerHSV(HudParentBase parent) : base(parent) { // Header name = new Label() { Format = GlyphFormat.Blueish.WithSize(1.08f), Text = "NewColorPicker", AutoResize = false, Size = new Vector2(88f, 22f) }; display = new TexturedBox() { Width = 231f, Color = VRageMath.Color.Black }; var dispBorder = new BorderBox(display) { Color = VRageMath.Color.White, Thickness = 1f, DimAlignment = DimAlignments.Both, }; headerChain = new HudChain(false) { SizingMode = HudChainSizingModes.FitMembersOffAxis | HudChainSizingModes.FitChainBoth, Height = 22f, Spacing = 0f, CollectionContainer = { name, display } }; // Color picker sliderText = new Label[] { new Label() { AutoResize = false, Format = TerminalFormatting.ControlFormat, Height = 47f }, new Label() { AutoResize = false, Format = TerminalFormatting.ControlFormat, Height = 47f }, new Label() { AutoResize = false, Format = TerminalFormatting.ControlFormat, Height = 47f } }; colorNameColumn = new HudChain <HudElementContainer <Label>, Label>(true) { SizingMode = HudChainSizingModes.FitMembersBoth | HudChainSizingModes.FitChainBoth, Width = 87f, Spacing = 5f, CollectionContainer = { sliderText[0], sliderText[1], sliderText[2] } }; sliders = new SliderBox[] { new SliderBox() { Min = 0f, Max = 360f, Height = 47f }, new SliderBox() { Min = 0f, Max = 100f, Height = 47f }, new SliderBox() { Min = 0f, Max = 100f, Height = 47f } }; colorSliderColumn = new HudChain <HudElementContainer <SliderBox>, SliderBox>(true) { SizingMode = HudChainSizingModes.FitMembersBoth | HudChainSizingModes.FitChainBoth, Width = 231f, Spacing = 5f, CollectionContainer = { sliders[0], sliders[1], sliders[2] } }; colorChain = new HudChain(false) { SizingMode = HudChainSizingModes.FitChainBoth, CollectionContainer = { colorNameColumn, colorSliderColumn, } }; mainChain = new HudChain(true, this) { SizingMode = HudChainSizingModes.FitChainBoth, Spacing = 5f, CollectionContainer = { headerChain, colorChain, } }; Size = new Vector2(318f, 163f); valueBuilder = new StringBuilder(); UseCursor = true; ShareCursor = true; focusedChannel = -1; }
public OnOffButton(HudParentBase parent) : base(parent) { mouseInput = new MouseInputElement(this); background = new TexturedBox(this) { DimAlignment = DimAlignments.Both | DimAlignments.IgnorePadding, }; bgBorder = new BorderBox(background) { DimAlignment = DimAlignments.Both | DimAlignments.IgnorePadding, }; on = new LabelBox() { AutoResize = false, Size = new Vector2(71f, 49f), Format = TerminalFormatting.ControlFormat.WithAlignment(TextAlignment.Center), Text = "On" }; onBorder = new BorderBox(on) { Thickness = 2f, DimAlignment = DimAlignments.Both | DimAlignments.IgnorePadding, }; off = new LabelBox() { AutoResize = false, Size = new Vector2(71f, 49f), Format = TerminalFormatting.ControlFormat.WithAlignment(TextAlignment.Center), Text = "Off" }; offBorder = new BorderBox(off) { Thickness = 2f, DimAlignment = DimAlignments.Both | DimAlignments.IgnorePadding, }; buttonChain = new HudChain(false, bgBorder) { SizingMode = HudChainSizingModes.FitMembersBoth | HudChainSizingModes.FitChainBoth, Padding = new Vector2(12f, 10f), Spacing = 9f, CollectionContainer = { on, off } }; Size = new Vector2(166f, 58f); BackgroundColor = TerminalFormatting.Cinder.SetAlphaPct(0.8f); HighlightColor = TerminalFormatting.Atomic; FocusColor = TerminalFormatting.Mint; BorderColor = TerminalFormatting.LimedSpruce; UnselectedColor = TerminalFormatting.OuterSpace; SelectionColor = TerminalFormatting.DullMint; HighlightEnabled = true; UseFocusFormatting = true; mouseInput.LeftClicked += LeftClick; }