mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-01-28 16:21:06 -05:00
This commit imports the C# engine code and game files, excluding C++ source code. [Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
70 lines
1.3 KiB
C#
70 lines
1.3 KiB
C#
namespace Sandbox.UI
|
|
{
|
|
public partial class Styles
|
|
{
|
|
public override void Add( BaseStyles bs )
|
|
{
|
|
base.Add( bs );
|
|
|
|
if ( bs is not Styles a )
|
|
return;
|
|
|
|
if ( a.HasTransitions )
|
|
{
|
|
if ( Transitions == null )
|
|
Transitions = new TransitionList();
|
|
|
|
Transitions.AddTransitions( a.Transitions );
|
|
}
|
|
|
|
BoxShadow.AddFrom( a.BoxShadow );
|
|
TextShadow.AddFrom( a.TextShadow );
|
|
FilterDropShadow.AddFrom( a.FilterDropShadow );
|
|
|
|
if ( !a.TextGradient.ColorOffsets.IsDefaultOrEmpty )
|
|
{
|
|
TextGradient = a.TextGradient;
|
|
}
|
|
}
|
|
|
|
public override void From( BaseStyles bs )
|
|
{
|
|
base.From( bs );
|
|
|
|
if ( bs is not Styles a ) return;
|
|
|
|
CopyShadows( bs );
|
|
|
|
Transitions?.Clear();
|
|
|
|
if ( a.HasTransitions )
|
|
{
|
|
Transitions ??= new TransitionList();
|
|
|
|
Transitions.AddTransitions( a.Transitions );
|
|
}
|
|
|
|
TextGradient = a.TextGradient;
|
|
|
|
}
|
|
|
|
internal void CopyShadows( BaseStyles bs )
|
|
{
|
|
if ( bs is not Styles a )
|
|
return;
|
|
|
|
BoxShadow.Clear();
|
|
BoxShadow.IsNone = a.BoxShadow.IsNone;
|
|
BoxShadow.AddRange( a.BoxShadow );
|
|
|
|
TextShadow.Clear();
|
|
TextShadow.IsNone = a.TextShadow.IsNone;
|
|
TextShadow.AddRange( a.TextShadow );
|
|
|
|
FilterDropShadow.Clear();
|
|
FilterDropShadow.IsNone = a.FilterDropShadow.IsNone;
|
|
FilterDropShadow.AddRange( a.FilterDropShadow );
|
|
}
|
|
}
|
|
}
|