diff --git a/LemonUI/Elements/ScaledText.cs b/LemonUI/Elements/ScaledText.cs index e7b9421..9da274f 100644 --- a/LemonUI/Elements/ScaledText.cs +++ b/LemonUI/Elements/ScaledText.cs @@ -107,31 +107,9 @@ public string Text /// public float Scale { get; set; } = 1f; /// - /// The shadow style used for this element. - /// - public Shadow ShadowStyle { get; set; } - /// /// If the text should have a drop down shadow. /// - [Obsolete("Please use ShadowStyle with UseClassic set to true", true)] - public bool Shadow - { - get => ShadowStyle != null; - set - { - if (value) - { - ShadowStyle = new Shadow - { - UseClassic = true - }; - } - else - { - ShadowStyle = null; - } - } - } + public bool Shadow { get; set; } = false; /// /// If the test should have an outline. /// @@ -305,16 +283,9 @@ private void Add() API.SetTextScale(1f, Scale); API.SetTextColour(Color.R, Color.G, Color.B, Color.A); API.SetTextJustification((int)Alignment); - if (ShadowStyle != null) + if (Shadow) { - if (ShadowStyle.UseClassic) - { - API.SetTextDropShadow(); - } - else - { - API.SetTextDropshadow(ShadowStyle.Distance, ShadowStyle.Color.R, ShadowStyle.Color.G, ShadowStyle.Color.B, ShadowStyle.Color.A); - } + API.SetTextDropShadow(); } if (Outline) { @@ -348,16 +319,9 @@ private void Add() Alt.Natives.SetTextScale(1f, Scale); Alt.Natives.SetTextColour(Color.R, Color.G, Color.B, Color.A); Alt.Natives.SetTextJustification((int)Alignment); - if (ShadowStyle != null) + if (Shadow) { - if (ShadowStyle.UseClassic) - { - Alt.Natives.SetTextDropShadow(); - } - else - { - Alt.Natives.SetTextDropshadow(ShadowStyle.Distance, ShadowStyle.Color.R, ShadowStyle.Color.G, ShadowStyle.Color.B, ShadowStyle.Color.A); - } + Alt.Natives.SetTextDropShadow(); } if (Outline) { @@ -391,16 +355,9 @@ private void Add() Invoker.Invoke(Natives.SetTextScale, 1f, Scale); Invoker.Invoke(Natives.SetTextColour, Color.R, Color.G, Color.B, Color.A); Invoker.Invoke(Natives.SetTextJustification, (int)Alignment); - if (ShadowStyle != null) + if (Shadow) { - if (ShadowStyle.UseClassic) - { - Invoker.Invoke(Natives.SetTextDropShadow); - } - else - { - Invoker.Invoke(Natives.SetTextDropshadow, ShadowStyle.Distance, ShadowStyle.Color.R, ShadowStyle.Color.G, ShadowStyle.Color.B, ShadowStyle.Color.A); - } + Invoker.Invoke(Natives.SetTextDropShadow); } if (Outline) { @@ -434,16 +391,9 @@ private void Add() NativeFunction.CallByHash(0x07C837F9A01C34C9, 1f, Scale); NativeFunction.CallByHash(0xBE6B23FFA53FB442, Color.R, Color.G, Color.B, Color.A); NativeFunction.CallByHash(0x4E096588B13FFECA, (int)Alignment); - if (ShadowStyle != null) + if (Shadow) { - if (ShadowStyle.UseClassic) - { - NativeFunction.CallByHash(0x1CA3E9EAC9D93E5E); - } - else - { - NativeFunction.CallByHash(0x465C84BC39F1C351, ShadowStyle.Distance, ShadowStyle.Color.R, ShadowStyle.Color.G, ShadowStyle.Color.B, ShadowStyle.Color.A); - } + NativeFunction.CallByHash(0x1CA3E9EAC9D93E5E); } if (Outline) { @@ -477,16 +427,9 @@ private void Add() Function.Call(Hash.SET_TEXT_SCALE, 1f, Scale); Function.Call(Hash.SET_TEXT_COLOUR, Color.R, Color.G, Color.B, Color.A); Function.Call(Hash.SET_TEXT_JUSTIFICATION, (int)Alignment); - if (ShadowStyle != null) + if (Shadow) { - if (ShadowStyle.UseClassic) - { - Function.Call(Hash.SET_TEXT_DROP_SHADOW); - } - else - { - Function.Call(Hash.SET_TEXT_DROPSHADOW, ShadowStyle.Distance, ShadowStyle.Color.R, ShadowStyle.Color.G, ShadowStyle.Color.B, ShadowStyle.Color.A); - } + Function.Call(Hash.SET_TEXT_DROP_SHADOW); } if (Outline) { diff --git a/LemonUI/Elements/Shadow.cs b/LemonUI/Elements/Shadow.cs deleted file mode 100644 index 19dc2e0..0000000 --- a/LemonUI/Elements/Shadow.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.Drawing; - -namespace LemonUI.Elements -{ - /// - /// Defines the shadow style for a . - /// - public class Shadow - { - /// - /// The color used for the shadow. - /// - public Color Color { get; set; } - /// - /// The distance of the shadow. - /// - public int Distance { get; set; } - /// - /// Whether the shadow should use the classic non configurable style. - /// - public bool UseClassic { get; set; } - } -}