s&box Package Code Search
Search C# source code, UI razor templates, shaders, and configs across s&box packages.
link Raw Facepunch API Link: https://public.facepunch.com/sbox/code/search/1/?ident=xaz.gooui&take=20
Showing code results for query:
*
(95 total matches found)
Game
library
using System;
using Sandbox;
namespace Goo.Animation;
public record struct SmoothVector2
{
public Vector2 Current;
public Vector2 Target;
public Vector2 Velocity;
public float SmoothTime;
public SmoothVector2(Vector2 initial, float smoothTime)
{
Current = initial;
Target = initial;
Velocity = default;
SmoothTime = smoothTime;
}
public void Update(float dt)
{
float vx = Velocity.x, vy = Velocity.y;
Current = new Vector2(
MathX.SmoothDamp(Current.x, Target.x, ref vx, SmoothTime, dt),
MathX.SmoothDamp(Current.y, Target.y, ref vy, SmoothTime, dt));
Velocity = new Vector2(vx, vy);
}
public bool IsSettled =>
MathF.Abs(Target.x - Current.x) < 0.0001f &&
MathF.Abs(Target.y - Current.y) < 0.0001f &&
MathF.Abs(Velocity.x) < 0.0001f &&
MathF.Abs(Velocity.y) < 0.0001f;
/// <summary>Advances by dt and returns true while still moving; chain calls with | (not ||) so every damper advances each frame.</summary>
public bool Tick(float dt) { Update(dt); return !IsSettled; }
}
Game
library
using System;
namespace Goo.Animation;
public readonly record struct Tween
{
public Sandbox.Utility.Easing.Function Easing { get; init; }
public float Duration { get; init; }
public float Delay { get; init; }
public float SpeedScale { get; init; }
public int Iterations { get; init; }
public bool PingPong { get; init; }
public bool Reversed { get; init; }
public Tween(Sandbox.Utility.Easing.Function easing, float duration, float delay = 0f)
{
Easing = easing;
Duration = duration;
Delay = delay;
SpeedScale = 1f;
Iterations = 1;
PingPong = false;
Reversed = false;
}
/// <summary>
/// Bridge a designer-authored Sandbox.Curve (authored over [0, 1]) into a Tween.
/// Allocates one delegate per call; cache the result in a static readonly field.
/// </summary>
public static Tween FromCurve(Sandbox.Curve curve, float duration, float delay = 0f)
=> new Tween(curve.Evaluate, duration, delay);
public float Eval(float elapsedSec)
{
if (Duration <= 0f) return Reversed ? 0f : 1f;
float t = (elapsedSec - Delay) * SpeedScale;
if (t <= 0f) return Reversed ? 1f : 0f;
float cycleDuration = PingPong ? 2f * Duration : Duration;
if (Iterations > 0 && t >= cycleDuration * Iterations)
{
float endLocal = PingPong ? 0f : 1f;
if (Reversed) endLocal = 1f - endLocal;
return Easing(endLocal);
}
float cycleT = t % cycleDuration;
float local = PingPong
? (cycleT < Duration ? cycleT / Duration : 1f - (cycleT - Duration) / Duration)
: cycleT / Duration;
if (Reversed) local = 1f - local;
return Easing(local);
}
}
public static class TweenExtensions
{
public static Tween Loop(this Tween t) => t with { Iterations = -1 };
public static Tween Times(this Tween t, int n) => t with { Iterations = n };
public static Tween PingPong(this Tween t) => t with { PingPong = true };
public static Tween Scale(this Tween t, float speed) => t with { SpeedScale = speed };
public static Tween WithDelay(this Tween t, float s) => t with { Delay = s };
public static Tween Reverse(this Tween t) => t with { Reversed = true };
}
Game
library
using System;
using System.Collections;
namespace Goo;
public sealed class Children : IEnumerable
{
internal FrameList? _list;
internal int _buildId;
internal Children() { }
internal int Count { get { EnsureValid(); return _list!.Count; } }
internal ref Frame this[int i] { get { EnsureValid(); return ref _list![i]; } }
public void Add<T>(in T child) where T : struct, IBlob
{
EnsureValid();
ref Frame slot = ref _list!.Reserve();
child.WriteTo(ref slot);
}
void EnsureValid()
{
var ctx = BuildContext._current;
if (ctx == null || _list == null || _buildId != ctx._currentBuildId)
throw new InvalidOperationException(
"Container reused across rebuilds. The same Container instance cannot survive " +
"past the Build() it was created in. Build a new one inside Build(), or extract " +
"a helper function that returns a fresh Container each call.");
}
// IEnumerable is required by C# collection-initializer syntax; iteration is not a
// use case for Children, so this returns an empty enumerator.
IEnumerator IEnumerable.GetEnumerator() => Array.Empty<object>().GetEnumerator();
}
Game
library
namespace Goo;
/// <summary>Compile-time constraint for blob struct types. Never use as storage, return, or parameter type (boxes the struct, destroys per-Rebuild allocation profile); only valid in where T : struct, IBlob.</summary>
public interface IBlob
{
static abstract BlobKind Kind { get; }
string? Key { get; }
internal void WriteTo(ref Frame frame);
}
/// <summary>Returns the single root Blob for a GooView build. A named delegate rather than
/// Func<IBlob> because IBlob has a static-abstract member (Kind) and C# bars such interfaces
/// as generic type arguments (CS8920). Consequence for Razor markup: a bare method group cannot
/// bind (its natural type is the illegal Func<IBlob>), so write
/// <c>Build=@(new BlobBuilder(MyBuild))</c>. See docs/site/docs/gotchas.md.</summary>
public delegate IBlob BlobBuilder();
Game
library
// <auto-generated />
// Generated by tools/StyleFacadeEmit. Do not edit by hand.
// Source of truth: tools/StyleFacadeEmit/style-manifest.json
using Sandbox;
using Sandbox.Rendering;
using Sandbox.UI;
namespace Goo;
public readonly partial record struct Text
{
public Length? Width { init => _style = StyleAccumulator.Add(_style, StyleField.Width, value); }
public Length? Height { init => _style = StyleAccumulator.Add(_style, StyleField.Height, value); }
public Length? Margin { init => _style = StyleAccumulator.Add(_style, StyleField.Margin, value); }
public Length? MarginLeft { init => _style = StyleAccumulator.Add(_style, StyleField.MarginLeft, value); }
public Length? MarginTop { init => _style = StyleAccumulator.Add(_style, StyleField.MarginTop, value); }
public Length? MarginRight { init => _style = StyleAccumulator.Add(_style, StyleField.MarginRight, value); }
public Length? MarginBottom { init => _style = StyleAccumulator.Add(_style, StyleField.MarginBottom, value); }
public Color? BackgroundColor { init => _style = StyleAccumulator.Add(_style, StyleField.BackgroundColor, value, StyleValue.FromColor); }
public Color? BackgroundTint { init => _style = StyleAccumulator.Add(_style, StyleField.BackgroundTint, value, StyleValue.FromColor); }
public Length? FlexBasis { init => _style = StyleAccumulator.Add(_style, StyleField.FlexBasis, value); }
public float? FlexGrow { init => _style = StyleAccumulator.Add(_style, StyleField.FlexGrow, value); }
public float? FlexShrink { init => _style = StyleAccumulator.Add(_style, StyleField.FlexShrink, value); }
public Color? FontColor { init => _style = StyleAccumulator.Add(_style, StyleField.FontColor, value, StyleValue.FromColor); }
public string? FontFamily { init => _style = StyleAccumulator.Add(_style, StyleField.FontFamily, value); }
public Length? FontSize { init => _style = StyleAccumulator.Add(_style, StyleField.FontSize, value); }
public FontSmooth? FontSmooth { init => _style = StyleAccumulator.Add(_style, StyleField.FontSmooth, value, StyleValue.FromFontSmooth); }
public FontStyle? FontStyle { init => _style = StyleAccumulator.Add(_style, StyleField.FontStyle, value, StyleValue.FromFontStyle); }
public FontVariantNumeric? FontVariantNumeric { init => _style = StyleAccumulator.Add(_style, StyleField.FontVariantNumeric, value, StyleValue.FromFontVariantNumeric); }
public int? FontWeight { init => _style = StyleAccumulator.Add(_style, StyleField.FontWeight, value); }
public Length? LetterSpacing { init => _style = StyleAccumulator.Add(_style, StyleField.LetterSpacing, value); }
public Length? LineHeight { init => _style = StyleAccumulator.Add(_style, StyleField.LineHeight, value); }
public Length? MaxHeight { init => _style = StyleAccumulator.Add(_style, StyleField.MaxHeight, value); }
public Length? MaxWidth { init => _style = StyleAccumulator.Add(_style, StyleField.MaxWidth, value); }
public Length? MinHeight { init => _style = StyleAccumulator.Add(_style, StyleField.MinHeight, value); }
public Length? MinWidth { init => _style = StyleAccumulator.Add(_style, StyleField.MinWidth, value); }
public float? Opacity { init => _style = StyleAccumulator.Add(_style, StyleField.Opacity, value); }
public TextAlign? TextAlign { init => _style = StyleAccumulator.Add(_style, StyleField.TextAlign, value, StyleValue.FromTextAlign); }
public Length? TextBackgroundAngle { init => _style = StyleAccumulator.Add(_style, StyleField.TextBackgroundAngle, value); }
public Color? TextDecorationColor { init => _style = StyleAccumulator.Add(_style, StyleField.TextDecorationColor, value, StyleValue.FromColor); }
public TextDecoration? TextDecorationLine { init => _style = StyleAccumulator.Add(_style, StyleField.TextDecorationLine, value, StyleValue.FromTextDecoration); }
public TextSkipInk? TextDecorationSkipInk { init => _style = StyleAccumulator.Add(_style, StyleField.TextDecorationSkipInk, value, StyleValue.FromTextSkipInk); }
public TextDecorationStyle? TextDecorationStyle { init => _style = StyleAccumulator.Add(_style, StyleField.TextDecorationStyle, value, StyleValue.FromTextDecorationStyle); }
public Length? TextDecorationThickness { init => _style = StyleAccumulator.Add(_style, StyleField.TextDecorationThickness, value); }
public FilterMode? TextFilter { init => _style = StyleAccumulator.Add(_style, StyleField.TextFilter, value, StyleValue.FromFilterMode); }
public Length? TextLineThroughOffset { init => _style = StyleAccumulator.Add(_style, StyleField.TextLineThroughOffset, value); }
public TextOverflow? TextOverflow { init => _style = StyleAccumulator.Add(_style, StyleField.TextOverflow, value, StyleValue.FromTextOverflow); }
public Length? TextOverlineOffset { init => _style = StyleAccumulator.Add(_style, StyleField.TextOverlineOffset, value); }
public Color? TextStrokeColor { init => _style = StyleAccumulator.Add(_style, StyleField.TextStrokeColor, value, StyleValue.FromColor); }
public Length? TextStrokeWidth { init => _style = StyleAccumulator.Add(_style, StyleField.TextStrokeWidth, value); }
public TextTransform? TextTransform { init => _style = StyleAccumulator.Add(_style, StyleField.TextTransform, value, StyleValue.FromTextTransform); }
public Length? TextUnderlineOffset { init => _style = StyleAccumulator.Add(_style, StyleField.TextUnderlineOffset, value); }
public Goo.PanelTransform? Transform { init => _style = StyleAccumulator.Add(_style, StyleField.Transform, value, StyleValue.FromPanelTransform); }
public WhiteSpace? WhiteSpace { init => _style = StyleAccumulator.Add(_style, StyleField.WhiteSpace, value, StyleValue.FromWhiteSpace); }
public WordBreak? WordBreak { init => _style = StyleAccumulator.Add(_style, StyleField.WordBreak, value, StyleValue.FromWordBreak); }
public Length? WordSpacing { init => _style = StyleAccumulator.Add(_style, StyleField.WordSpacing, value); }
public Color? HoverBackgroundColor { init => _style = StyleAccumulator.Add(_style, StyleField.HoverBackgroundColor, value, StyleValue.FromColor); }
public Color? ActiveBackgroundColor { init => _style = StyleAccumulator.Add(_style, StyleField.ActiveBackgroundColor, value, StyleValue.FromColor); }
public Color? FocusBackgroundColor { init => _style = StyleAccumulator.Add(_style, StyleField.FocusBackgroundColor, value, StyleValue.FromColor); }
public Color? HoverFontColor { init => _style = StyleAccumulator.Add(_style, StyleField.HoverFontColor, value, StyleValue.FromColor); }
public Color? ActiveFontColor { init => _style = StyleAccumulator.Add(_style, StyleField.ActiveFontColor, value, StyleValue.FromColor); }
public Color? FocusFontColor { init => _style = StyleAccumulator.Add(_style, StyleField.FocusFontColor, value, StyleValue.FromColor); }
public int? TransitionMs { init => _style = StyleAccumulator.Add(_style, StyleField.TransitionMs, value); }
}
Game
library
// <auto-generated />
// Generated by tools/StyleFacadeEmit. Do not edit by hand.
// Source of truth: tools/StyleFacadeEmit/style-manifest.json
using Sandbox;
using Sandbox.Rendering;
using Sandbox.UI;
namespace Goo;
public readonly partial record struct TextEntry
{
public FlexDirection? FlexDirection { init => _style = StyleAccumulator.Add(_style, StyleField.FlexDirection, value, StyleValue.FromFlexDirection); }
public Justify? JustifyContent { init => _style = StyleAccumulator.Add(_style, StyleField.JustifyContent, value, StyleValue.FromJustify); }
public Align? AlignItems { init => _style = StyleAccumulator.Add(_style, StyleField.AlignItems, value, StyleValue.FromAlign); }
public DisplayMode? Display { init => _style = StyleAccumulator.Add(_style, StyleField.Display, value, StyleValue.FromDisplay); }
public Length? Width { init => _style = StyleAccumulator.Add(_style, StyleField.Width, value); }
public Length? Height { init => _style = StyleAccumulator.Add(_style, StyleField.Height, value); }
public Length? Padding { init => _style = StyleAccumulator.Add(_style, StyleField.Padding, value); }
public Length? PaddingLeft { init => _style = StyleAccumulator.Add(_style, StyleField.PaddingLeft, value); }
public Length? PaddingTop { init => _style = StyleAccumulator.Add(_style, StyleField.PaddingTop, value); }
public Length? PaddingRight { init => _style = StyleAccumulator.Add(_style, StyleField.PaddingRight, value); }
public Length? PaddingBottom { init => _style = StyleAccumulator.Add(_style, StyleField.PaddingBottom, value); }
public Length? Margin { init => _style = StyleAccumulator.Add(_style, StyleField.Margin, value); }
public Length? MarginLeft { init => _style = StyleAccumulator.Add(_style, StyleField.MarginLeft, value); }
public Length? MarginTop { init => _style = StyleAccumulator.Add(_style, StyleField.MarginTop, value); }
public Length? MarginRight { init => _style = StyleAccumulator.Add(_style, StyleField.MarginRight, value); }
public Length? MarginBottom { init => _style = StyleAccumulator.Add(_style, StyleField.MarginBottom, value); }
public Length? Gap { init => _style = StyleAccumulator.Add(_style, StyleField.Gap, value); }
public Length? RowGap { init => _style = StyleAccumulator.Add(_style, StyleField.RowGap, value); }
public Length? ColumnGap { init => _style = StyleAccumulator.Add(_style, StyleField.ColumnGap, value); }
public Color? BackgroundColor { init => _style = StyleAccumulator.Add(_style, StyleField.BackgroundColor, value, StyleValue.FromColor); }
public Length? BorderRadius { init => _style = StyleAccumulator.Add(_style, StyleField.BorderRadius, value); }
public Length? BorderTopLeftRadius { init => _style = StyleAccumulator.Add(_style, StyleField.BorderTopLeftRadius, value); }
public Length? BorderTopRightRadius { init => _style = StyleAccumulator.Add(_style, StyleField.BorderTopRightRadius, value); }
public Length? BorderBottomRightRadius { init => _style = StyleAccumulator.Add(_style, StyleField.BorderBottomRightRadius, value); }
public Length? BorderBottomLeftRadius { init => _style = StyleAccumulator.Add(_style, StyleField.BorderBottomLeftRadius, value); }
public Align? AlignContent { init => _style = StyleAccumulator.Add(_style, StyleField.AlignContent, value, StyleValue.FromAlign); }
public Align? AlignSelf { init => _style = StyleAccumulator.Add(_style, StyleField.AlignSelf, value, StyleValue.FromAlign); }
public float? AspectRatio { init => _style = StyleAccumulator.Add(_style, StyleField.AspectRatio, value); }
public Length? BackdropFilterBlur { init => _style = StyleAccumulator.Add(_style, StyleField.BackdropFilterBlur, value); }
public Length? BackdropFilterBrightness { init => _style = StyleAccumulator.Add(_style, StyleField.BackdropFilterBrightness, value); }
public Length? BackdropFilterContrast { init => _style = StyleAccumulator.Add(_style, StyleField.BackdropFilterContrast, value); }
public Length? BackdropFilterHueRotate { init => _style = StyleAccumulator.Add(_style, StyleField.BackdropFilterHueRotate, value); }
public Length? BackdropFilterInvert { init => _style = StyleAccumulator.Add(_style, StyleField.BackdropFilterInvert, value); }
public Length? BackdropFilterSaturate { init => _style = StyleAccumulator.Add(_style, StyleField.BackdropFilterSaturate, value); }
public Length? BackdropFilterSepia { init => _style = StyleAccumulator.Add(_style, StyleField.BackdropFilterSepia, value); }
public Length? BackgroundAngle { init => _style = StyleAccumulator.Add(_style, StyleField.BackgroundAngle, value); }
public string? BackgroundBlendMode { init => _style = StyleAccumulator.Add(_style, StyleField.BackgroundBlendMode, value); }
public Texture? BackgroundImage { init => _style = StyleAccumulator.Add(_style, StyleField.BackgroundImage, value); }
public bool? BackgroundPlaybackPaused { init => _style = StyleAccumulator.Add(_style, StyleField.BackgroundPlaybackPaused, value); }
public Length? BackgroundPositionX { init => _style = StyleAccumulator.Add(_style, StyleField.BackgroundPositionX, value); }
public Length? BackgroundPositionY { init => _style = StyleAccumulator.Add(_style, StyleField.BackgroundPositionY, value); }
public BackgroundRepeat? BackgroundRepeat { init => _style = StyleAccumulator.Add(_style, StyleField.BackgroundRepeat, value, StyleValue.FromBackgroundRepeat); }
public Length? BackgroundSizeX { init => _style = StyleAccumulator.Add(_style, StyleField.BackgroundSizeX, value); }
public Length? BackgroundSizeY { init => _style = StyleAccumulator.Add(_style, StyleField.BackgroundSizeY, value); }
public Color? BackgroundTint { init => _style = StyleAccumulator.Add(_style, StyleField.BackgroundTint, value, StyleValue.FromColor); }
public Color? BorderBottomColor { init => _style = StyleAccumulator.Add(_style, StyleField.BorderBottomColor, value, StyleValue.FromColor); }
public Color? BorderColor { init => _style = StyleAccumulator.Add(_style, StyleField.BorderColor, value, StyleValue.FromColor); }
public Color? BorderLeftColor { init => _style = StyleAccumulator.Add(_style, StyleField.BorderLeftColor, value, StyleValue.FromColor); }
public Color? BorderRightColor { init => _style = StyleAccumulator.Add(_style, StyleField.BorderRightColor, value, StyleValue.FromColor); }
public Color? BorderTopColor { init => _style = StyleAccumulator.Add(_style, StyleField.BorderTopColor, value, StyleValue.FromColor); }
public BorderImageFill? BorderImageFill { init => _style = StyleAccumulator.Add(_style, StyleField.BorderImageFill, value, StyleValue.FromBorderImageFill); }
public BorderImageRepeat? BorderImageRepeat { init => _style = StyleAccumulator.Add(_style, StyleField.BorderImageRepeat, value, StyleValue.FromBorderImageRepeat); }
public Texture? BorderImageSource { init => _style = StyleAccumulator.Add(_style, StyleField.BorderImageSource, value); }
public Color? BorderImageTint { init => _style = StyleAccumulator.Add(_style, StyleField.BorderImageTint, value, StyleValue.FromColor); }
public Length? BorderImageWidthBottom { init => _style = StyleAccumulator.Add(_style, StyleField.BorderImageWidthBottom, value); }
public Length? BorderImageWidthLeft { init => _style = StyleAccumulator.Add(_style, StyleField.BorderImageWidthLeft, value); }
public Length? BorderImageWidthRight { init => _style = StyleAccumulator.Add(_style, StyleField.BorderImageWidthRight, value); }
public Length? BorderImageWidthTop { init => _style = StyleAccumulator.Add(_style, StyleField.BorderImageWidthTop, value); }
public Length? BorderBottomWidth { init => _style = StyleAccumulator.Add(_style, StyleField.BorderBottomWidth, value); }
public Length? BorderLeftWidth { init => _style = StyleAccumulator.Add(_style, StyleField.BorderLeftWidth, value); }
public Length? BorderRightWidth { init => _style = StyleAccumulator.Add(_style, StyleField.BorderRightWidth, value); }
public Length? BorderTopWidth { init => _style = StyleAccumulator.Add(_style, StyleField.BorderTopWidth, value); }
public Length? BorderWidth { init => _style = StyleAccumulator.Add(_style, StyleField.BorderWidth, value); }
public Length? Bottom { init => _style = StyleAccumulator.Add(_style, StyleField.Bottom, value); }
public Length? Left { init => _style = StyleAccumulator.Add(_style, StyleField.Left, value); }
public Length? Right { init => _style = StyleAccumulator.Add(_style, StyleField.Right, value); }
public Length? Top { init => _style = StyleAccumulator.Add(_style, StyleField.Top, value); }
public Color? CaretColor { init => _style = StyleAccumulator.Add(_style, StyleField.CaretColor, value, StyleValue.FromColor); }
public string? Cursor { init => _style = StyleAccumulator.Add(_style, StyleField.Cursor, value); }
public Length? FilterBlur { init => _style = StyleAccumulator.Add(_style, StyleField.FilterBlur, value); }
public Color? FilterBorderColor { init => _style = StyleAccumulator.Add(_style, StyleField.FilterBorderColor, value, StyleValue.FromColor); }
public Length? FilterBorderWidth { init => _style = StyleAccumulator.Add(_style, StyleField.FilterBorderWidth, value); }
public Length? FilterBrightness { init => _style = StyleAccumulator.Add(_style, StyleField.FilterBrightness, value); }
public Length? FilterContrast { init => _style = StyleAccumulator.Add(_style, StyleField.FilterContrast, value); }
public Length? FilterHueRotate { init => _style = StyleAccumulator.Add(_style, StyleField.FilterHueRotate, value); }
public Length? FilterInvert { init => _style = StyleAccumulator.Add(_style, StyleField.FilterInvert, value); }
public Length? FilterSaturate { init => _style = StyleAccumulator.Add(_style, StyleField.FilterSaturate, value); }
public Length? FilterSepia { init => _style = StyleAccumulator.Add(_style, StyleField.FilterSepia, value); }
public Color? FilterTint { init => _style = StyleAccumulator.Add(_style, StyleField.FilterTint, value, StyleValue.FromColor); }
public Length? FlexBasis { init => _style = StyleAccumulator.Add(_style, StyleField.FlexBasis, value); }
public float? FlexGrow { init => _style = StyleAccumulator.Add(_style, StyleField.FlexGrow, value); }
public float? FlexShrink { init => _style = StyleAccumulator.Add(_style, StyleField.FlexShrink, value); }
public Wrap? FlexWrap { init => _style = StyleAccumulator.Add(_style, StyleField.FlexWrap, value, StyleValue.FromWrap); }
public Color? FontColor { init => _style = StyleAccumulator.Add(_style, StyleField.FontColor, value, StyleValue.FromColor); }
public string? FontFamily { init => _style = StyleAccumulator.Add(_style, StyleField.FontFamily, value); }
public Length? FontSize { init => _style = StyleAccumulator.Add(_style, StyleField.FontSize, value); }
public FontSmooth? FontSmooth { init => _style = StyleAccumulator.Add(_style, StyleField.FontSmooth, value, StyleValue.FromFontSmooth); }
public FontStyle? FontStyle { init => _style = StyleAccumulator.Add(_style, StyleField.FontStyle, value, StyleValue.FromFontStyle); }
public FontVariantNumeric? FontVariantNumeric { init => _style = StyleAccumulator.Add(_style, StyleField.FontVariantNumeric, value, StyleValue.FromFontVariantNumeric); }
public int? FontWeight { init => _style = StyleAccumulator.Add(_style, StyleField.FontWeight, value); }
public ImageRendering? ImageRendering { init => _style = StyleAccumulator.Add(_style, StyleField.ImageRendering, value, StyleValue.FromImageRendering); }
public Length? LetterSpacing { init => _style = StyleAccumulator.Add(_style, StyleField.LetterSpacing, value); }
public Length? LineHeight { init => _style = StyleAccumulator.Add(_style, StyleField.LineHeight, value); }
public Length? MaskAngle { init => _style = StyleAccumulator.Add(_style, StyleField.MaskAngle, value); }
public Texture? MaskImage { init => _style = StyleAccumulator.Add(_style, StyleField.MaskImage, value); }
public MaskMode? MaskMode { init => _style = StyleAccumulator.Add(_style, StyleField.MaskMode, value, StyleValue.FromMaskMode); }
public Length? MaskPositionX { init => _style = StyleAccumulator.Add(_style, StyleField.MaskPositionX, value); }
public Length? MaskPositionY { init => _style = StyleAccumulator.Add(_style, StyleField.MaskPositionY, value); }
public BackgroundRepeat? MaskRepeat { init => _style = StyleAccumulator.Add(_style, StyleField.MaskRepeat, value, StyleValue.FromBackgroundRepeat); }
public MaskScope? MaskScope { init => _style = StyleAccumulator.Add(_style, StyleField.MaskScope, value, StyleValue.FromMaskScope); }
public Length? MaskSizeX { init => _style = StyleAccumulator.Add(_style, StyleField.MaskSizeX, value); }
public Length? MaskSizeY { init => _style = StyleAccumulator.Add(_style, StyleField.MaskSizeY, value); }
public Length? MaxHeight { init => _style = StyleAccumulator.Add(_style, StyleField.MaxHeight, value); }
public Length? MaxWidth { init => _style = StyleAccumulator.Add(_style, StyleField.MaxWidth, value); }
public Length? MinHeight { init => _style = StyleAccumulator.Add(_style, StyleField.MinHeight, value); }
public Length? MinWidth { init => _style = StyleAccumulator.Add(_style, StyleField.MinWidth, value); }
public string? MixBlendMode { init => _style = StyleAccumulator.Add(_style, StyleField.MixBlendMode, value); }
public float? Opacity { init => _style = StyleAccumulator.Add(_style, StyleField.Opacity, value); }
public int? Order { init => _style = StyleAccumulator.Add(_style, StyleField.Order, value); }
public Color? OutlineColor { init => _style = StyleAccumulator.Add(_style, StyleField.OutlineColor, value, StyleValue.FromColor); }
public Length? OutlineOffset { init => _style = StyleAccumulator.Add(_style, StyleField.OutlineOffset, value); }
public Length? OutlineWidth { init => _style = StyleAccumulator.Add(_style, StyleField.OutlineWidth, value); }
public OverflowMode? Overflow { init => _style = StyleAccumulator.Add(_style, StyleField.Overflow, value, StyleValue.FromOverflowMode); }
public OverflowMode? OverflowX { init => _style = StyleAccumulator.Add(_style, StyleField.OverflowX, value, StyleValue.FromOverflowMode); }
public OverflowMode? OverflowY { init => _style = StyleAccumulator.Add(_style, StyleField.OverflowY, value, StyleValue.FromOverflowMode); }
public Length? PerspectiveOriginX { init => _style = StyleAccumulator.Add(_style, StyleField.PerspectiveOriginX, value); }
public Length? PerspectiveOriginY { init => _style = StyleAccumulator.Add(_style, StyleField.PerspectiveOriginY, value); }
public PointerEvents? PointerEvents { init => _style = StyleAccumulator.Add(_style, StyleField.PointerEvents, value, StyleValue.FromPointerEvents); }
public PositionMode? Position { init => _style = StyleAccumulator.Add(_style, StyleField.Position, value, StyleValue.FromPositionMode); }
public string? SoundIn { init => _style = StyleAccumulator.Add(_style, StyleField.SoundIn, value); }
public string? SoundOut { init => _style = StyleAccumulator.Add(_style, StyleField.SoundOut, value); }
public TextAlign? TextAlign { init => _style = StyleAccumulator.Add(_style, StyleField.TextAlign, value, StyleValue.FromTextAlign); }
public Length? TextBackgroundAngle { init => _style = StyleAccumulator.Add(_style, StyleField.TextBackgroundAngle, value); }
public Color? TextDecorationColor { init => _style = StyleAccumulator.Add(_style, StyleField.TextDecorationColor, value, StyleValue.FromColor); }
public TextDecoration? TextDecorationLine { init => _style = StyleAccumulator.Add(_style, StyleField.TextDecorationLine, value, StyleValue.FromTextDecoration); }
public TextSkipInk? TextDecorationSkipInk { init => _style = StyleAccumulator.Add(_style, StyleField.TextDecorationSkipInk, value, StyleValue.FromTextSkipInk); }
public TextDecorationStyle? TextDecorationStyle { init => _style = StyleAccumulator.Add(_style, StyleField.TextDecorationStyle, value, StyleValue.FromTextDecorationStyle); }
public Length? TextDecorationThickness { init => _style = StyleAccumulator.Add(_style, StyleField.TextDecorationThickness, value); }
public FilterMode? TextFilter { init => _style = StyleAccumulator.Add(_style, StyleField.TextFilter, value, StyleValue.FromFilterMode); }
public Length? TextLineThroughOffset { init => _style = StyleAccumulator.Add(_style, StyleField.TextLineThroughOffset, value); }
public TextOverflow? TextOverflow { init => _style = StyleAccumulator.Add(_style, StyleField.TextOverflow, value, StyleValue.FromTextOverflow); }
public Length? TextOverlineOffset { init => _style = StyleAccumulator.Add(_style, StyleField.TextOverlineOffset, value); }
public Color? TextStrokeColor { init => _style = StyleAccumulator.Add(_style, StyleField.TextStrokeColor, value, StyleValue.FromColor); }
public Length? TextStrokeWidth { init => _style = StyleAccumulator.Add(_style, StyleField.TextStrokeWidth, value); }
public TextTransform? TextTransform { init => _style = StyleAccumulator.Add(_style, StyleField.TextTransform, value, StyleValue.FromTextTransform); }
public Length? TextUnderlineOffset { init => _style = StyleAccumulator.Add(_style, StyleField.TextUnderlineOffset, value); }
public Goo.PanelTransform? Transform { init => _style = StyleAccumulator.Add(_style, StyleField.Transform, value, StyleValue.FromPanelTransform); }
public Length? TransformOriginX { init => _style = StyleAccumulator.Add(_style, StyleField.TransformOriginX, value); }
public Length? TransformOriginY { init => _style = StyleAccumulator.Add(_style, StyleField.TransformOriginY, value); }
public WhiteSpace? WhiteSpace { init => _style = StyleAccumulator.Add(_style, StyleField.WhiteSpace, value, StyleValue.FromWhiteSpace); }
public WordBreak? WordBreak { init => _style = StyleAccumulator.Add(_style, StyleField.WordBreak, value, StyleValue.FromWordBreak); }
public Length? WordSpacing { init => _style = StyleAccumulator.Add(_style, StyleField.WordSpacing, value); }
public int? ZIndex { init => _style = StyleAccumulator.Add(_style, StyleField.ZIndex, value); }
public Color? HoverBackgroundColor { init => _style = StyleAccumulator.Add(_style, StyleField.HoverBackgroundColor, value, StyleValue.FromColor); }
public Color? ActiveBackgroundColor { init => _style = StyleAccumulator.Add(_style, StyleField.ActiveBackgroundColor, value, StyleValue.FromColor); }
public Color? FocusBackgroundColor { init => _style = StyleAccumulator.Add(_style, StyleField.FocusBackgroundColor, value, StyleValue.FromColor); }
public Color? HoverFontColor { init => _style = StyleAccumulator.Add(_style, StyleField.HoverFontColor, value, StyleValue.FromColor); }
public Color? ActiveFontColor { init => _style = StyleAccumulator.Add(_style, StyleField.ActiveFontColor, value, StyleValue.FromColor); }
public Color? FocusFontColor { init => _style = StyleAccumulator.Add(_style, StyleField.FocusFontColor, value, StyleValue.FromColor); }
public int? TransitionMs { init => _style = StyleAccumulator.Add(_style, StyleField.TransitionMs, value); }
}
Game
library
using Goo;
using Sandbox.UI;
namespace Sandbox;
public class CounterUI : GooPanel<Container>
{
private int _count;
protected override Container Build() => new Container
{
Padding = 16,
Width = 128,
Height = 128,
BackgroundColor = Color.White,
BorderRadius = 12,
FlexDirection = FlexDirection.Row,
Gap = 12,
AlignItems = Align.Center,
Children =
{
new Text(_count.ToString()),
new Container
{
Padding = 8,
BackgroundColor = Color.Orange,
HoverBackgroundColor = Color.Cyan,
BorderRadius = 6,
OnClick = e => { _count++; Rebuild(); },
Children = { new Text("+") },
},
},
};
}
Game
library
using System;
using System.Collections.Generic;
using Sandbox;
namespace Goo.Input;
// Polls a curated key catalog once per frame for rising-edge presses + modifier state. ReemitHeldOnModifierRise re-emits a held key when a modifier rises (so "hold W, press Ctrl" reads as a chord).
public sealed class KeyTracker
{
public bool ReemitHeldOnModifierRise { get; set; } = false;
public ModifierState Modifiers { get; private set; }
public IReadOnlyList<KeyDescriptor> JustPressed => _justPressed;
readonly IReadOnlyList<KeyDescriptor> _catalog;
readonly HashSet<string> _downLastFrame = new();
readonly List<KeyDescriptor> _justPressed = new();
public KeyTracker() : this( KnownKeys.All ) { }
public KeyTracker( IReadOnlyList<KeyDescriptor> catalog )
{
_catalog = catalog;
}
public void Reset()
{
_downLastFrame.Clear();
_justPressed.Clear();
Modifiers = default;
}
static readonly Func<string, bool> s_engineDown = Sandbox.Input.Keyboard.Down;
public void Poll() => Poll( s_engineDown );
// isDown seam exists because engine Input statics throw outside a running engine process.
public void Poll( Func<string, bool> isDown )
{
_justPressed.Clear();
var prev = Modifiers;
for ( int i = 0; i < _catalog.Count; i++ )
{
var d = _catalog[i];
bool down = isDown( d.EngineName );
if ( down && !_downLastFrame.Contains( d.EngineName ) )
_justPressed.Add( d );
if ( down ) _downLastFrame.Add( d.EngineName );
else _downLastFrame.Remove( d.EngineName );
}
Modifiers = new ModifierState(
_downLastFrame.Contains( "ctrl" ),
_downLastFrame.Contains( "shift" ),
_downLastFrame.Contains( "alt" ),
_downLastFrame.Contains( "win" ) );
if ( !ReemitHeldOnModifierRise ) return;
bool modRose = ( Modifiers.Ctrl && !prev.Ctrl ) || ( Modifiers.Shift && !prev.Shift )
|| ( Modifiers.Alt && !prev.Alt ) || ( Modifiers.Meta && !prev.Meta );
if ( !modRose ) return;
for ( int i = 0; i < _catalog.Count; i++ )
{
var d = _catalog[i];
if ( d.Class == KeyClass.Modifier ) continue;
if ( !_downLastFrame.Contains( d.EngineName ) ) continue;
if ( _justPressed.Contains( d ) ) continue;
_justPressed.Add( d );
}
}
/// <summary>True if the named key had a rising edge (just-pressed, not held) this frame; call Poll first.</summary>
public bool Pressed( string engineName )
{
for ( int i = 0; i < _justPressed.Count; i++ )
if ( _justPressed[i].EngineName == engineName ) return true;
return false;
}
}
Game
library
using System;
using Sandbox;
using Sandbox.UI;
namespace Goo.Internal;
internal sealed class StatefulLabel : Label, IStatefulHost, IStatefulEventHost
{
StateController? _state;
internal Action<MousePanelEvent>? _onClick;
internal Action<MousePanelEvent>? _onRightClick;
internal Action<MousePanelEvent>? _onMiddleClick;
internal Action<MousePanelEvent>? _onMouseEnter;
internal Action<MousePanelEvent>? _onMouseLeave;
internal Action<MousePanelEvent>? _onMouseDown;
internal Action<MousePanelEvent>? _onMouseUp;
internal Action<MousePanelEvent>? _onMouseMove;
internal bool _userSetPointerEvents;
internal Action? _requestRebuild;
public Action? RequestRebuild { set => _requestRebuild = value; }
public void ApplyStateVariants(
Color? baseBg, Color? baseFg,
Color? hoverBg, Color? activeBg, Color? focusBg,
Color? hoverFg, Color? activeFg, Color? focusFg,
int? transitionMs)
{
_state ??= new StateController(this);
_state.ApplyVariants(
baseBg, baseFg,
hoverBg, activeBg, focusBg,
hoverFg, activeFg, focusFg,
transitionMs);
}
public void ClearStateVariants() => _state?.ClearVariants();
public bool HasActiveStateVariants => _state?.HasActiveVariants ?? false;
public void ApplyEvents(in BlobEvents events)
{
_onClick = events.OnClick;
_onRightClick = events.OnRightClick;
_onMiddleClick = events.OnMiddleClick;
_onMouseEnter = events.OnMouseEnter;
_onMouseLeave = events.OnMouseLeave;
_onMouseDown = events.OnMouseDown;
_onMouseUp = events.OnMouseUp;
_onMouseMove = events.OnMouseMove;
}
public bool HasEventHandlers =>
_onClick != null || _onRightClick != null || _onMiddleClick != null || _onMouseEnter != null || _onMouseLeave != null ||
_onMouseDown != null || _onMouseUp != null || _onMouseMove != null;
public bool UserSetPointerEvents
{
get => _userSetPointerEvents;
set => _userSetPointerEvents = value;
}
protected override void OnClick(MousePanelEvent e)
{
base.OnClick(e);
EventDispatch.Fire(_onClick, e, _requestRebuild);
}
protected override void OnRightClick(MousePanelEvent e)
{
base.OnRightClick(e);
EventDispatch.Fire(_onRightClick, e, _requestRebuild);
}
protected override void OnMiddleClick(MousePanelEvent e)
{
base.OnMiddleClick(e);
EventDispatch.Fire(_onMiddleClick, e, _requestRebuild);
}
protected override void OnMouseOver(MousePanelEvent e)
{
base.OnMouseOver(e);
EventDispatch.Fire(_onMouseEnter, e, _requestRebuild);
}
protected override void OnMouseOut(MousePanelEvent e)
{
base.OnMouseOut(e);
EventDispatch.Fire(_onMouseLeave, e, _requestRebuild);
}
protected override void OnMouseDown(MousePanelEvent e)
{
base.OnMouseDown(e);
EventDispatch.Fire(_onMouseDown, e, _requestRebuild);
}
protected override void OnMouseUp(MousePanelEvent e)
{
base.OnMouseUp(e);
EventDispatch.Fire(_onMouseUp, e, _requestRebuild);
}
protected override void OnMouseMove(MousePanelEvent e)
{
base.OnMouseMove(e);
EventDispatch.Fire(_onMouseMove, e, _requestRebuild);
}
}
Game
library
using System;
using System.Collections.Generic;
using Sandbox;
using Sandbox.Rendering;
using Sandbox.UI;
namespace Goo;
/// <summary>
/// A custom shader applied to a Blob. Point it at a compiled .shader; it parses the shader
/// source's Attribute() declarations to validate uniform names and to reset uniforms other
/// panels have set (panels share one CommandList attribute namespace), and pushes the uniform
/// bag every frame. Set uniforms with the collection initializer (<c>["Name"] = value</c>);
/// a value may be a literal or a per-frame Func. Subclass and override <see cref="Apply"/>
/// only for bespoke per-frame CPU logic.
/// </summary>
public record ShaderEffect
{
static readonly Dictionary<object, Material> _materialCache = new();
static readonly Dictionary<object, ShaderSchemaInfo?> _schemaCache = new();
// Every uniform name any ShaderEffect has pushed this session, with the last value pushed
// (its runtime type drives the reset conversion). Panels share one CommandList attribute
// namespace, so a uniform set by one panel persists into every later panel's draw; an
// effect that does not set a seen uniform must reset it to its shader's declared default
// or it inherits the other panel's value (view-5u5m). Touched only from Apply (render thread).
static readonly Dictionary<string, object> _seenUniforms = new();
internal sealed class ShaderSchemaInfo
{
public required HashSet<string> Names; // declared attribute names
public required Dictionary<string, (Vector4 Floats, Vector4 Ints)> Defaults;
}
readonly string? _path;
readonly Shader? _shader;
readonly GrabMode _grab;
readonly Dictionary<string, UniformValue> _bag = new();
bool _validated;
/// <summary>For subclasses that supply their own <see cref="Material"/> and <see cref="Apply"/>.</summary>
protected ShaderEffect() { }
/// <summary>Apply the shader at <paramref name="shaderPath"/> (e.g. "shaders/ui_dither.shader").</summary>
public ShaderEffect( string shaderPath, GrabMode grab = GrabMode.None )
{
_path = shaderPath;
_grab = grab;
}
/// <summary>Apply a shader resource (drag-droppable in the inspector).</summary>
public ShaderEffect( Shader shader, GrabMode grab = GrabMode.None )
{
_shader = shader;
_grab = grab;
}
/// <summary>The shader asset path, or null when constructed from a <see cref="T:Sandbox.Shader"/> resource.</summary>
public string? ShaderPath => _path;
/// <summary>How this effect grabs the framebuffer behind its panel.</summary>
public GrabMode Grab => _grab;
/// <summary>Get or set a uniform by its shader attribute name.</summary>
public UniformValue this[string name]
{
get => _bag[name];
set => _bag[name] = value;
}
object CacheKey => (object?)_path ?? _shader!;
/// <summary>The material this effect draws with, cached so it is excluded from record equality.</summary>
public virtual Material Material
{
get
{
var key = CacheKey;
if ( !_materialCache.TryGetValue( key, out var mat ) )
{
mat = _path is not null ? Material.FromShader( _path ) : Material.FromShader( _shader! );
_materialCache[key] = mat;
}
return mat;
}
}
/// <summary>Create the Material now, on the calling thread. Call on the main thread; Draw runs on the render thread and must only read the cache.</summary>
public void Warm() => _ = Material;
/// <summary>Set this effect's shader attributes for the frame, then grab the framebuffer per <see cref="Grab"/>.</summary>
protected internal virtual void Apply( CommandList cl, Rect rect )
{
cl.Attributes.Set( "BoxSize", new Vector2( rect.Width, rect.Height ) );
// Subclass escape hatch: a derived effect calling base.Apply gets only BoxSize.
if ( _path is null && _shader is null ) return;
Validate();
// Reset seen-but-unset uniforms to this shader's declared defaults so another panel's
// attribute writes do not bleed into this draw (view-5u5m).
var schema = SchemaFor( CacheKey );
if ( schema is not null )
{
foreach ( var (name, sample) in _seenUniforms )
{
if ( _bag.ContainsKey( name ) ) continue;
if ( !schema.Defaults.TryGetValue( name, out var def ) ) continue;
if ( ResetValue( sample, def.Floats, def.Ints ) is { } reset )
SetAttribute( cl, name, reset );
}
}
foreach ( var (name, value) in _bag )
{
var resolved = value.Resolve();
SetAttribute( cl, name, resolved );
if ( resolved is not Texture )
_seenUniforms[name] = resolved;
}
switch ( _grab )
{
case GrabMode.Sharp:
cl.Attributes.GrabFrameTexture( "FrameBufferCopyTexture" );
break;
case GrabMode.Blurred:
cl.Attributes.GrabFrameTexture( "FrameBufferCopyTexture", Graphics.DownsampleMethod.GaussianBlur );
break;
}
}
static void SetAttribute( CommandList cl, string name, object value )
{
switch ( value )
{
case float f: cl.Attributes.Set( name, f ); break;
case bool b: cl.Attributes.Set( name, b ); break;
case Vector2 v: cl.Attributes.Set( name, v ); break;
case Vector3 v: cl.Attributes.Set( name, v ); break;
case Vector4 v: cl.Attributes.Set( name, v ); break;
case Color c: cl.Attributes.Set( name, c ); break;
case Texture t: cl.Attributes.Set( name, t ); break;
}
}
// Reads the shader's declared attribute names once per instance and warns on uniform names
// the shader does not declare. Skipped silently when the source is unavailable.
void Validate()
{
if ( _validated ) return;
_validated = true;
var valid = SchemaFor( CacheKey )?.Names;
if ( valid is null || valid.Count == 0 ) return;
foreach ( var name in _bag.Keys )
if ( !valid.Contains( name ) )
Sandbox.Internal.GlobalSystemNamespace.Log.Warning(
$"ShaderEffect for \"{_path ?? _shader?.ResourcePath}\": uniform \"{name}\" is not declared by the shader " +
$"(valid: {string.Join( ", ", valid )}). Ignored." );
}
// Names + defaults come from parsing the .shader SOURCE, which ships with the project and
// declares every Attribute() with its Default(). The engine's Shader.Schema is editor-only
// plumbing: at game runtime it throws ("Load must be called on the main thread!" — Apply
// runs on the render thread) so it is not consulted at all (view-5u5m probe, 2026-06-11).
// Null when the source is unreadable (e.g. unit tests, published build without raw
// .shader files); reset and validation both skip then.
static ShaderSchemaInfo? SchemaFor( object key )
{
if ( _schemaCache.TryGetValue( key, out var info ) ) return info;
info = null;
if ( (key as string ?? (key as Shader)?.ResourcePath) is { } srcPath )
{
try
{
info = ParseShaderSource( FileSystem.Mounted.ReadAllText( srcPath ) );
}
catch
{
info = null;
}
}
_schemaCache[key] = info;
return info;
}
static readonly System.Text.RegularExpressions.Regex _declRegex = new(
@"\b(?<type>float[234]?|bool|int|Texture2D)\s+\w+\s*<(?<block>[^>]*)>",
System.Text.RegularExpressions.RegexOptions.Compiled );
static readonly System.Text.RegularExpressions.Regex _attrRegex = new(
@"Attribute\s*\(\s*""(?<name>[^""]+)""\s*\)",
System.Text.RegularExpressions.RegexOptions.Compiled );
static readonly System.Text.RegularExpressions.Regex _defaultRegex = new(
@"Default[234]?\s*\(\s*(?<args>[^)]*)\)",
System.Text.RegularExpressions.RegexOptions.Compiled );
// Pure: extracts Attribute()-bound uniform declarations and their Default() values from
// .shader source. Defaults are stored in both vector slots so ResetValue can convert by the
// bled value's runtime type. Texture declarations contribute a name (for validation) but no
// default. Only the main file is scanned; #include'd uniforms (BoxSize, DpiScale) are
// framework-managed and excluded anyway. Missing Default() = zeros, matching the engine's
// unset-attribute behavior.
internal static ShaderSchemaInfo? ParseShaderSource( string source )
{
var names = new HashSet<string>();
var defaults = new Dictionary<string, (Vector4 Floats, Vector4 Ints)>();
foreach ( System.Text.RegularExpressions.Match m in _declRegex.Matches( source ) )
{
var block = m.Groups["block"].Value;
var attr = _attrRegex.Match( block );
if ( !attr.Success ) continue;
var name = attr.Groups["name"].Value;
names.Add( name );
if ( name is "BoxSize" or "DpiScale" ) continue; // framework-managed per draw
if ( m.Groups["type"].Value == "Texture2D" ) continue; // no resettable default
Vector4 v = default;
var def = _defaultRegex.Match( block );
if ( def.Success )
{
var parts = def.Groups["args"].Value.Split( ',' );
for ( int i = 0; i < parts.Length && i < 4; i++ )
{
if ( !float.TryParse( parts[i].Trim(), System.Globalization.NumberStyles.Float,
System.Globalization.CultureInfo.InvariantCulture, out var f ) ) continue;
switch ( i )
{
case 0: v.x = f; break;
case 1: v.y = f; break;
case 2: v.z = f; break;
case 3: v.w = f; break;
}
}
}
defaults[name] = (v, v);
}
return names.Count > 0 ? new ShaderSchemaInfo { Names = names, Defaults = defaults } : null;
}
// Pure: converts a shader's declared default (schema FloatDefault/IntDefault vectors) to the
// runtime type of the value that bled in, so the reset lands in the same attribute slot type.
// Null = no safe reset (unsupported type; textures are never recorded so never reach this).
internal static object? ResetValue( object sample, Vector4 floats, Vector4 ints ) => sample switch
{
float => floats.x,
bool => ints.x != 0f,
Vector2 => new Vector2( floats.x, floats.y ),
Vector3 => new Vector3( floats.x, floats.y, floats.z ),
Color => new Color( floats.x, floats.y, floats.z, floats.w ),
Vector4 => floats,
_ => null,
};
public virtual bool Equals( ShaderEffect? other )
{
if ( other is null ) return false;
if ( ReferenceEquals( this, other ) ) return true;
if ( EqualityContract != other.EqualityContract ) return false;
return _path == other._path
&& ReferenceEquals( _shader, other._shader )
&& _grab == other._grab
&& BagEquals( _bag, other._bag );
}
public override int GetHashCode()
{
var hc = new HashCode();
hc.Add( EqualityContract );
hc.Add( _path );
hc.Add( _grab );
hc.Add( _bag.Count );
return hc.ToHashCode();
}
static bool BagEquals( Dictionary<string, UniformValue> a, Dictionary<string, UniformValue> b )
{
if ( a.Count != b.Count ) return false;
foreach ( var (k, v) in a )
if ( !b.TryGetValue( k, out var bv ) || !v.Equals( bv ) ) return false;
return true;
}
}
Game
library
using Sandbox;
using Sandbox.Rendering;
using Sandbox.UI;
namespace Goo;
// Style helpers hoisted so generated Blob facades share them. Keep the early-return form: an engine-type ternary that resolves bare null via an implicit string operator silently produces magenta (Color.Parse fallback) instead of the intended absent-property. See engine-fact memories.
internal static class StyleAccumulator
{
static StyleList Rent(StyleList current)
=> ReferenceEquals(current, StyleList.Empty)
? BuildContext.Current.RentStyleList()
: current;
public static StyleList Add(StyleList current, StyleField field, Length? value)
{
if (!value.HasValue) return current;
var list = Rent(current);
list.Add(field, StyleValue.FromLength(value.Value));
return list;
}
public static StyleList Add<TEnum>(StyleList current, StyleField field, TEnum? value, System.Func<TEnum, StyleValue> wrap) where TEnum : struct
{
if (!value.HasValue) return current;
var list = Rent(current);
list.Add(field, wrap(value.Value));
return list;
}
public static StyleList Add(StyleList current, StyleField field, Color? value, System.Func<Color, StyleValue> wrap)
{
if (!value.HasValue) return current;
var list = Rent(current);
list.Add(field, wrap(value.Value));
return list;
}
public static StyleList Add(StyleList current, StyleField field, string? value)
{
if (value is null) return current;
var list = Rent(current);
list.Add(field, StyleValue.FromString(value));
return list;
}
public static StyleList Add(StyleList current, StyleField field, float? value)
{
if (!value.HasValue) return current;
var list = Rent(current);
list.Add(field, StyleValue.FromSingle(value.Value));
return list;
}
public static StyleList Add(StyleList current, StyleField field, bool? value)
{
if (!value.HasValue) return current;
var list = Rent(current);
list.Add(field, StyleValue.FromBoolean(value.Value));
return list;
}
public static StyleList Add(StyleList current, StyleField field, int? value)
{
if (!value.HasValue) return current;
var list = Rent(current);
list.Add(field, StyleValue.FromInt32(value.Value));
return list;
}
public static StyleList Add(StyleList current, StyleField field, Texture? value)
{
if (value is null) return current;
var list = Rent(current);
list.Add(field, StyleValue.FromTexture(value));
return list;
}
}
Game
library
using System;
using Sandbox;
using Sandbox.UI;
namespace Goo;
// Cell: a draggable carrying a typed payload. Owns its own being-dragged visual flag so the
// original can dim while in flight. Wires engine drag events into the shared DragContext.
public sealed class DragSource<T> : Cell<Container>
{
public DragContext<T> Context = null!; // set via Cell.Mount configure
public T Payload = default!; // set via configure
public Func<bool, Container> Content = null!; // receives isDragging; renders the tile
public Func<Container>? Ghost; // optional ghost; defaults to Content(false)
bool _dragging;
protected override Container Build() => new Container
{
PointerEvents = PointerEvents.All,
OnDragStart = e =>
{
_dragging = true;
// ScreenPosition is rendered px; the ghost layer consumes Context.Pos as CSS-px Left/Top.
// Convert via the source panel's ScaleFromScreen (=1/ScaleToScreen) so the ghost tracks
// the cursor under UI scaling (engine-fact-panel-screen-position-helpers). No-op at 1.0.
Context.Begin(Payload, Ghost ?? (() => Content(false)),
e.ScreenPosition * (e.This?.ScaleFromScreen ?? 1f));
Rebuild();
},
OnDrag = e =>
{
Context.Move(e.ScreenPosition * (e.This?.ScaleFromScreen ?? 1f));
Rebuild();
},
OnDragEnd = _ =>
{
_dragging = false;
Context.Release();
Rebuild();
},
Children = { Content(_dragging) },
};
}
Game
library
using Sandbox;
namespace Goo.Internal;
internal interface IStatefulHost
{
void ApplyStateVariants(
Color? baseBg, Color? baseFg,
Color? hoverBg, Color? activeBg, Color? focusBg,
Color? hoverFg, Color? activeFg, Color? focusFg,
int? transitionMs);
// Shed any previously-applied variant sheet when the host (possibly recycled by
// the reconciler) declares no variants this pass. No-op if none were applied.
void ClearStateVariants();
// True while a variant sheet is attached; such panels must keep capturing pointer events.
bool HasActiveStateVariants { get; }
}
Game
library
global using static Sandbox.Internal.GlobalGameNamespace;
global using Microsoft.AspNetCore.Components;
global using Microsoft.AspNetCore.Components.Rendering;
[assembly: global::System.Reflection.AssemblyMetadata( "AddonTitle", "Goo UI" )]
[assembly: global::System.Reflection.AssemblyMetadata( "AddonIdent", "gooui" )]
[assembly: global::System.Reflection.AssemblyMetadata( "OrgIdent", "xaz" )]
[assembly: global::System.Reflection.AssemblyMetadata( "Ident", "xaz.gooui" )]
[assembly: global::System.Reflection.AssemblyMetadata( "EngineVersion", "26" )]
[assembly: global::System.Reflection.AssemblyMetadata( "EngineMinorVersion", "1" )]
[assembly: System.Runtime.Versioning.TargetFramework( ".NETCoreApp,Version=v9.0", FrameworkDisplayName = ".NET 9.0" )]
[assembly: global::System.Reflection.AssemblyMetadata( "CompileTime", "2026-06-26T02:54:14.8168981Z" )]
[assembly: global::System.Reflection.AssemblyVersion("0.0.120.0")]
[assembly: global::System.Reflection.AssemblyFileVersion("0.0.120.0")]
Game
library
using System;
using Sandbox;
namespace Goo.Animation;
public record struct SpringColor
{
public Color Current;
public Color Target;
public Color Velocity;
public float Frequency;
public float Damping;
public SpringColor(Color initial, float frequency, float damping)
{
Current = initial;
Target = initial;
Velocity = default;
Frequency = frequency;
Damping = damping;
}
public void Update(float dt)
{
float vr = Velocity.r, vg = Velocity.g, vb = Velocity.b, va = Velocity.a;
Current = new Color(
MathX.SpringDamp(Current.r, Target.r, ref vr, dt, Frequency, Damping),
MathX.SpringDamp(Current.g, Target.g, ref vg, dt, Frequency, Damping),
MathX.SpringDamp(Current.b, Target.b, ref vb, dt, Frequency, Damping),
MathX.SpringDamp(Current.a, Target.a, ref va, dt, Frequency, Damping));
Velocity = new Color(vr, vg, vb, va);
}
public bool IsSettled =>
MathF.Abs(Target.r - Current.r) < 0.0001f &&
MathF.Abs(Target.g - Current.g) < 0.0001f &&
MathF.Abs(Target.b - Current.b) < 0.0001f &&
MathF.Abs(Target.a - Current.a) < 0.0001f &&
MathF.Abs(Velocity.r) < 0.0001f &&
MathF.Abs(Velocity.g) < 0.0001f &&
MathF.Abs(Velocity.b) < 0.0001f &&
MathF.Abs(Velocity.a) < 0.0001f;
/// <summary>Advances by dt and returns true while still moving; chain calls with | (not ||) so every damper advances each frame.</summary>
public bool Tick(float dt) { Update(dt); return !IsSettled; }
}
Game
library
using System;
using Sandbox;
namespace Goo.Animation;
public record struct SpringFloat
{
public float Current;
public float Target;
public float Velocity;
public float Frequency;
public float Damping;
public SpringFloat(float initial, float frequency, float damping)
{
Current = initial;
Target = initial;
Velocity = 0f;
Frequency = frequency;
Damping = damping;
}
public void Update(float dt) =>
Current = MathX.SpringDamp(Current, Target, ref Velocity, dt, Frequency, Damping);
public bool IsSettled =>
MathF.Abs(Target - Current) < 0.0001f && MathF.Abs(Velocity) < 0.0001f;
/// <summary>Advances by dt and returns true while still moving; chain calls with | (not ||) so every damper advances each frame.</summary>
public bool Tick(float dt) { Update(dt); return !IsSettled; }
}
Game
library
using Goo;
using Sandbox.UI;
namespace Sandbox;
public class CounterUI : GooPanel<Container>
{
private int _count;
protected override Container Build() => new Container
{
Padding = 16,
Width = 128,
Height = 128,
BackgroundColor = Color.White,
BorderRadius = 12,
FlexDirection = FlexDirection.Row,
Gap = 12,
AlignItems = Align.Center,
Children =
{
new Text(_count.ToString()),
new Container
{
Padding = 8,
BackgroundColor = Color.Orange,
HoverBackgroundColor = Color.Cyan,
BorderRadius = 6,
OnClick = e => { _count++; Rebuild(); },
Children = { new Text("+") },
},
},
};
}
Game
library
// <auto-generated />
// Generated by tools/StyleFacadeEmit. Do not edit by hand.
// Source of truth: tools/StyleFacadeEmit/style-manifest.json
using Sandbox;
using Sandbox.Rendering;
using Sandbox.UI;
namespace Goo;
public readonly partial record struct Arc
{
public Length? Width { init => _style = StyleAccumulator.Add(_style, StyleField.Width, value); }
public Length? Height { init => _style = StyleAccumulator.Add(_style, StyleField.Height, value); }
public Length? Margin { init => _style = StyleAccumulator.Add(_style, StyleField.Margin, value); }
public Length? MarginLeft { init => _style = StyleAccumulator.Add(_style, StyleField.MarginLeft, value); }
public Length? MarginTop { init => _style = StyleAccumulator.Add(_style, StyleField.MarginTop, value); }
public Length? MarginRight { init => _style = StyleAccumulator.Add(_style, StyleField.MarginRight, value); }
public Length? MarginBottom { init => _style = StyleAccumulator.Add(_style, StyleField.MarginBottom, value); }
public Color? BackgroundColor { init => _style = StyleAccumulator.Add(_style, StyleField.BackgroundColor, value, StyleValue.FromColor); }
public Color? BackgroundTint { init => _style = StyleAccumulator.Add(_style, StyleField.BackgroundTint, value, StyleValue.FromColor); }
public Length? Bottom { init => _style = StyleAccumulator.Add(_style, StyleField.Bottom, value); }
public Length? Left { init => _style = StyleAccumulator.Add(_style, StyleField.Left, value); }
public Length? Right { init => _style = StyleAccumulator.Add(_style, StyleField.Right, value); }
public Length? Top { init => _style = StyleAccumulator.Add(_style, StyleField.Top, value); }
public Length? FlexBasis { init => _style = StyleAccumulator.Add(_style, StyleField.FlexBasis, value); }
public float? FlexGrow { init => _style = StyleAccumulator.Add(_style, StyleField.FlexGrow, value); }
public float? FlexShrink { init => _style = StyleAccumulator.Add(_style, StyleField.FlexShrink, value); }
public Length? MaxHeight { init => _style = StyleAccumulator.Add(_style, StyleField.MaxHeight, value); }
public Length? MaxWidth { init => _style = StyleAccumulator.Add(_style, StyleField.MaxWidth, value); }
public Length? MinHeight { init => _style = StyleAccumulator.Add(_style, StyleField.MinHeight, value); }
public Length? MinWidth { init => _style = StyleAccumulator.Add(_style, StyleField.MinWidth, value); }
public float? Opacity { init => _style = StyleAccumulator.Add(_style, StyleField.Opacity, value); }
public PointerEvents? PointerEvents { init => _style = StyleAccumulator.Add(_style, StyleField.PointerEvents, value, StyleValue.FromPointerEvents); }
public PositionMode? Position { init => _style = StyleAccumulator.Add(_style, StyleField.Position, value, StyleValue.FromPositionMode); }
public Goo.PanelTransform? Transform { init => _style = StyleAccumulator.Add(_style, StyleField.Transform, value, StyleValue.FromPanelTransform); }
}
Game
library
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using Sandbox;
namespace Goo;
internal sealed class Fiber
{
public BlobKind Kind;
public string? Key;
public string Content = "";
public StyleList Style = StyleList.Empty;
public List<Fiber>? Children;
public Texture? Texture;
public string? Path; // Image (texture path), ScenePanel (.scene path), SvgPanel (svg path), or WebPanel (URL)
public Scene? Scene;
public bool RenderOnce;
public bool Paused; // WebPanel only
public string? Color;
// TextEntry-only carry-fields. Path slot is reused for the text value.
public string? Placeholder;
public int? MaxLength;
public bool Disabled;
public bool Numeric;
public float? MinValue;
public float? MaxValue;
public string? NumberFormat;
public bool Multiline;
public int? MinLength;
public string? CharacterRegex;
public string? StringRegex;
public Func<char, bool>? CanEnterChar;
public Func<string, bool>? Validate;
public Action<bool>? OnValidationChanged;
public Action<string>? OnChange;
public Action<string>? OnSubmit;
public Action? OnFocus;
public Action<string>? OnBlur;
public Action? OnCancel;
public bool IsControlled;
public BlobEvents PrevEvents;
public ShapeParams Shape; // Sector / Arc only
public Vector2[]? Points; // Polygon only
// Custom-shader channel (Container only). Previous-render snapshot for delta comparison.
public ShaderEffect? Effect;
// Custom-draw callback (Container only). Previous-render snapshot for delta comparison.
public DrawCallback? Draw;
// Declared layout-move transition (Container only). Previous-render snapshot for delta comparison.
public LayoutTransition? LayoutTransition;
public object? Instance; // Cell only: the persistent self-owning state instance
}
Game
library
using Sandbox;
using Sandbox.UI;
using EngineEntry = Sandbox.UI.PanelTransform.Entry;
using EngineEntryType = Sandbox.UI.PanelTransform.EntryType;
namespace Goo;
/// <summary>Instance fluent chain methods for <see cref="PanelTransform"/>, each returning a new value with the entry appended (extensions because C# forbids same-name static and instance methods on one type).</summary>
public static class PanelTransformExtensions
{
public static PanelTransform Translate(this PanelTransform t, Length x, Length y)
=> t.Append(new EngineEntry { Type = EngineEntryType.Translate, X = x, Y = y });
public static PanelTransform Translate(this PanelTransform t, Length x, Length y, Length z)
=> t.Append(new EngineEntry { Type = EngineEntryType.Translate, X = x, Y = y, Z = z });
public static PanelTransform TranslateX(this PanelTransform t, Length x)
=> t.Append(new EngineEntry { Type = EngineEntryType.Translate, X = x });
public static PanelTransform TranslateY(this PanelTransform t, Length y)
=> t.Append(new EngineEntry { Type = EngineEntryType.Translate, Y = y });
public static PanelTransform TranslateZ(this PanelTransform t, Length z)
=> t.Append(new EngineEntry { Type = EngineEntryType.Translate, Z = z });
public static PanelTransform Rotate(this PanelTransform t, float zDegrees)
=> t.Append(new EngineEntry { Type = EngineEntryType.Rotation, Data = new Vector3(0f, 0f, zDegrees) });
public static PanelTransform Rotate(this PanelTransform t, float xDeg, float yDeg, float zDeg)
=> t.Append(new EngineEntry { Type = EngineEntryType.Rotation, Data = new Vector3(xDeg, yDeg, zDeg) });
public static PanelTransform RotateX(this PanelTransform t, float deg)
=> t.Append(new EngineEntry { Type = EngineEntryType.Rotation, Data = new Vector3(deg, 0f, 0f) });
public static PanelTransform RotateY(this PanelTransform t, float deg)
=> t.Append(new EngineEntry { Type = EngineEntryType.Rotation, Data = new Vector3(0f, deg, 0f) });
public static PanelTransform RotateZ(this PanelTransform t, float deg)
=> t.Append(new EngineEntry { Type = EngineEntryType.Rotation, Data = new Vector3(0f, 0f, deg) });
public static PanelTransform Scale(this PanelTransform t, float uniform)
=> t.Append(new EngineEntry { Type = EngineEntryType.Scale, Data = new Vector3(uniform, uniform, uniform) });
public static PanelTransform Scale(this PanelTransform t, Vector3 scale)
=> t.Append(new EngineEntry { Type = EngineEntryType.Scale, Data = scale });
public static PanelTransform ScaleX(this PanelTransform t, float s)
=> t.Append(new EngineEntry { Type = EngineEntryType.Scale, Data = new Vector3(s, 1f, 1f) });
public static PanelTransform ScaleY(this PanelTransform t, float s)
=> t.Append(new EngineEntry { Type = EngineEntryType.Scale, Data = new Vector3(1f, s, 1f) });
public static PanelTransform ScaleZ(this PanelTransform t, float s)
=> t.Append(new EngineEntry { Type = EngineEntryType.Scale, Data = new Vector3(1f, 1f, s) });
public static PanelTransform Skew(this PanelTransform t, float xDeg, float yDeg)
=> t.Append(new EngineEntry { Type = EngineEntryType.Skew, Data = new Vector3(xDeg, yDeg, 0f) });
public static PanelTransform SkewX(this PanelTransform t, float deg)
=> t.Append(new EngineEntry { Type = EngineEntryType.Skew, Data = new Vector3(deg, 0f, 0f) });
public static PanelTransform SkewY(this PanelTransform t, float deg)
=> t.Append(new EngineEntry { Type = EngineEntryType.Skew, Data = new Vector3(0f, deg, 0f) });
public static PanelTransform Perspective(this PanelTransform t, Length d)
=> t.Append(new EngineEntry { Type = EngineEntryType.Perspective, X = d });
public static PanelTransform Matrix3D(this PanelTransform t, Matrix m)
=> t.Append(new EngineEntry { Type = EngineEntryType.Matrix, Matrix = m });
}
Debug: View Raw JSON Response
{
"TotalCount": 95,
"Files": [
{
"Ident": "xaz.gooui",
"Path": "Animation/SmoothVector2.cs",
"FileName": "SmoothVector2.cs",
"PackageType": "library",
"CodeKind": "Game",
"AssetVersionId": 301556,
"IsPrivate": false,
"Code": "using System;\nusing Sandbox;\n\nnamespace Goo.Animation;\n\npublic record struct SmoothVector2\n{\n public Vector2 Current;\n public Vector2 Target;\n public Vector2 Velocity;\n public float SmoothTime;\n\n public SmoothVector2(Vector2 initial, float smoothTime)\n {\n Current = initial;\n Target = initial;\n Velocity = default;\n SmoothTime = smoothTime;\n }\n\n public void Update(float dt)\n {\n float vx = Velocity.x, vy = Velocity.y;\n Current = new Vector2(\n MathX.SmoothDamp(Current.x, Target.x, ref vx, SmoothTime, dt),\n MathX.SmoothDamp(Current.y, Target.y, ref vy, SmoothTime, dt));\n Velocity = new Vector2(vx, vy);\n }\n\n public bool IsSettled =>\n MathF.Abs(Target.x - Current.x) < 0.0001f &&\n MathF.Abs(Target.y - Current.y) < 0.0001f &&\n MathF.Abs(Velocity.x) < 0.0001f &&\n MathF.Abs(Velocity.y) < 0.0001f;\n\n /// <summary>Advances by dt and returns true while still moving; chain calls with | (not ||) so every damper advances each frame.</summary>\n public bool Tick(float dt) { Update(dt); return !IsSettled; }\n}\n"
},
{
"Ident": "xaz.gooui",
"Path": "Animation/Tween.cs",
"FileName": "Tween.cs",
"PackageType": "library",
"CodeKind": "Game",
"AssetVersionId": 301556,
"IsPrivate": false,
"Code": "using System;\r\n\r\nnamespace Goo.Animation;\r\n\r\npublic readonly record struct Tween\r\n{\r\n public Sandbox.Utility.Easing.Function Easing { get; init; }\r\n public float Duration { get; init; }\r\n public float Delay { get; init; }\r\n public float SpeedScale { get; init; }\r\n public int Iterations { get; init; }\r\n public bool PingPong { get; init; }\r\n public bool Reversed { get; init; }\r\n\r\n public Tween(Sandbox.Utility.Easing.Function easing, float duration, float delay = 0f)\r\n {\r\n Easing = easing;\r\n Duration = duration;\r\n Delay = delay;\r\n SpeedScale = 1f;\r\n Iterations = 1;\r\n PingPong = false;\r\n Reversed = false;\r\n }\r\n\r\n /// <summary>\r\n /// Bridge a designer-authored Sandbox.Curve (authored over [0, 1]) into a Tween.\r\n /// Allocates one delegate per call; cache the result in a static readonly field.\r\n /// </summary>\r\n public static Tween FromCurve(Sandbox.Curve curve, float duration, float delay = 0f)\r\n => new Tween(curve.Evaluate, duration, delay);\r\n\r\n public float Eval(float elapsedSec)\r\n {\r\n if (Duration <= 0f) return Reversed ? 0f : 1f;\r\n\r\n float t = (elapsedSec - Delay) * SpeedScale;\r\n if (t <= 0f) return Reversed ? 1f : 0f;\r\n\r\n float cycleDuration = PingPong ? 2f * Duration : Duration;\r\n\r\n if (Iterations > 0 && t >= cycleDuration * Iterations)\r\n {\r\n float endLocal = PingPong ? 0f : 1f;\r\n if (Reversed) endLocal = 1f - endLocal;\r\n return Easing(endLocal);\r\n }\r\n\r\n float cycleT = t % cycleDuration;\r\n float local = PingPong\r\n ? (cycleT < Duration ? cycleT / Duration : 1f - (cycleT - Duration) / Duration)\r\n : cycleT / Duration;\r\n\r\n if (Reversed) local = 1f - local;\r\n return Easing(local);\r\n }\r\n}\r\n\r\npublic static class TweenExtensions\r\n{\r\n public static Tween Loop(this Tween t) => t with { Iterations = -1 };\r\n public static Tween Times(this Tween t, int n) => t with { Iterations = n };\r\n public static Tween PingPong(this Tween t) => t with { PingPong = true };\r\n public static Tween Scale(this Tween t, float speed) => t with { SpeedScale = speed };\r\n public static Tween WithDelay(this Tween t, float s) => t with { Delay = s };\r\n public static Tween Reverse(this Tween t) => t with { Reversed = true };\r\n}\r\n"
},
{
"Ident": "xaz.gooui",
"Path": "Core/Children.cs",
"FileName": "Children.cs",
"PackageType": "library",
"CodeKind": "Game",
"AssetVersionId": 301556,
"IsPrivate": false,
"Code": "using System;\nusing System.Collections;\n\nnamespace Goo;\n\npublic sealed class Children : IEnumerable\n{\n internal FrameList? _list;\n internal int _buildId;\n internal Children() { }\n internal int Count { get { EnsureValid(); return _list!.Count; } }\n internal ref Frame this[int i] { get { EnsureValid(); return ref _list![i]; } }\n\n public void Add<T>(in T child) where T : struct, IBlob\n {\n EnsureValid();\n ref Frame slot = ref _list!.Reserve();\n child.WriteTo(ref slot);\n }\n\n void EnsureValid()\n {\n var ctx = BuildContext._current;\n if (ctx == null || _list == null || _buildId != ctx._currentBuildId)\n throw new InvalidOperationException(\n \"Container reused across rebuilds. The same Container instance cannot survive \" +\n \"past the Build() it was created in. Build a new one inside Build(), or extract \" +\n \"a helper function that returns a fresh Container each call.\");\n }\n\n // IEnumerable is required by C# collection-initializer syntax; iteration is not a\n // use case for Children, so this returns an empty enumerator.\n IEnumerator IEnumerable.GetEnumerator() => Array.Empty<object>().GetEnumerator();\n}\n"
},
{
"Ident": "xaz.gooui",
"Path": "Core/IBlob.cs",
"FileName": "IBlob.cs",
"PackageType": "library",
"CodeKind": "Game",
"AssetVersionId": 301556,
"IsPrivate": false,
"Code": "\r\nnamespace Goo;\r\n\r\n/// <summary>Compile-time constraint for blob struct types. Never use as storage, return, or parameter type (boxes the struct, destroys per-Rebuild allocation profile); only valid in where T : struct, IBlob.</summary>\r\npublic interface IBlob\r\n{\r\n static abstract BlobKind Kind { get; }\r\n string? Key { get; }\r\n internal void WriteTo(ref Frame frame);\r\n}\r\n\r\n/// <summary>Returns the single root Blob for a GooView build. A named delegate rather than\r\n/// Func<IBlob> because IBlob has a static-abstract member (Kind) and C# bars such interfaces\r\n/// as generic type arguments (CS8920). Consequence for Razor markup: a bare method group cannot\r\n/// bind (its natural type is the illegal Func<IBlob>), so write\r\n/// <c>Build=@(new BlobBuilder(MyBuild))</c>. See docs/site/docs/gotchas.md.</summary>\r\npublic delegate IBlob BlobBuilder();\r\n"
},
{
"Ident": "xaz.gooui",
"Path": "Core/Text.Style.g.cs",
"FileName": "Text.Style.g.cs",
"PackageType": "library",
"CodeKind": "Game",
"AssetVersionId": 301556,
"IsPrivate": false,
"Code": "// <auto-generated />\r\n// Generated by tools/StyleFacadeEmit. Do not edit by hand.\r\n// Source of truth: tools/StyleFacadeEmit/style-manifest.json\r\nusing Sandbox;\r\nusing Sandbox.Rendering;\r\nusing Sandbox.UI;\r\n\r\nnamespace Goo;\r\n\r\npublic readonly partial record struct Text\r\n{\r\n public Length? Width { init => _style = StyleAccumulator.Add(_style, StyleField.Width, value); }\r\n public Length? Height { init => _style = StyleAccumulator.Add(_style, StyleField.Height, value); }\r\n public Length? Margin { init => _style = StyleAccumulator.Add(_style, StyleField.Margin, value); }\r\n public Length? MarginLeft { init => _style = StyleAccumulator.Add(_style, StyleField.MarginLeft, value); }\r\n public Length? MarginTop { init => _style = StyleAccumulator.Add(_style, StyleField.MarginTop, value); }\r\n public Length? MarginRight { init => _style = StyleAccumulator.Add(_style, StyleField.MarginRight, value); }\r\n public Length? MarginBottom { init => _style = StyleAccumulator.Add(_style, StyleField.MarginBottom, value); }\r\n public Color? BackgroundColor { init => _style = StyleAccumulator.Add(_style, StyleField.BackgroundColor, value, StyleValue.FromColor); }\r\n public Color? BackgroundTint { init => _style = StyleAccumulator.Add(_style, StyleField.BackgroundTint, value, StyleValue.FromColor); }\r\n public Length? FlexBasis { init => _style = StyleAccumulator.Add(_style, StyleField.FlexBasis, value); }\r\n public float? FlexGrow { init => _style = StyleAccumulator.Add(_style, StyleField.FlexGrow, value); }\r\n public float? FlexShrink { init => _style = StyleAccumulator.Add(_style, StyleField.FlexShrink, value); }\r\n public Color? FontColor { init => _style = StyleAccumulator.Add(_style, StyleField.FontColor, value, StyleValue.FromColor); }\r\n public string? FontFamily { init => _style = StyleAccumulator.Add(_style, StyleField.FontFamily, value); }\r\n public Length? FontSize { init => _style = StyleAccumulator.Add(_style, StyleField.FontSize, value); }\r\n public FontSmooth? FontSmooth { init => _style = StyleAccumulator.Add(_style, StyleField.FontSmooth, value, StyleValue.FromFontSmooth); }\r\n public FontStyle? FontStyle { init => _style = StyleAccumulator.Add(_style, StyleField.FontStyle, value, StyleValue.FromFontStyle); }\r\n public FontVariantNumeric? FontVariantNumeric { init => _style = StyleAccumulator.Add(_style, StyleField.FontVariantNumeric, value, StyleValue.FromFontVariantNumeric); }\r\n public int? FontWeight { init => _style = StyleAccumulator.Add(_style, StyleField.FontWeight, value); }\r\n public Length? LetterSpacing { init => _style = StyleAccumulator.Add(_style, StyleField.LetterSpacing, value); }\r\n public Length? LineHeight { init => _style = StyleAccumulator.Add(_style, StyleField.LineHeight, value); }\r\n public Length? MaxHeight { init => _style = StyleAccumulator.Add(_style, StyleField.MaxHeight, value); }\r\n public Length? MaxWidth { init => _style = StyleAccumulator.Add(_style, StyleField.MaxWidth, value); }\r\n public Length? MinHeight { init => _style = StyleAccumulator.Add(_style, StyleField.MinHeight, value); }\r\n public Length? MinWidth { init => _style = StyleAccumulator.Add(_style, StyleField.MinWidth, value); }\r\n public float? Opacity { init => _style = StyleAccumulator.Add(_style, StyleField.Opacity, value); }\r\n public TextAlign? TextAlign { init => _style = StyleAccumulator.Add(_style, StyleField.TextAlign, value, StyleValue.FromTextAlign); }\r\n public Length? TextBackgroundAngle { init => _style = StyleAccumulator.Add(_style, StyleField.TextBackgroundAngle, value); }\r\n public Color? TextDecorationColor { init => _style = StyleAccumulator.Add(_style, StyleField.TextDecorationColor, value, StyleValue.FromColor); }\r\n public TextDecoration? TextDecorationLine { init => _style = StyleAccumulator.Add(_style, StyleField.TextDecorationLine, value, StyleValue.FromTextDecoration); }\r\n public TextSkipInk? TextDecorationSkipInk { init => _style = StyleAccumulator.Add(_style, StyleField.TextDecorationSkipInk, value, StyleValue.FromTextSkipInk); }\r\n public TextDecorationStyle? TextDecorationStyle { init => _style = StyleAccumulator.Add(_style, StyleField.TextDecorationStyle, value, StyleValue.FromTextDecorationStyle); }\r\n public Length? TextDecorationThickness { init => _style = StyleAccumulator.Add(_style, StyleField.TextDecorationThickness, value); }\r\n public FilterMode? TextFilter { init => _style = StyleAccumulator.Add(_style, StyleField.TextFilter, value, StyleValue.FromFilterMode); }\r\n public Length? TextLineThroughOffset { init => _style = StyleAccumulator.Add(_style, StyleField.TextLineThroughOffset, value); }\r\n public TextOverflow? TextOverflow { init => _style = StyleAccumulator.Add(_style, StyleField.TextOverflow, value, StyleValue.FromTextOverflow); }\r\n public Length? TextOverlineOffset { init => _style = StyleAccumulator.Add(_style, StyleField.TextOverlineOffset, value); }\r\n public Color? TextStrokeColor { init => _style = StyleAccumulator.Add(_style, StyleField.TextStrokeColor, value, StyleValue.FromColor); }\r\n public Length? TextStrokeWidth { init => _style = StyleAccumulator.Add(_style, StyleField.TextStrokeWidth, value); }\r\n public TextTransform? TextTransform { init => _style = StyleAccumulator.Add(_style, StyleField.TextTransform, value, StyleValue.FromTextTransform); }\r\n public Length? TextUnderlineOffset { init => _style = StyleAccumulator.Add(_style, StyleField.TextUnderlineOffset, value); }\r\n public Goo.PanelTransform? Transform { init => _style = StyleAccumulator.Add(_style, StyleField.Transform, value, StyleValue.FromPanelTransform); }\r\n public WhiteSpace? WhiteSpace { init => _style = StyleAccumulator.Add(_style, StyleField.WhiteSpace, value, StyleValue.FromWhiteSpace); }\r\n public WordBreak? WordBreak { init => _style = StyleAccumulator.Add(_style, StyleField.WordBreak, value, StyleValue.FromWordBreak); }\r\n public Length? WordSpacing { init => _style = StyleAccumulator.Add(_style, StyleField.WordSpacing, value); }\r\n public Color? HoverBackgroundColor { init => _style = StyleAccumulator.Add(_style, StyleField.HoverBackgroundColor, value, StyleValue.FromColor); }\r\n public Color? ActiveBackgroundColor { init => _style = StyleAccumulator.Add(_style, StyleField.ActiveBackgroundColor, value, StyleValue.FromColor); }\r\n public Color? FocusBackgroundColor { init => _style = StyleAccumulator.Add(_style, StyleField.FocusBackgroundColor, value, StyleValue.FromColor); }\r\n public Color? HoverFontColor { init => _style = StyleAccumulator.Add(_style, StyleField.HoverFontColor, value, StyleValue.FromColor); }\r\n public Color? ActiveFontColor { init => _style = StyleAccumulator.Add(_style, StyleField.ActiveFontColor, value, StyleValue.FromColor); }\r\n public Color? FocusFontColor { init => _style = StyleAccumulator.Add(_style, StyleField.FocusFontColor, value, StyleValue.FromColor); }\r\n public int? TransitionMs { init => _style = StyleAccumulator.Add(_style, StyleField.TransitionMs, value); }\r\n}\r\n"
},
{
"Ident": "xaz.gooui",
"Path": "Core/TextEntry.Style.g.cs",
"FileName": "TextEntry.Style.g.cs",
"PackageType": "library",
"CodeKind": "Game",
"AssetVersionId": 301556,
"IsPrivate": false,
"Code": "// <auto-generated />\r\n// Generated by tools/StyleFacadeEmit. Do not edit by hand.\r\n// Source of truth: tools/StyleFacadeEmit/style-manifest.json\r\nusing Sandbox;\r\nusing Sandbox.Rendering;\r\nusing Sandbox.UI;\r\n\r\nnamespace Goo;\r\n\r\npublic readonly partial record struct TextEntry\r\n{\r\n public FlexDirection? FlexDirection { init => _style = StyleAccumulator.Add(_style, StyleField.FlexDirection, value, StyleValue.FromFlexDirection); }\r\n public Justify? JustifyContent { init => _style = StyleAccumulator.Add(_style, StyleField.JustifyContent, value, StyleValue.FromJustify); }\r\n public Align? AlignItems { init => _style = StyleAccumulator.Add(_style, StyleField.AlignItems, value, StyleValue.FromAlign); }\r\n public DisplayMode? Display { init => _style = StyleAccumulator.Add(_style, StyleField.Display, value, StyleValue.FromDisplay); }\r\n public Length? Width { init => _style = StyleAccumulator.Add(_style, StyleField.Width, value); }\r\n public Length? Height { init => _style = StyleAccumulator.Add(_style, StyleField.Height, value); }\r\n public Length? Padding { init => _style = StyleAccumulator.Add(_style, StyleField.Padding, value); }\r\n public Length? PaddingLeft { init => _style = StyleAccumulator.Add(_style, StyleField.PaddingLeft, value); }\r\n public Length? PaddingTop { init => _style = StyleAccumulator.Add(_style, StyleField.PaddingTop, value); }\r\n public Length? PaddingRight { init => _style = StyleAccumulator.Add(_style, StyleField.PaddingRight, value); }\r\n public Length? PaddingBottom { init => _style = StyleAccumulator.Add(_style, StyleField.PaddingBottom, value); }\r\n public Length? Margin { init => _style = StyleAccumulator.Add(_style, StyleField.Margin, value); }\r\n public Length? MarginLeft { init => _style = StyleAccumulator.Add(_style, StyleField.MarginLeft, value); }\r\n public Length? MarginTop { init => _style = StyleAccumulator.Add(_style, StyleField.MarginTop, value); }\r\n public Length? MarginRight { init => _style = StyleAccumulator.Add(_style, StyleField.MarginRight, value); }\r\n public Length? MarginBottom { init => _style = StyleAccumulator.Add(_style, StyleField.MarginBottom, value); }\r\n public Length? Gap { init => _style = StyleAccumulator.Add(_style, StyleField.Gap, value); }\r\n public Length? RowGap { init => _style = StyleAccumulator.Add(_style, StyleField.RowGap, value); }\r\n public Length? ColumnGap { init => _style = StyleAccumulator.Add(_style, StyleField.ColumnGap, value); }\r\n public Color? BackgroundColor { init => _style = StyleAccumulator.Add(_style, StyleField.BackgroundColor, value, StyleValue.FromColor); }\r\n public Length? BorderRadius { init => _style = StyleAccumulator.Add(_style, StyleField.BorderRadius, value); }\r\n public Length? BorderTopLeftRadius { init => _style = StyleAccumulator.Add(_style, StyleField.BorderTopLeftRadius, value); }\r\n public Length? BorderTopRightRadius { init => _style = StyleAccumulator.Add(_style, StyleField.BorderTopRightRadius, value); }\r\n public Length? BorderBottomRightRadius { init => _style = StyleAccumulator.Add(_style, StyleField.BorderBottomRightRadius, value); }\r\n public Length? BorderBottomLeftRadius { init => _style = StyleAccumulator.Add(_style, StyleField.BorderBottomLeftRadius, value); }\r\n public Align? AlignContent { init => _style = StyleAccumulator.Add(_style, StyleField.AlignContent, value, StyleValue.FromAlign); }\r\n public Align? AlignSelf { init => _style = StyleAccumulator.Add(_style, StyleField.AlignSelf, value, StyleValue.FromAlign); }\r\n public float? AspectRatio { init => _style = StyleAccumulator.Add(_style, StyleField.AspectRatio, value); }\r\n public Length? BackdropFilterBlur { init => _style = StyleAccumulator.Add(_style, StyleField.BackdropFilterBlur, value); }\r\n public Length? BackdropFilterBrightness { init => _style = StyleAccumulator.Add(_style, StyleField.BackdropFilterBrightness, value); }\r\n public Length? BackdropFilterContrast { init => _style = StyleAccumulator.Add(_style, StyleField.BackdropFilterContrast, value); }\r\n public Length? BackdropFilterHueRotate { init => _style = StyleAccumulator.Add(_style, StyleField.BackdropFilterHueRotate, value); }\r\n public Length? BackdropFilterInvert { init => _style = StyleAccumulator.Add(_style, StyleField.BackdropFilterInvert, value); }\r\n public Length? BackdropFilterSaturate { init => _style = StyleAccumulator.Add(_style, StyleField.BackdropFilterSaturate, value); }\r\n public Length? BackdropFilterSepia { init => _style = StyleAccumulator.Add(_style, StyleField.BackdropFilterSepia, value); }\r\n public Length? BackgroundAngle { init => _style = StyleAccumulator.Add(_style, StyleField.BackgroundAngle, value); }\r\n public string? BackgroundBlendMode { init => _style = StyleAccumulator.Add(_style, StyleField.BackgroundBlendMode, value); }\r\n public Texture? BackgroundImage { init => _style = StyleAccumulator.Add(_style, StyleField.BackgroundImage, value); }\r\n public bool? BackgroundPlaybackPaused { init => _style = StyleAccumulator.Add(_style, StyleField.BackgroundPlaybackPaused, value); }\r\n public Length? BackgroundPositionX { init => _style = StyleAccumulator.Add(_style, StyleField.BackgroundPositionX, value); }\r\n public Length? BackgroundPositionY { init => _style = StyleAccumulator.Add(_style, StyleField.BackgroundPositionY, value); }\r\n public BackgroundRepeat? BackgroundRepeat { init => _style = StyleAccumulator.Add(_style, StyleField.BackgroundRepeat, value, StyleValue.FromBackgroundRepeat); }\r\n public Length? BackgroundSizeX { init => _style = StyleAccumulator.Add(_style, StyleField.BackgroundSizeX, value); }\r\n public Length? BackgroundSizeY { init => _style = StyleAccumulator.Add(_style, StyleField.BackgroundSizeY, value); }\r\n public Color? BackgroundTint { init => _style = StyleAccumulator.Add(_style, StyleField.BackgroundTint, value, StyleValue.FromColor); }\r\n public Color? BorderBottomColor { init => _style = StyleAccumulator.Add(_style, StyleField.BorderBottomColor, value, StyleValue.FromColor); }\r\n public Color? BorderColor { init => _style = StyleAccumulator.Add(_style, StyleField.BorderColor, value, StyleValue.FromColor); }\r\n public Color? BorderLeftColor { init => _style = StyleAccumulator.Add(_style, StyleField.BorderLeftColor, value, StyleValue.FromColor); }\r\n public Color? BorderRightColor { init => _style = StyleAccumulator.Add(_style, StyleField.BorderRightColor, value, StyleValue.FromColor); }\r\n public Color? BorderTopColor { init => _style = StyleAccumulator.Add(_style, StyleField.BorderTopColor, value, StyleValue.FromColor); }\r\n public BorderImageFill? BorderImageFill { init => _style = StyleAccumulator.Add(_style, StyleField.BorderImageFill, value, StyleValue.FromBorderImageFill); }\r\n public BorderImageRepeat? BorderImageRepeat { init => _style = StyleAccumulator.Add(_style, StyleField.BorderImageRepeat, value, StyleValue.FromBorderImageRepeat); }\r\n public Texture? BorderImageSource { init => _style = StyleAccumulator.Add(_style, StyleField.BorderImageSource, value); }\r\n public Color? BorderImageTint { init => _style = StyleAccumulator.Add(_style, StyleField.BorderImageTint, value, StyleValue.FromColor); }\r\n public Length? BorderImageWidthBottom { init => _style = StyleAccumulator.Add(_style, StyleField.BorderImageWidthBottom, value); }\r\n public Length? BorderImageWidthLeft { init => _style = StyleAccumulator.Add(_style, StyleField.BorderImageWidthLeft, value); }\r\n public Length? BorderImageWidthRight { init => _style = StyleAccumulator.Add(_style, StyleField.BorderImageWidthRight, value); }\r\n public Length? BorderImageWidthTop { init => _style = StyleAccumulator.Add(_style, StyleField.BorderImageWidthTop, value); }\r\n public Length? BorderBottomWidth { init => _style = StyleAccumulator.Add(_style, StyleField.BorderBottomWidth, value); }\r\n public Length? BorderLeftWidth { init => _style = StyleAccumulator.Add(_style, StyleField.BorderLeftWidth, value); }\r\n public Length? BorderRightWidth { init => _style = StyleAccumulator.Add(_style, StyleField.BorderRightWidth, value); }\r\n public Length? BorderTopWidth { init => _style = StyleAccumulator.Add(_style, StyleField.BorderTopWidth, value); }\r\n public Length? BorderWidth { init => _style = StyleAccumulator.Add(_style, StyleField.BorderWidth, value); }\r\n public Length? Bottom { init => _style = StyleAccumulator.Add(_style, StyleField.Bottom, value); }\r\n public Length? Left { init => _style = StyleAccumulator.Add(_style, StyleField.Left, value); }\r\n public Length? Right { init => _style = StyleAccumulator.Add(_style, StyleField.Right, value); }\r\n public Length? Top { init => _style = StyleAccumulator.Add(_style, StyleField.Top, value); }\r\n public Color? CaretColor { init => _style = StyleAccumulator.Add(_style, StyleField.CaretColor, value, StyleValue.FromColor); }\r\n public string? Cursor { init => _style = StyleAccumulator.Add(_style, StyleField.Cursor, value); }\r\n public Length? FilterBlur { init => _style = StyleAccumulator.Add(_style, StyleField.FilterBlur, value); }\r\n public Color? FilterBorderColor { init => _style = StyleAccumulator.Add(_style, StyleField.FilterBorderColor, value, StyleValue.FromColor); }\r\n public Length? FilterBorderWidth { init => _style = StyleAccumulator.Add(_style, StyleField.FilterBorderWidth, value); }\r\n public Length? FilterBrightness { init => _style = StyleAccumulator.Add(_style, StyleField.FilterBrightness, value); }\r\n public Length? FilterContrast { init => _style = StyleAccumulator.Add(_style, StyleField.FilterContrast, value); }\r\n public Length? FilterHueRotate { init => _style = StyleAccumulator.Add(_style, StyleField.FilterHueRotate, value); }\r\n public Length? FilterInvert { init => _style = StyleAccumulator.Add(_style, StyleField.FilterInvert, value); }\r\n public Length? FilterSaturate { init => _style = StyleAccumulator.Add(_style, StyleField.FilterSaturate, value); }\r\n public Length? FilterSepia { init => _style = StyleAccumulator.Add(_style, StyleField.FilterSepia, value); }\r\n public Color? FilterTint { init => _style = StyleAccumulator.Add(_style, StyleField.FilterTint, value, StyleValue.FromColor); }\r\n public Length? FlexBasis { init => _style = StyleAccumulator.Add(_style, StyleField.FlexBasis, value); }\r\n public float? FlexGrow { init => _style = StyleAccumulator.Add(_style, StyleField.FlexGrow, value); }\r\n public float? FlexShrink { init => _style = StyleAccumulator.Add(_style, StyleField.FlexShrink, value); }\r\n public Wrap? FlexWrap { init => _style = StyleAccumulator.Add(_style, StyleField.FlexWrap, value, StyleValue.FromWrap); }\r\n public Color? FontColor { init => _style = StyleAccumulator.Add(_style, StyleField.FontColor, value, StyleValue.FromColor); }\r\n public string? FontFamily { init => _style = StyleAccumulator.Add(_style, StyleField.FontFamily, value); }\r\n public Length? FontSize { init => _style = StyleAccumulator.Add(_style, StyleField.FontSize, value); }\r\n public FontSmooth? FontSmooth { init => _style = StyleAccumulator.Add(_style, StyleField.FontSmooth, value, StyleValue.FromFontSmooth); }\r\n public FontStyle? FontStyle { init => _style = StyleAccumulator.Add(_style, StyleField.FontStyle, value, StyleValue.FromFontStyle); }\r\n public FontVariantNumeric? FontVariantNumeric { init => _style = StyleAccumulator.Add(_style, StyleField.FontVariantNumeric, value, StyleValue.FromFontVariantNumeric); }\r\n public int? FontWeight { init => _style = StyleAccumulator.Add(_style, StyleField.FontWeight, value); }\r\n public ImageRendering? ImageRendering { init => _style = StyleAccumulator.Add(_style, StyleField.ImageRendering, value, StyleValue.FromImageRendering); }\r\n public Length? LetterSpacing { init => _style = StyleAccumulator.Add(_style, StyleField.LetterSpacing, value); }\r\n public Length? LineHeight { init => _style = StyleAccumulator.Add(_style, StyleField.LineHeight, value); }\r\n public Length? MaskAngle { init => _style = StyleAccumulator.Add(_style, StyleField.MaskAngle, value); }\r\n public Texture? MaskImage { init => _style = StyleAccumulator.Add(_style, StyleField.MaskImage, value); }\r\n public MaskMode? MaskMode { init => _style = StyleAccumulator.Add(_style, StyleField.MaskMode, value, StyleValue.FromMaskMode); }\r\n public Length? MaskPositionX { init => _style = StyleAccumulator.Add(_style, StyleField.MaskPositionX, value); }\r\n public Length? MaskPositionY { init => _style = StyleAccumulator.Add(_style, StyleField.MaskPositionY, value); }\r\n public BackgroundRepeat? MaskRepeat { init => _style = StyleAccumulator.Add(_style, StyleField.MaskRepeat, value, StyleValue.FromBackgroundRepeat); }\r\n public MaskScope? MaskScope { init => _style = StyleAccumulator.Add(_style, StyleField.MaskScope, value, StyleValue.FromMaskScope); }\r\n public Length? MaskSizeX { init => _style = StyleAccumulator.Add(_style, StyleField.MaskSizeX, value); }\r\n public Length? MaskSizeY { init => _style = StyleAccumulator.Add(_style, StyleField.MaskSizeY, value); }\r\n public Length? MaxHeight { init => _style = StyleAccumulator.Add(_style, StyleField.MaxHeight, value); }\r\n public Length? MaxWidth { init => _style = StyleAccumulator.Add(_style, StyleField.MaxWidth, value); }\r\n public Length? MinHeight { init => _style = StyleAccumulator.Add(_style, StyleField.MinHeight, value); }\r\n public Length? MinWidth { init => _style = StyleAccumulator.Add(_style, StyleField.MinWidth, value); }\r\n public string? MixBlendMode { init => _style = StyleAccumulator.Add(_style, StyleField.MixBlendMode, value); }\r\n public float? Opacity { init => _style = StyleAccumulator.Add(_style, StyleField.Opacity, value); }\r\n public int? Order { init => _style = StyleAccumulator.Add(_style, StyleField.Order, value); }\r\n public Color? OutlineColor { init => _style = StyleAccumulator.Add(_style, StyleField.OutlineColor, value, StyleValue.FromColor); }\r\n public Length? OutlineOffset { init => _style = StyleAccumulator.Add(_style, StyleField.OutlineOffset, value); }\r\n public Length? OutlineWidth { init => _style = StyleAccumulator.Add(_style, StyleField.OutlineWidth, value); }\r\n public OverflowMode? Overflow { init => _style = StyleAccumulator.Add(_style, StyleField.Overflow, value, StyleValue.FromOverflowMode); }\r\n public OverflowMode? OverflowX { init => _style = StyleAccumulator.Add(_style, StyleField.OverflowX, value, StyleValue.FromOverflowMode); }\r\n public OverflowMode? OverflowY { init => _style = StyleAccumulator.Add(_style, StyleField.OverflowY, value, StyleValue.FromOverflowMode); }\r\n public Length? PerspectiveOriginX { init => _style = StyleAccumulator.Add(_style, StyleField.PerspectiveOriginX, value); }\r\n public Length? PerspectiveOriginY { init => _style = StyleAccumulator.Add(_style, StyleField.PerspectiveOriginY, value); }\r\n public PointerEvents? PointerEvents { init => _style = StyleAccumulator.Add(_style, StyleField.PointerEvents, value, StyleValue.FromPointerEvents); }\r\n public PositionMode? Position { init => _style = StyleAccumulator.Add(_style, StyleField.Position, value, StyleValue.FromPositionMode); }\r\n public string? SoundIn { init => _style = StyleAccumulator.Add(_style, StyleField.SoundIn, value); }\r\n public string? SoundOut { init => _style = StyleAccumulator.Add(_style, StyleField.SoundOut, value); }\r\n public TextAlign? TextAlign { init => _style = StyleAccumulator.Add(_style, StyleField.TextAlign, value, StyleValue.FromTextAlign); }\r\n public Length? TextBackgroundAngle { init => _style = StyleAccumulator.Add(_style, StyleField.TextBackgroundAngle, value); }\r\n public Color? TextDecorationColor { init => _style = StyleAccumulator.Add(_style, StyleField.TextDecorationColor, value, StyleValue.FromColor); }\r\n public TextDecoration? TextDecorationLine { init => _style = StyleAccumulator.Add(_style, StyleField.TextDecorationLine, value, StyleValue.FromTextDecoration); }\r\n public TextSkipInk? TextDecorationSkipInk { init => _style = StyleAccumulator.Add(_style, StyleField.TextDecorationSkipInk, value, StyleValue.FromTextSkipInk); }\r\n public TextDecorationStyle? TextDecorationStyle { init => _style = StyleAccumulator.Add(_style, StyleField.TextDecorationStyle, value, StyleValue.FromTextDecorationStyle); }\r\n public Length? TextDecorationThickness { init => _style = StyleAccumulator.Add(_style, StyleField.TextDecorationThickness, value); }\r\n public FilterMode? TextFilter { init => _style = StyleAccumulator.Add(_style, StyleField.TextFilter, value, StyleValue.FromFilterMode); }\r\n public Length? TextLineThroughOffset { init => _style = StyleAccumulator.Add(_style, StyleField.TextLineThroughOffset, value); }\r\n public TextOverflow? TextOverflow { init => _style = StyleAccumulator.Add(_style, StyleField.TextOverflow, value, StyleValue.FromTextOverflow); }\r\n public Length? TextOverlineOffset { init => _style = StyleAccumulator.Add(_style, StyleField.TextOverlineOffset, value); }\r\n public Color? TextStrokeColor { init => _style = StyleAccumulator.Add(_style, StyleField.TextStrokeColor, value, StyleValue.FromColor); }\r\n public Length? TextStrokeWidth { init => _style = StyleAccumulator.Add(_style, StyleField.TextStrokeWidth, value); }\r\n public TextTransform? TextTransform { init => _style = StyleAccumulator.Add(_style, StyleField.TextTransform, value, StyleValue.FromTextTransform); }\r\n public Length? TextUnderlineOffset { init => _style = StyleAccumulator.Add(_style, StyleField.TextUnderlineOffset, value); }\r\n public Goo.PanelTransform? Transform { init => _style = StyleAccumulator.Add(_style, StyleField.Transform, value, StyleValue.FromPanelTransform); }\r\n public Length? TransformOriginX { init => _style = StyleAccumulator.Add(_style, StyleField.TransformOriginX, value); }\r\n public Length? TransformOriginY { init => _style = StyleAccumulator.Add(_style, StyleField.TransformOriginY, value); }\r\n public WhiteSpace? WhiteSpace { init => _style = StyleAccumulator.Add(_style, StyleField.WhiteSpace, value, StyleValue.FromWhiteSpace); }\r\n public WordBreak? WordBreak { init => _style = StyleAccumulator.Add(_style, StyleField.WordBreak, value, StyleValue.FromWordBreak); }\r\n public Length? WordSpacing { init => _style = StyleAccumulator.Add(_style, StyleField.WordSpacing, value); }\r\n public int? ZIndex { init => _style = StyleAccumulator.Add(_style, StyleField.ZIndex, value); }\r\n public Color? HoverBackgroundColor { init => _style = StyleAccumulator.Add(_style, StyleField.HoverBackgroundColor, value, StyleValue.FromColor); }\r\n public Color? ActiveBackgroundColor { init => _style = StyleAccumulator.Add(_style, StyleField.ActiveBackgroundColor, value, StyleValue.FromColor); }\r\n public Color? FocusBackgroundColor { init => _style = StyleAccumulator.Add(_style, StyleField.FocusBackgroundColor, value, StyleValue.FromColor); }\r\n public Color? HoverFontColor { init => _style = StyleAccumulator.Add(_style, StyleField.HoverFontColor, value, StyleValue.FromColor); }\r\n public Color? ActiveFontColor { init => _style = StyleAccumulator.Add(_style, StyleField.ActiveFontColor, value, StyleValue.FromColor); }\r\n public Color? FocusFontColor { init => _style = StyleAccumulator.Add(_style, StyleField.FocusFontColor, value, StyleValue.FromColor); }\r\n public int? TransitionMs { init => _style = StyleAccumulator.Add(_style, StyleField.TransitionMs, value); }\r\n}\r\n"
},
{
"Ident": "xaz.gooui",
"Path": "Dependency.cs",
"FileName": "Dependency.cs",
"PackageType": "library",
"CodeKind": "Game",
"AssetVersionId": 301556,
"IsPrivate": false,
"Code": "using Goo;\nusing Sandbox.UI;\n\nnamespace Sandbox;\n\npublic class CounterUI : GooPanel<Container>\n{\n\tprivate int _count;\n\n\tprotected override Container Build() => new Container\n\t{\n\t\tPadding = 16,\n\t\tWidth = 128,\n\t\tHeight = 128,\n\t\tBackgroundColor = Color.White,\n\t\tBorderRadius = 12,\n\t\tFlexDirection = FlexDirection.Row,\n\t\tGap = 12,\n\t\tAlignItems = Align.Center,\n\t\tChildren =\n\t\t{\n\t\t\tnew Text(_count.ToString()),\n\t\t\tnew Container\n\t\t\t{\n\t\t\t\tPadding = 8,\n\t\t\t\tBackgroundColor = Color.Orange,\n\t\t\t\tHoverBackgroundColor = Color.Cyan,\n\t\t\t\tBorderRadius = 6,\n\t\t\t\tOnClick = e => { _count++; Rebuild(); },\n\t\t\t\tChildren = { new Text(\"+\") },\n\t\t\t},\n\t\t},\n\t};\n}"
},
{
"Ident": "xaz.gooui",
"Path": "Input/KeyTracker.cs",
"FileName": "KeyTracker.cs",
"PackageType": "library",
"CodeKind": "Game",
"AssetVersionId": 301556,
"IsPrivate": false,
"Code": "using System;\nusing System.Collections.Generic;\nusing Sandbox;\n\nnamespace Goo.Input;\n\n// Polls a curated key catalog once per frame for rising-edge presses + modifier state. ReemitHeldOnModifierRise re-emits a held key when a modifier rises (so \"hold W, press Ctrl\" reads as a chord).\npublic sealed class KeyTracker\n{\n public bool ReemitHeldOnModifierRise { get; set; } = false;\n\n public ModifierState Modifiers { get; private set; }\n public IReadOnlyList<KeyDescriptor> JustPressed => _justPressed;\n\n readonly IReadOnlyList<KeyDescriptor> _catalog;\n readonly HashSet<string> _downLastFrame = new();\n readonly List<KeyDescriptor> _justPressed = new();\n\n public KeyTracker() : this( KnownKeys.All ) { }\n\n public KeyTracker( IReadOnlyList<KeyDescriptor> catalog )\n {\n _catalog = catalog;\n }\n\n public void Reset()\n {\n _downLastFrame.Clear();\n _justPressed.Clear();\n Modifiers = default;\n }\n\n static readonly Func<string, bool> s_engineDown = Sandbox.Input.Keyboard.Down;\n\n public void Poll() => Poll( s_engineDown );\n\n // isDown seam exists because engine Input statics throw outside a running engine process.\n public void Poll( Func<string, bool> isDown )\n {\n _justPressed.Clear();\n var prev = Modifiers;\n\n for ( int i = 0; i < _catalog.Count; i++ )\n {\n var d = _catalog[i];\n bool down = isDown( d.EngineName );\n if ( down && !_downLastFrame.Contains( d.EngineName ) )\n _justPressed.Add( d );\n if ( down ) _downLastFrame.Add( d.EngineName );\n else _downLastFrame.Remove( d.EngineName );\n }\n\n Modifiers = new ModifierState(\n _downLastFrame.Contains( \"ctrl\" ),\n _downLastFrame.Contains( \"shift\" ),\n _downLastFrame.Contains( \"alt\" ),\n _downLastFrame.Contains( \"win\" ) );\n\n if ( !ReemitHeldOnModifierRise ) return;\n\n bool modRose = ( Modifiers.Ctrl && !prev.Ctrl ) || ( Modifiers.Shift && !prev.Shift )\n || ( Modifiers.Alt && !prev.Alt ) || ( Modifiers.Meta && !prev.Meta );\n if ( !modRose ) return;\n\n for ( int i = 0; i < _catalog.Count; i++ )\n {\n var d = _catalog[i];\n if ( d.Class == KeyClass.Modifier ) continue;\n if ( !_downLastFrame.Contains( d.EngineName ) ) continue;\n if ( _justPressed.Contains( d ) ) continue;\n _justPressed.Add( d );\n }\n }\n\n /// <summary>True if the named key had a rising edge (just-pressed, not held) this frame; call Poll first.</summary>\n public bool Pressed( string engineName )\n {\n for ( int i = 0; i < _justPressed.Count; i++ )\n if ( _justPressed[i].EngineName == engineName ) return true;\n return false;\n }\n}\n"
},
{
"Ident": "xaz.gooui",
"Path": "Internal/StatefulLabel.cs",
"FileName": "StatefulLabel.cs",
"PackageType": "library",
"CodeKind": "Game",
"AssetVersionId": 301556,
"IsPrivate": false,
"Code": "using System;\r\nusing Sandbox;\r\nusing Sandbox.UI;\r\n\r\nnamespace Goo.Internal;\r\n\r\ninternal sealed class StatefulLabel : Label, IStatefulHost, IStatefulEventHost\r\n{\r\n StateController? _state;\r\n\r\n internal Action<MousePanelEvent>? _onClick;\r\n internal Action<MousePanelEvent>? _onRightClick;\r\n internal Action<MousePanelEvent>? _onMiddleClick;\r\n internal Action<MousePanelEvent>? _onMouseEnter;\r\n internal Action<MousePanelEvent>? _onMouseLeave;\r\n internal Action<MousePanelEvent>? _onMouseDown;\r\n internal Action<MousePanelEvent>? _onMouseUp;\r\n internal Action<MousePanelEvent>? _onMouseMove;\r\n internal bool _userSetPointerEvents;\r\n internal Action? _requestRebuild;\r\n public Action? RequestRebuild { set => _requestRebuild = value; }\r\n\r\n public void ApplyStateVariants(\r\n Color? baseBg, Color? baseFg,\r\n Color? hoverBg, Color? activeBg, Color? focusBg,\r\n Color? hoverFg, Color? activeFg, Color? focusFg,\r\n int? transitionMs)\r\n {\r\n _state ??= new StateController(this);\r\n _state.ApplyVariants(\r\n baseBg, baseFg,\r\n hoverBg, activeBg, focusBg,\r\n hoverFg, activeFg, focusFg,\r\n transitionMs);\r\n }\r\n\r\n public void ClearStateVariants() => _state?.ClearVariants();\r\n\r\n public bool HasActiveStateVariants => _state?.HasActiveVariants ?? false;\r\n\r\n public void ApplyEvents(in BlobEvents events)\r\n {\r\n _onClick = events.OnClick;\r\n _onRightClick = events.OnRightClick;\r\n _onMiddleClick = events.OnMiddleClick;\r\n _onMouseEnter = events.OnMouseEnter;\r\n _onMouseLeave = events.OnMouseLeave;\r\n _onMouseDown = events.OnMouseDown;\r\n _onMouseUp = events.OnMouseUp;\r\n _onMouseMove = events.OnMouseMove;\r\n }\r\n\r\n public bool HasEventHandlers =>\r\n _onClick != null || _onRightClick != null || _onMiddleClick != null || _onMouseEnter != null || _onMouseLeave != null ||\r\n _onMouseDown != null || _onMouseUp != null || _onMouseMove != null;\r\n\r\n public bool UserSetPointerEvents\r\n {\r\n get => _userSetPointerEvents;\r\n set => _userSetPointerEvents = value;\r\n }\r\n\r\n protected override void OnClick(MousePanelEvent e)\r\n {\r\n base.OnClick(e);\r\n EventDispatch.Fire(_onClick, e, _requestRebuild);\r\n }\r\n\r\n protected override void OnRightClick(MousePanelEvent e)\r\n {\r\n base.OnRightClick(e);\r\n EventDispatch.Fire(_onRightClick, e, _requestRebuild);\r\n }\r\n\r\n protected override void OnMiddleClick(MousePanelEvent e)\r\n {\r\n base.OnMiddleClick(e);\r\n EventDispatch.Fire(_onMiddleClick, e, _requestRebuild);\r\n }\r\n\r\n protected override void OnMouseOver(MousePanelEvent e)\r\n {\r\n base.OnMouseOver(e);\r\n EventDispatch.Fire(_onMouseEnter, e, _requestRebuild);\r\n }\r\n\r\n protected override void OnMouseOut(MousePanelEvent e)\r\n {\r\n base.OnMouseOut(e);\r\n EventDispatch.Fire(_onMouseLeave, e, _requestRebuild);\r\n }\r\n\r\n protected override void OnMouseDown(MousePanelEvent e)\r\n {\r\n base.OnMouseDown(e);\r\n EventDispatch.Fire(_onMouseDown, e, _requestRebuild);\r\n }\r\n\r\n protected override void OnMouseUp(MousePanelEvent e)\r\n {\r\n base.OnMouseUp(e);\r\n EventDispatch.Fire(_onMouseUp, e, _requestRebuild);\r\n }\r\n\r\n protected override void OnMouseMove(MousePanelEvent e)\r\n {\r\n base.OnMouseMove(e);\r\n EventDispatch.Fire(_onMouseMove, e, _requestRebuild);\r\n }\r\n}\r\n"
},
{
"Ident": "xaz.gooui",
"Path": "ShaderEffect.cs",
"FileName": "ShaderEffect.cs",
"PackageType": "library",
"CodeKind": "Game",
"AssetVersionId": 301556,
"IsPrivate": false,
"Code": "using System;\r\nusing System.Collections.Generic;\r\nusing Sandbox;\r\nusing Sandbox.Rendering;\r\nusing Sandbox.UI;\r\n\r\nnamespace Goo;\r\n\r\n/// <summary>\r\n/// A custom shader applied to a Blob. Point it at a compiled .shader; it parses the shader\r\n/// source's Attribute() declarations to validate uniform names and to reset uniforms other\r\n/// panels have set (panels share one CommandList attribute namespace), and pushes the uniform\r\n/// bag every frame. Set uniforms with the collection initializer (<c>[\"Name\"] = value</c>);\r\n/// a value may be a literal or a per-frame Func. Subclass and override <see cref=\"Apply\"/>\r\n/// only for bespoke per-frame CPU logic.\r\n/// </summary>\r\npublic record ShaderEffect\r\n{\r\n static readonly Dictionary<object, Material> _materialCache = new();\r\n static readonly Dictionary<object, ShaderSchemaInfo?> _schemaCache = new();\r\n\r\n // Every uniform name any ShaderEffect has pushed this session, with the last value pushed\r\n // (its runtime type drives the reset conversion). Panels share one CommandList attribute\r\n // namespace, so a uniform set by one panel persists into every later panel's draw; an\r\n // effect that does not set a seen uniform must reset it to its shader's declared default\r\n // or it inherits the other panel's value (view-5u5m). Touched only from Apply (render thread).\r\n static readonly Dictionary<string, object> _seenUniforms = new();\r\n\r\n internal sealed class ShaderSchemaInfo\r\n {\r\n public required HashSet<string> Names; // declared attribute names\r\n public required Dictionary<string, (Vector4 Floats, Vector4 Ints)> Defaults;\r\n }\r\n\r\n readonly string? _path;\r\n readonly Shader? _shader;\r\n readonly GrabMode _grab;\r\n readonly Dictionary<string, UniformValue> _bag = new();\r\n bool _validated;\r\n\r\n /// <summary>For subclasses that supply their own <see cref=\"Material\"/> and <see cref=\"Apply\"/>.</summary>\r\n protected ShaderEffect() { }\r\n\r\n /// <summary>Apply the shader at <paramref name=\"shaderPath\"/> (e.g. \"shaders/ui_dither.shader\").</summary>\r\n public ShaderEffect( string shaderPath, GrabMode grab = GrabMode.None )\r\n {\r\n _path = shaderPath;\r\n _grab = grab;\r\n }\r\n\r\n /// <summary>Apply a shader resource (drag-droppable in the inspector).</summary>\r\n public ShaderEffect( Shader shader, GrabMode grab = GrabMode.None )\r\n {\r\n _shader = shader;\r\n _grab = grab;\r\n }\r\n\r\n /// <summary>The shader asset path, or null when constructed from a <see cref=\"T:Sandbox.Shader\"/> resource.</summary>\r\n public string? ShaderPath => _path;\r\n\r\n /// <summary>How this effect grabs the framebuffer behind its panel.</summary>\r\n public GrabMode Grab => _grab;\r\n\r\n /// <summary>Get or set a uniform by its shader attribute name.</summary>\r\n public UniformValue this[string name]\r\n {\r\n get => _bag[name];\r\n set => _bag[name] = value;\r\n }\r\n\r\n object CacheKey => (object?)_path ?? _shader!;\r\n\r\n /// <summary>The material this effect draws with, cached so it is excluded from record equality.</summary>\r\n public virtual Material Material\r\n {\r\n get\r\n {\r\n var key = CacheKey;\r\n if ( !_materialCache.TryGetValue( key, out var mat ) )\r\n {\r\n mat = _path is not null ? Material.FromShader( _path ) : Material.FromShader( _shader! );\r\n _materialCache[key] = mat;\r\n }\r\n return mat;\r\n }\r\n }\r\n\r\n /// <summary>Create the Material now, on the calling thread. Call on the main thread; Draw runs on the render thread and must only read the cache.</summary>\r\n public void Warm() => _ = Material;\r\n\r\n /// <summary>Set this effect's shader attributes for the frame, then grab the framebuffer per <see cref=\"Grab\"/>.</summary>\r\n protected internal virtual void Apply( CommandList cl, Rect rect )\r\n {\r\n cl.Attributes.Set( \"BoxSize\", new Vector2( rect.Width, rect.Height ) );\r\n\r\n // Subclass escape hatch: a derived effect calling base.Apply gets only BoxSize.\r\n if ( _path is null && _shader is null ) return;\r\n\r\n Validate();\r\n\r\n // Reset seen-but-unset uniforms to this shader's declared defaults so another panel's\r\n // attribute writes do not bleed into this draw (view-5u5m).\r\n var schema = SchemaFor( CacheKey );\r\n if ( schema is not null )\r\n {\r\n foreach ( var (name, sample) in _seenUniforms )\r\n {\r\n if ( _bag.ContainsKey( name ) ) continue;\r\n if ( !schema.Defaults.TryGetValue( name, out var def ) ) continue;\r\n if ( ResetValue( sample, def.Floats, def.Ints ) is { } reset )\r\n SetAttribute( cl, name, reset );\r\n }\r\n }\r\n\r\n foreach ( var (name, value) in _bag )\r\n {\r\n var resolved = value.Resolve();\r\n SetAttribute( cl, name, resolved );\r\n if ( resolved is not Texture )\r\n _seenUniforms[name] = resolved;\r\n }\r\n\r\n switch ( _grab )\r\n {\r\n case GrabMode.Sharp:\r\n cl.Attributes.GrabFrameTexture( \"FrameBufferCopyTexture\" );\r\n break;\r\n case GrabMode.Blurred:\r\n cl.Attributes.GrabFrameTexture( \"FrameBufferCopyTexture\", Graphics.DownsampleMethod.GaussianBlur );\r\n break;\r\n }\r\n }\r\n\r\n static void SetAttribute( CommandList cl, string name, object value )\r\n {\r\n switch ( value )\r\n {\r\n case float f: cl.Attributes.Set( name, f ); break;\r\n case bool b: cl.Attributes.Set( name, b ); break;\r\n case Vector2 v: cl.Attributes.Set( name, v ); break;\r\n case Vector3 v: cl.Attributes.Set( name, v ); break;\r\n case Vector4 v: cl.Attributes.Set( name, v ); break;\r\n case Color c: cl.Attributes.Set( name, c ); break;\r\n case Texture t: cl.Attributes.Set( name, t ); break;\r\n }\r\n }\r\n\r\n // Reads the shader's declared attribute names once per instance and warns on uniform names\r\n // the shader does not declare. Skipped silently when the source is unavailable.\r\n void Validate()\r\n {\r\n if ( _validated ) return;\r\n _validated = true;\r\n\r\n var valid = SchemaFor( CacheKey )?.Names;\r\n if ( valid is null || valid.Count == 0 ) return;\r\n\r\n foreach ( var name in _bag.Keys )\r\n if ( !valid.Contains( name ) )\r\n Sandbox.Internal.GlobalSystemNamespace.Log.Warning(\r\n $\"ShaderEffect for \\\"{_path ?? _shader?.ResourcePath}\\\": uniform \\\"{name}\\\" is not declared by the shader \" +\r\n $\"(valid: {string.Join( \", \", valid )}). Ignored.\" );\r\n }\r\n\r\n // Names + defaults come from parsing the .shader SOURCE, which ships with the project and\r\n // declares every Attribute() with its Default(). The engine's Shader.Schema is editor-only\r\n // plumbing: at game runtime it throws (\"Load must be called on the main thread!\" \u2014 Apply\r\n // runs on the render thread) so it is not consulted at all (view-5u5m probe, 2026-06-11).\r\n // Null when the source is unreadable (e.g. unit tests, published build without raw\r\n // .shader files); reset and validation both skip then.\r\n static ShaderSchemaInfo? SchemaFor( object key )\r\n {\r\n if ( _schemaCache.TryGetValue( key, out var info ) ) return info;\r\n\r\n info = null;\r\n if ( (key as string ?? (key as Shader)?.ResourcePath) is { } srcPath )\r\n {\r\n try\r\n {\r\n info = ParseShaderSource( FileSystem.Mounted.ReadAllText( srcPath ) );\r\n }\r\n catch\r\n {\r\n info = null;\r\n }\r\n }\r\n\r\n _schemaCache[key] = info;\r\n return info;\r\n }\r\n\r\n static readonly System.Text.RegularExpressions.Regex _declRegex = new(\r\n @\"\\b(?<type>float[234]?|bool|int|Texture2D)\\s+\\w+\\s*<(?<block>[^>]*)>\",\r\n System.Text.RegularExpressions.RegexOptions.Compiled );\r\n static readonly System.Text.RegularExpressions.Regex _attrRegex = new(\r\n @\"Attribute\\s*\\(\\s*\"\"(?<name>[^\"\"]+)\"\"\\s*\\)\",\r\n System.Text.RegularExpressions.RegexOptions.Compiled );\r\n static readonly System.Text.RegularExpressions.Regex _defaultRegex = new(\r\n @\"Default[234]?\\s*\\(\\s*(?<args>[^)]*)\\)\",\r\n System.Text.RegularExpressions.RegexOptions.Compiled );\r\n\r\n // Pure: extracts Attribute()-bound uniform declarations and their Default() values from\r\n // .shader source. Defaults are stored in both vector slots so ResetValue can convert by the\r\n // bled value's runtime type. Texture declarations contribute a name (for validation) but no\r\n // default. Only the main file is scanned; #include'd uniforms (BoxSize, DpiScale) are\r\n // framework-managed and excluded anyway. Missing Default() = zeros, matching the engine's\r\n // unset-attribute behavior.\r\n internal static ShaderSchemaInfo? ParseShaderSource( string source )\r\n {\r\n var names = new HashSet<string>();\r\n var defaults = new Dictionary<string, (Vector4 Floats, Vector4 Ints)>();\r\n\r\n foreach ( System.Text.RegularExpressions.Match m in _declRegex.Matches( source ) )\r\n {\r\n var block = m.Groups[\"block\"].Value;\r\n var attr = _attrRegex.Match( block );\r\n if ( !attr.Success ) continue;\r\n\r\n var name = attr.Groups[\"name\"].Value;\r\n names.Add( name );\r\n\r\n if ( name is \"BoxSize\" or \"DpiScale\" ) continue; // framework-managed per draw\r\n if ( m.Groups[\"type\"].Value == \"Texture2D\" ) continue; // no resettable default\r\n\r\n Vector4 v = default;\r\n var def = _defaultRegex.Match( block );\r\n if ( def.Success )\r\n {\r\n var parts = def.Groups[\"args\"].Value.Split( ',' );\r\n for ( int i = 0; i < parts.Length && i < 4; i++ )\r\n {\r\n if ( !float.TryParse( parts[i].Trim(), System.Globalization.NumberStyles.Float,\r\n System.Globalization.CultureInfo.InvariantCulture, out var f ) ) continue;\r\n switch ( i )\r\n {\r\n case 0: v.x = f; break;\r\n case 1: v.y = f; break;\r\n case 2: v.z = f; break;\r\n case 3: v.w = f; break;\r\n }\r\n }\r\n }\r\n defaults[name] = (v, v);\r\n }\r\n\r\n return names.Count > 0 ? new ShaderSchemaInfo { Names = names, Defaults = defaults } : null;\r\n }\r\n\r\n // Pure: converts a shader's declared default (schema FloatDefault/IntDefault vectors) to the\r\n // runtime type of the value that bled in, so the reset lands in the same attribute slot type.\r\n // Null = no safe reset (unsupported type; textures are never recorded so never reach this).\r\n internal static object? ResetValue( object sample, Vector4 floats, Vector4 ints ) => sample switch\r\n {\r\n float => floats.x,\r\n bool => ints.x != 0f,\r\n Vector2 => new Vector2( floats.x, floats.y ),\r\n Vector3 => new Vector3( floats.x, floats.y, floats.z ),\r\n Color => new Color( floats.x, floats.y, floats.z, floats.w ),\r\n Vector4 => floats,\r\n _ => null,\r\n };\r\n\r\n public virtual bool Equals( ShaderEffect? other )\r\n {\r\n if ( other is null ) return false;\r\n if ( ReferenceEquals( this, other ) ) return true;\r\n if ( EqualityContract != other.EqualityContract ) return false;\r\n return _path == other._path\r\n && ReferenceEquals( _shader, other._shader )\r\n && _grab == other._grab\r\n && BagEquals( _bag, other._bag );\r\n }\r\n\r\n public override int GetHashCode()\r\n {\r\n var hc = new HashCode();\r\n hc.Add( EqualityContract );\r\n hc.Add( _path );\r\n hc.Add( _grab );\r\n hc.Add( _bag.Count );\r\n return hc.ToHashCode();\r\n }\r\n\r\n static bool BagEquals( Dictionary<string, UniformValue> a, Dictionary<string, UniformValue> b )\r\n {\r\n if ( a.Count != b.Count ) return false;\r\n foreach ( var (k, v) in a )\r\n if ( !b.TryGetValue( k, out var bv ) || !v.Equals( bv ) ) return false;\r\n return true;\r\n }\r\n}\r\n"
},
{
"Ident": "xaz.gooui",
"Path": "Core/StyleAccumulator.cs",
"FileName": "StyleAccumulator.cs",
"PackageType": "library",
"CodeKind": "Game",
"AssetVersionId": 301556,
"IsPrivate": false,
"Code": "using Sandbox;\nusing Sandbox.Rendering;\nusing Sandbox.UI;\n\nnamespace Goo;\n\n// Style helpers hoisted so generated Blob facades share them. Keep the early-return form: an engine-type ternary that resolves bare null via an implicit string operator silently produces magenta (Color.Parse fallback) instead of the intended absent-property. See engine-fact memories.\n\ninternal static class StyleAccumulator\n{\n static StyleList Rent(StyleList current)\n => ReferenceEquals(current, StyleList.Empty)\n ? BuildContext.Current.RentStyleList()\n : current;\n\n public static StyleList Add(StyleList current, StyleField field, Length? value)\n {\n if (!value.HasValue) return current;\n var list = Rent(current);\n list.Add(field, StyleValue.FromLength(value.Value));\n return list;\n }\n\n public static StyleList Add<TEnum>(StyleList current, StyleField field, TEnum? value, System.Func<TEnum, StyleValue> wrap) where TEnum : struct\n {\n if (!value.HasValue) return current;\n var list = Rent(current);\n list.Add(field, wrap(value.Value));\n return list;\n }\n\n public static StyleList Add(StyleList current, StyleField field, Color? value, System.Func<Color, StyleValue> wrap)\n {\n if (!value.HasValue) return current;\n var list = Rent(current);\n list.Add(field, wrap(value.Value));\n return list;\n }\n\n public static StyleList Add(StyleList current, StyleField field, string? value)\n {\n if (value is null) return current;\n var list = Rent(current);\n list.Add(field, StyleValue.FromString(value));\n return list;\n }\n\n public static StyleList Add(StyleList current, StyleField field, float? value)\n {\n if (!value.HasValue) return current;\n var list = Rent(current);\n list.Add(field, StyleValue.FromSingle(value.Value));\n return list;\n }\n\n public static StyleList Add(StyleList current, StyleField field, bool? value)\n {\n if (!value.HasValue) return current;\n var list = Rent(current);\n list.Add(field, StyleValue.FromBoolean(value.Value));\n return list;\n }\n\n public static StyleList Add(StyleList current, StyleField field, int? value)\n {\n if (!value.HasValue) return current;\n var list = Rent(current);\n list.Add(field, StyleValue.FromInt32(value.Value));\n return list;\n }\n\n public static StyleList Add(StyleList current, StyleField field, Texture? value)\n {\n if (value is null) return current;\n var list = Rent(current);\n list.Add(field, StyleValue.FromTexture(value));\n return list;\n }\n}\n"
},
{
"Ident": "xaz.gooui",
"Path": "Dnd/DragSource.cs",
"FileName": "DragSource.cs",
"PackageType": "library",
"CodeKind": "Game",
"AssetVersionId": 301556,
"IsPrivate": false,
"Code": "using System;\r\nusing Sandbox;\r\nusing Sandbox.UI;\r\n\r\nnamespace Goo;\r\n\r\n// Cell: a draggable carrying a typed payload. Owns its own being-dragged visual flag so the\r\n// original can dim while in flight. Wires engine drag events into the shared DragContext.\r\npublic sealed class DragSource<T> : Cell<Container>\r\n{\r\n public DragContext<T> Context = null!; // set via Cell.Mount configure\r\n public T Payload = default!; // set via configure\r\n public Func<bool, Container> Content = null!; // receives isDragging; renders the tile\r\n public Func<Container>? Ghost; // optional ghost; defaults to Content(false)\r\n\r\n bool _dragging;\r\n\r\n protected override Container Build() => new Container\r\n {\r\n PointerEvents = PointerEvents.All,\r\n OnDragStart = e =>\r\n {\r\n _dragging = true;\r\n // ScreenPosition is rendered px; the ghost layer consumes Context.Pos as CSS-px Left/Top.\r\n // Convert via the source panel's ScaleFromScreen (=1/ScaleToScreen) so the ghost tracks\r\n // the cursor under UI scaling (engine-fact-panel-screen-position-helpers). No-op at 1.0.\r\n Context.Begin(Payload, Ghost ?? (() => Content(false)),\r\n e.ScreenPosition * (e.This?.ScaleFromScreen ?? 1f));\r\n Rebuild();\r\n },\r\n OnDrag = e =>\r\n {\r\n Context.Move(e.ScreenPosition * (e.This?.ScaleFromScreen ?? 1f));\r\n Rebuild();\r\n },\r\n OnDragEnd = _ =>\r\n {\r\n _dragging = false;\r\n Context.Release();\r\n Rebuild();\r\n },\r\n Children = { Content(_dragging) },\r\n };\r\n}\r\n"
},
{
"Ident": "xaz.gooui",
"Path": "Internal/IStatefulHost.cs",
"FileName": "IStatefulHost.cs",
"PackageType": "library",
"CodeKind": "Game",
"AssetVersionId": 301556,
"IsPrivate": false,
"Code": "using Sandbox;\r\n\r\nnamespace Goo.Internal;\r\n\r\ninternal interface IStatefulHost\r\n{\r\n void ApplyStateVariants(\r\n Color? baseBg, Color? baseFg,\r\n Color? hoverBg, Color? activeBg, Color? focusBg,\r\n Color? hoverFg, Color? activeFg, Color? focusFg,\r\n int? transitionMs);\r\n\r\n // Shed any previously-applied variant sheet when the host (possibly recycled by\r\n // the reconciler) declares no variants this pass. No-op if none were applied.\r\n void ClearStateVariants();\r\n\r\n // True while a variant sheet is attached; such panels must keep capturing pointer events.\r\n bool HasActiveStateVariants { get; }\r\n}\r\n"
},
{
"Ident": "xaz.gooui",
"Path": ".obj/__compiler_extra.cs",
"FileName": "__compiler_extra.cs",
"PackageType": "library",
"CodeKind": "Game",
"AssetVersionId": 301556,
"IsPrivate": false,
"Code": "global using static Sandbox.Internal.GlobalGameNamespace;\r\nglobal using Microsoft.AspNetCore.Components;\r\nglobal using Microsoft.AspNetCore.Components.Rendering;\r\n[assembly: global::System.Reflection.AssemblyMetadata( \"AddonTitle\", \"Goo UI\" )]\r\n[assembly: global::System.Reflection.AssemblyMetadata( \"AddonIdent\", \"gooui\" )]\r\n[assembly: global::System.Reflection.AssemblyMetadata( \"OrgIdent\", \"xaz\" )]\r\n[assembly: global::System.Reflection.AssemblyMetadata( \"Ident\", \"xaz.gooui\" )]\r\n[assembly: global::System.Reflection.AssemblyMetadata( \"EngineVersion\", \"26\" )]\r\n[assembly: global::System.Reflection.AssemblyMetadata( \"EngineMinorVersion\", \"1\" )]\r\n\r\n[assembly: System.Runtime.Versioning.TargetFramework( \".NETCoreApp,Version=v9.0\", FrameworkDisplayName = \".NET 9.0\" )]\r\n[assembly: global::System.Reflection.AssemblyMetadata( \"CompileTime\", \"2026-06-26T02:54:14.8168981Z\" )]\r\n[assembly: global::System.Reflection.AssemblyVersion(\"0.0.120.0\")]\r\n[assembly: global::System.Reflection.AssemblyFileVersion(\"0.0.120.0\")]"
},
{
"Ident": "xaz.gooui",
"Path": "Animation/SpringColor.cs",
"FileName": "SpringColor.cs",
"PackageType": "library",
"CodeKind": "Game",
"AssetVersionId": 301556,
"IsPrivate": false,
"Code": "using System;\nusing Sandbox;\n\nnamespace Goo.Animation;\n\npublic record struct SpringColor\n{\n public Color Current;\n public Color Target;\n public Color Velocity;\n public float Frequency;\n public float Damping;\n\n public SpringColor(Color initial, float frequency, float damping)\n {\n Current = initial;\n Target = initial;\n Velocity = default;\n Frequency = frequency;\n Damping = damping;\n }\n\n public void Update(float dt)\n {\n float vr = Velocity.r, vg = Velocity.g, vb = Velocity.b, va = Velocity.a;\n Current = new Color(\n MathX.SpringDamp(Current.r, Target.r, ref vr, dt, Frequency, Damping),\n MathX.SpringDamp(Current.g, Target.g, ref vg, dt, Frequency, Damping),\n MathX.SpringDamp(Current.b, Target.b, ref vb, dt, Frequency, Damping),\n MathX.SpringDamp(Current.a, Target.a, ref va, dt, Frequency, Damping));\n Velocity = new Color(vr, vg, vb, va);\n }\n\n public bool IsSettled =>\n MathF.Abs(Target.r - Current.r) < 0.0001f &&\n MathF.Abs(Target.g - Current.g) < 0.0001f &&\n MathF.Abs(Target.b - Current.b) < 0.0001f &&\n MathF.Abs(Target.a - Current.a) < 0.0001f &&\n MathF.Abs(Velocity.r) < 0.0001f &&\n MathF.Abs(Velocity.g) < 0.0001f &&\n MathF.Abs(Velocity.b) < 0.0001f &&\n MathF.Abs(Velocity.a) < 0.0001f;\n\n /// <summary>Advances by dt and returns true while still moving; chain calls with | (not ||) so every damper advances each frame.</summary>\n public bool Tick(float dt) { Update(dt); return !IsSettled; }\n}\n"
},
{
"Ident": "xaz.gooui",
"Path": "Animation/SpringFloat.cs",
"FileName": "SpringFloat.cs",
"PackageType": "library",
"CodeKind": "Game",
"AssetVersionId": 301556,
"IsPrivate": false,
"Code": "using System;\nusing Sandbox;\n\nnamespace Goo.Animation;\n\npublic record struct SpringFloat\n{\n public float Current;\n public float Target;\n public float Velocity;\n public float Frequency;\n public float Damping;\n\n public SpringFloat(float initial, float frequency, float damping)\n {\n Current = initial;\n Target = initial;\n Velocity = 0f;\n Frequency = frequency;\n Damping = damping;\n }\n\n public void Update(float dt) =>\n Current = MathX.SpringDamp(Current, Target, ref Velocity, dt, Frequency, Damping);\n\n public bool IsSettled =>\n MathF.Abs(Target - Current) < 0.0001f && MathF.Abs(Velocity) < 0.0001f;\n\n /// <summary>Advances by dt and returns true while still moving; chain calls with | (not ||) so every damper advances each frame.</summary>\n public bool Tick(float dt) { Update(dt); return !IsSettled; }\n}\n"
},
{
"Ident": "xaz.gooui",
"Path": "Code/Dependency.cs",
"FileName": "Dependency.cs",
"PackageType": "library",
"CodeKind": "Game",
"AssetVersionId": 301556,
"IsPrivate": false,
"Code": "using Goo;\nusing Sandbox.UI;\n\nnamespace Sandbox;\n\npublic class CounterUI : GooPanel<Container>\n{\n\tprivate int _count;\n\n\tprotected override Container Build() => new Container\n\t{\n\t\tPadding = 16,\n\t\tWidth = 128,\n\t\tHeight = 128,\n\t\tBackgroundColor = Color.White,\n\t\tBorderRadius = 12,\n\t\tFlexDirection = FlexDirection.Row,\n\t\tGap = 12,\n\t\tAlignItems = Align.Center,\n\t\tChildren =\n\t\t{\n\t\t\tnew Text(_count.ToString()),\n\t\t\tnew Container\n\t\t\t{\n\t\t\t\tPadding = 8,\n\t\t\t\tBackgroundColor = Color.Orange,\n\t\t\t\tHoverBackgroundColor = Color.Cyan,\n\t\t\t\tBorderRadius = 6,\n\t\t\t\tOnClick = e => { _count++; Rebuild(); },\n\t\t\t\tChildren = { new Text(\"+\") },\n\t\t\t},\n\t\t},\n\t};\n}"
},
{
"Ident": "xaz.gooui",
"Path": "Core/Arc.Style.g.cs",
"FileName": "Arc.Style.g.cs",
"PackageType": "library",
"CodeKind": "Game",
"AssetVersionId": 301556,
"IsPrivate": false,
"Code": "// <auto-generated />\r\n// Generated by tools/StyleFacadeEmit. Do not edit by hand.\r\n// Source of truth: tools/StyleFacadeEmit/style-manifest.json\r\nusing Sandbox;\r\nusing Sandbox.Rendering;\r\nusing Sandbox.UI;\r\n\r\nnamespace Goo;\r\n\r\npublic readonly partial record struct Arc\r\n{\r\n public Length? Width { init => _style = StyleAccumulator.Add(_style, StyleField.Width, value); }\r\n public Length? Height { init => _style = StyleAccumulator.Add(_style, StyleField.Height, value); }\r\n public Length? Margin { init => _style = StyleAccumulator.Add(_style, StyleField.Margin, value); }\r\n public Length? MarginLeft { init => _style = StyleAccumulator.Add(_style, StyleField.MarginLeft, value); }\r\n public Length? MarginTop { init => _style = StyleAccumulator.Add(_style, StyleField.MarginTop, value); }\r\n public Length? MarginRight { init => _style = StyleAccumulator.Add(_style, StyleField.MarginRight, value); }\r\n public Length? MarginBottom { init => _style = StyleAccumulator.Add(_style, StyleField.MarginBottom, value); }\r\n public Color? BackgroundColor { init => _style = StyleAccumulator.Add(_style, StyleField.BackgroundColor, value, StyleValue.FromColor); }\r\n public Color? BackgroundTint { init => _style = StyleAccumulator.Add(_style, StyleField.BackgroundTint, value, StyleValue.FromColor); }\r\n public Length? Bottom { init => _style = StyleAccumulator.Add(_style, StyleField.Bottom, value); }\r\n public Length? Left { init => _style = StyleAccumulator.Add(_style, StyleField.Left, value); }\r\n public Length? Right { init => _style = StyleAccumulator.Add(_style, StyleField.Right, value); }\r\n public Length? Top { init => _style = StyleAccumulator.Add(_style, StyleField.Top, value); }\r\n public Length? FlexBasis { init => _style = StyleAccumulator.Add(_style, StyleField.FlexBasis, value); }\r\n public float? FlexGrow { init => _style = StyleAccumulator.Add(_style, StyleField.FlexGrow, value); }\r\n public float? FlexShrink { init => _style = StyleAccumulator.Add(_style, StyleField.FlexShrink, value); }\r\n public Length? MaxHeight { init => _style = StyleAccumulator.Add(_style, StyleField.MaxHeight, value); }\r\n public Length? MaxWidth { init => _style = StyleAccumulator.Add(_style, StyleField.MaxWidth, value); }\r\n public Length? MinHeight { init => _style = StyleAccumulator.Add(_style, StyleField.MinHeight, value); }\r\n public Length? MinWidth { init => _style = StyleAccumulator.Add(_style, StyleField.MinWidth, value); }\r\n public float? Opacity { init => _style = StyleAccumulator.Add(_style, StyleField.Opacity, value); }\r\n public PointerEvents? PointerEvents { init => _style = StyleAccumulator.Add(_style, StyleField.PointerEvents, value, StyleValue.FromPointerEvents); }\r\n public PositionMode? Position { init => _style = StyleAccumulator.Add(_style, StyleField.Position, value, StyleValue.FromPositionMode); }\r\n public Goo.PanelTransform? Transform { init => _style = StyleAccumulator.Add(_style, StyleField.Transform, value, StyleValue.FromPanelTransform); }\r\n}\r\n"
},
{
"Ident": "xaz.gooui",
"Path": "Core/Fiber.cs",
"FileName": "Fiber.cs",
"PackageType": "library",
"CodeKind": "Game",
"AssetVersionId": 301556,
"IsPrivate": false,
"Code": "using System;\r\nusing System.Collections.Generic;\r\nusing System.Collections.Immutable;\r\nusing Sandbox;\r\n\r\nnamespace Goo;\r\n\r\ninternal sealed class Fiber\r\n{\r\n public BlobKind Kind;\r\n public string? Key;\r\n public string Content = \"\";\r\n public StyleList Style = StyleList.Empty;\r\n public List<Fiber>? Children;\r\n public Texture? Texture;\r\n public string? Path; // Image (texture path), ScenePanel (.scene path), SvgPanel (svg path), or WebPanel (URL)\r\n public Scene? Scene;\r\n public bool RenderOnce;\r\n public bool Paused; // WebPanel only\r\n public string? Color;\r\n // TextEntry-only carry-fields. Path slot is reused for the text value.\r\n public string? Placeholder;\r\n public int? MaxLength;\r\n public bool Disabled;\r\n public bool Numeric;\r\n public float? MinValue;\r\n public float? MaxValue;\r\n public string? NumberFormat;\r\n public bool Multiline;\r\n public int? MinLength;\r\n public string? CharacterRegex;\r\n public string? StringRegex;\r\n public Func<char, bool>? CanEnterChar;\r\n public Func<string, bool>? Validate;\r\n public Action<bool>? OnValidationChanged;\r\n public Action<string>? OnChange;\r\n public Action<string>? OnSubmit;\r\n public Action? OnFocus;\r\n public Action<string>? OnBlur;\r\n public Action? OnCancel;\r\n public bool IsControlled;\r\n public BlobEvents PrevEvents;\r\n public ShapeParams Shape; // Sector / Arc only\r\n public Vector2[]? Points; // Polygon only\r\n // Custom-shader channel (Container only). Previous-render snapshot for delta comparison.\r\n public ShaderEffect? Effect;\r\n // Custom-draw callback (Container only). Previous-render snapshot for delta comparison.\r\n public DrawCallback? Draw;\r\n // Declared layout-move transition (Container only). Previous-render snapshot for delta comparison.\r\n public LayoutTransition? LayoutTransition;\r\n public object? Instance; // Cell only: the persistent self-owning state instance\r\n}\r\n"
},
{
"Ident": "xaz.gooui",
"Path": "Core/PanelTransformExtensions.cs",
"FileName": "PanelTransformExtensions.cs",
"PackageType": "library",
"CodeKind": "Game",
"AssetVersionId": 301556,
"IsPrivate": false,
"Code": "using Sandbox;\nusing Sandbox.UI;\nusing EngineEntry = Sandbox.UI.PanelTransform.Entry;\nusing EngineEntryType = Sandbox.UI.PanelTransform.EntryType;\n\nnamespace Goo;\n\n/// <summary>Instance fluent chain methods for <see cref=\"PanelTransform\"/>, each returning a new value with the entry appended (extensions because C# forbids same-name static and instance methods on one type).</summary>\npublic static class PanelTransformExtensions\n{\n public static PanelTransform Translate(this PanelTransform t, Length x, Length y)\n => t.Append(new EngineEntry { Type = EngineEntryType.Translate, X = x, Y = y });\n\n public static PanelTransform Translate(this PanelTransform t, Length x, Length y, Length z)\n => t.Append(new EngineEntry { Type = EngineEntryType.Translate, X = x, Y = y, Z = z });\n\n public static PanelTransform TranslateX(this PanelTransform t, Length x)\n => t.Append(new EngineEntry { Type = EngineEntryType.Translate, X = x });\n\n public static PanelTransform TranslateY(this PanelTransform t, Length y)\n => t.Append(new EngineEntry { Type = EngineEntryType.Translate, Y = y });\n\n public static PanelTransform TranslateZ(this PanelTransform t, Length z)\n => t.Append(new EngineEntry { Type = EngineEntryType.Translate, Z = z });\n\n public static PanelTransform Rotate(this PanelTransform t, float zDegrees)\n => t.Append(new EngineEntry { Type = EngineEntryType.Rotation, Data = new Vector3(0f, 0f, zDegrees) });\n\n public static PanelTransform Rotate(this PanelTransform t, float xDeg, float yDeg, float zDeg)\n => t.Append(new EngineEntry { Type = EngineEntryType.Rotation, Data = new Vector3(xDeg, yDeg, zDeg) });\n\n public static PanelTransform RotateX(this PanelTransform t, float deg)\n => t.Append(new EngineEntry { Type = EngineEntryType.Rotation, Data = new Vector3(deg, 0f, 0f) });\n\n public static PanelTransform RotateY(this PanelTransform t, float deg)\n => t.Append(new EngineEntry { Type = EngineEntryType.Rotation, Data = new Vector3(0f, deg, 0f) });\n\n public static PanelTransform RotateZ(this PanelTransform t, float deg)\n => t.Append(new EngineEntry { Type = EngineEntryType.Rotation, Data = new Vector3(0f, 0f, deg) });\n\n public static PanelTransform Scale(this PanelTransform t, float uniform)\n => t.Append(new EngineEntry { Type = EngineEntryType.Scale, Data = new Vector3(uniform, uniform, uniform) });\n\n public static PanelTransform Scale(this PanelTransform t, Vector3 scale)\n => t.Append(new EngineEntry { Type = EngineEntryType.Scale, Data = scale });\n\n public static PanelTransform ScaleX(this PanelTransform t, float s)\n => t.Append(new EngineEntry { Type = EngineEntryType.Scale, Data = new Vector3(s, 1f, 1f) });\n\n public static PanelTransform ScaleY(this PanelTransform t, float s)\n => t.Append(new EngineEntry { Type = EngineEntryType.Scale, Data = new Vector3(1f, s, 1f) });\n\n public static PanelTransform ScaleZ(this PanelTransform t, float s)\n => t.Append(new EngineEntry { Type = EngineEntryType.Scale, Data = new Vector3(1f, 1f, s) });\n\n public static PanelTransform Skew(this PanelTransform t, float xDeg, float yDeg)\n => t.Append(new EngineEntry { Type = EngineEntryType.Skew, Data = new Vector3(xDeg, yDeg, 0f) });\n\n public static PanelTransform SkewX(this PanelTransform t, float deg)\n => t.Append(new EngineEntry { Type = EngineEntryType.Skew, Data = new Vector3(deg, 0f, 0f) });\n\n public static PanelTransform SkewY(this PanelTransform t, float deg)\n => t.Append(new EngineEntry { Type = EngineEntryType.Skew, Data = new Vector3(0f, deg, 0f) });\n\n public static PanelTransform Perspective(this PanelTransform t, Length d)\n => t.Append(new EngineEntry { Type = EngineEntryType.Perspective, X = d });\n\n public static PanelTransform Matrix3D(this PanelTransform t, Matrix m)\n => t.Append(new EngineEntry { Type = EngineEntryType.Matrix, Matrix = m });\n}\n"
}
]
}