From 30f85d52709d0dd2c2feceaeba95cb932d3b6958 Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Fri, 19 Dec 2025 16:37:45 +0000 Subject: [PATCH] Make a bunch of BaseControls SupportsMultiEdit --- game/addons/base/code/UI/Controls/Color/ColorAlphaControl.cs | 2 ++ game/addons/base/code/UI/Controls/Color/ColorControl.cs | 2 ++ game/addons/base/code/UI/Controls/Color/ColorHueControl.cs | 2 ++ game/addons/base/code/UI/Controls/Color/ColorPickerControl.cs | 2 ++ .../base/code/UI/Controls/Color/ColorSaturationValueControl.cs | 2 ++ game/addons/base/code/UI/Controls/EnumControl.cs | 2 ++ game/addons/base/code/UI/Controls/SliderControl.razor | 2 ++ game/addons/base/code/UI/Controls/SwitchControl.razor | 2 ++ game/addons/base/code/UI/Controls/TextEntry.cs | 2 ++ game/addons/base/code/UI/Controls/VectorControl.cs | 2 ++ 10 files changed, 20 insertions(+) diff --git a/game/addons/base/code/UI/Controls/Color/ColorAlphaControl.cs b/game/addons/base/code/UI/Controls/Color/ColorAlphaControl.cs index c3ce428a..ccb1bfaf 100644 --- a/game/addons/base/code/UI/Controls/Color/ColorAlphaControl.cs +++ b/game/addons/base/code/UI/Controls/Color/ColorAlphaControl.cs @@ -7,6 +7,8 @@ public partial class ColorAlphaControl : BaseControl { readonly Panel _handle; + public override bool SupportsMultiEdit => true; + public ColorAlphaControl() { _handle = AddChild( "handle" ); diff --git a/game/addons/base/code/UI/Controls/Color/ColorControl.cs b/game/addons/base/code/UI/Controls/Color/ColorControl.cs index 32af7378..1a070aec 100644 --- a/game/addons/base/code/UI/Controls/Color/ColorControl.cs +++ b/game/addons/base/code/UI/Controls/Color/ColorControl.cs @@ -9,6 +9,8 @@ public partial class ColorControl : BaseControl readonly TextEntry _textEntry; readonly Panel _colorSwatch; + public override bool SupportsMultiEdit => true; + public ColorControl() { _colorSwatch = AddChild( "colorswatch" ); diff --git a/game/addons/base/code/UI/Controls/Color/ColorHueControl.cs b/game/addons/base/code/UI/Controls/Color/ColorHueControl.cs index d3a6b944..f8db7a77 100644 --- a/game/addons/base/code/UI/Controls/Color/ColorHueControl.cs +++ b/game/addons/base/code/UI/Controls/Color/ColorHueControl.cs @@ -7,6 +7,8 @@ public partial class ColorHueControl : BaseControl { readonly Panel _handle; + public override bool SupportsMultiEdit => true; + float _hue = 0; public ColorHueControl() diff --git a/game/addons/base/code/UI/Controls/Color/ColorPickerControl.cs b/game/addons/base/code/UI/Controls/Color/ColorPickerControl.cs index 451a80c7..3d0b47f6 100644 --- a/game/addons/base/code/UI/Controls/Color/ColorPickerControl.cs +++ b/game/addons/base/code/UI/Controls/Color/ColorPickerControl.cs @@ -9,6 +9,8 @@ public partial class ColorPickerControl : BaseControl readonly ColorHueControl _hueControl; readonly ColorAlphaControl _alphaControl; + public override bool SupportsMultiEdit => true; + public ColorPickerControl() { _svControl = AddChild( "sv" ); diff --git a/game/addons/base/code/UI/Controls/Color/ColorSaturationValueControl.cs b/game/addons/base/code/UI/Controls/Color/ColorSaturationValueControl.cs index cb6098ba..d82a0bef 100644 --- a/game/addons/base/code/UI/Controls/Color/ColorSaturationValueControl.cs +++ b/game/addons/base/code/UI/Controls/Color/ColorSaturationValueControl.cs @@ -9,6 +9,8 @@ public partial class ColorSaturationValueControl : BaseControl float _hue = 0; + public override bool SupportsMultiEdit => true; + public ColorSaturationValueControl() { _handle = AddChild( "handle" ); diff --git a/game/addons/base/code/UI/Controls/EnumControl.cs b/game/addons/base/code/UI/Controls/EnumControl.cs index e60bfc99..a8b6efb2 100644 --- a/game/addons/base/code/UI/Controls/EnumControl.cs +++ b/game/addons/base/code/UI/Controls/EnumControl.cs @@ -6,6 +6,8 @@ [CustomEditor( typeof( Enum ) )] public partial class EnumControl : BaseControl { + public override bool SupportsMultiEdit => true; + public EnumControl() { diff --git a/game/addons/base/code/UI/Controls/SliderControl.razor b/game/addons/base/code/UI/Controls/SliderControl.razor index a65fd754..8f49f7aa 100644 --- a/game/addons/base/code/UI/Controls/SliderControl.razor +++ b/game/addons/base/code/UI/Controls/SliderControl.razor @@ -41,6 +41,8 @@ @code { + public override bool SupportsMultiEdit => true; + [Parameter] public Action OnValueChanged { get; set; } /// diff --git a/game/addons/base/code/UI/Controls/SwitchControl.razor b/game/addons/base/code/UI/Controls/SwitchControl.razor index 34fa211b..abde925b 100644 --- a/game/addons/base/code/UI/Controls/SwitchControl.razor +++ b/game/addons/base/code/UI/Controls/SwitchControl.razor @@ -21,6 +21,8 @@ @code { + public override bool SupportsMultiEdit => true; + public RenderFragment Label { get; set; } public Action OnValueChanged { get; set; } diff --git a/game/addons/base/code/UI/Controls/TextEntry.cs b/game/addons/base/code/UI/Controls/TextEntry.cs index 9ba8066d..0511c47c 100644 --- a/game/addons/base/code/UI/Controls/TextEntry.cs +++ b/game/addons/base/code/UI/Controls/TextEntry.cs @@ -10,6 +10,8 @@ namespace Sandbox.UI; [CustomEditor( typeof( string ) )] public partial class TextEntry : BaseControl { + public override bool SupportsMultiEdit => true; + /// /// Called when the text of this text entry is changed. /// diff --git a/game/addons/base/code/UI/Controls/VectorControl.cs b/game/addons/base/code/UI/Controls/VectorControl.cs index 4d2ee841..21bd32d0 100644 --- a/game/addons/base/code/UI/Controls/VectorControl.cs +++ b/game/addons/base/code/UI/Controls/VectorControl.cs @@ -8,6 +8,8 @@ [CustomEditor( typeof( Vector4 ) )] public partial class VectorControl : BaseControl { + public override bool SupportsMultiEdit => true; + NumberEntry _x; NumberEntry _y; NumberEntry _z;