Skip to content

Commit

Permalink
Revert "Added custom shadow styles"
Browse files Browse the repository at this point in the history
This reverts commit 3357156.
  • Loading branch information
justalemon committed May 25, 2024
1 parent f137f3a commit e97053d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 91 deletions.
79 changes: 11 additions & 68 deletions LemonUI/Elements/ScaledText.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,31 +107,9 @@ public string Text
/// </summary>
public float Scale { get; set; } = 1f;
/// <summary>
/// The shadow style used for this element.
/// </summary>
public Shadow ShadowStyle { get; set; }
/// <summary>
/// If the text should have a drop down shadow.
/// </summary>
[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;
/// <summary>
/// If the test should have an outline.
/// </summary>
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -434,16 +391,9 @@ private void Add()
NativeFunction.CallByHash<int>(0x07C837F9A01C34C9, 1f, Scale);
NativeFunction.CallByHash<int>(0xBE6B23FFA53FB442, Color.R, Color.G, Color.B, Color.A);
NativeFunction.CallByHash<int>(0x4E096588B13FFECA, (int)Alignment);
if (ShadowStyle != null)
if (Shadow)
{
if (ShadowStyle.UseClassic)
{
NativeFunction.CallByHash<int>(0x1CA3E9EAC9D93E5E);
}
else
{
NativeFunction.CallByHash<int>(0x465C84BC39F1C351, ShadowStyle.Distance, ShadowStyle.Color.R, ShadowStyle.Color.G, ShadowStyle.Color.B, ShadowStyle.Color.A);
}
NativeFunction.CallByHash<int>(0x1CA3E9EAC9D93E5E);
}
if (Outline)
{
Expand Down Expand Up @@ -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)
{
Expand Down
23 changes: 0 additions & 23 deletions LemonUI/Elements/Shadow.cs

This file was deleted.

0 comments on commit e97053d

Please sign in to comment.