Browse Source

rename opacity to opacity_percent for consistency (#2310)

pull/2311/head
Jason Dove 4 days ago committed by GitHub
parent
commit
558e2ce333
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 3
      ErsatzTV.Core/Graphics/ImageGraphicsElement.cs
  2. 3
      ErsatzTV.Core/Graphics/TextGraphicsElement.cs
  3. 2
      ErsatzTV.Infrastructure/Streaming/ImageElement.cs
  4. 2
      ErsatzTV.Infrastructure/Streaming/TextElement.cs

3
ErsatzTV.Core/Graphics/ImageGraphicsElement.cs

@ -8,7 +8,8 @@ public class ImageGraphicsElement
{ {
public string Image { get; set; } public string Image { get; set; }
public int? Opacity { get; set; } [YamlMember(Alias = "opacity_percent", ApplyNamingConventions = false)]
public int? OpacityPercent { get; set; }
[YamlMember(Alias = "opacity_expression", ApplyNamingConventions = false)] [YamlMember(Alias = "opacity_expression", ApplyNamingConventions = false)]
public string OpacityExpression { get; set; } public string OpacityExpression { get; set; }

3
ErsatzTV.Core/Graphics/TextGraphicsElement.cs

@ -6,7 +6,8 @@ namespace ErsatzTV.Core.Graphics;
public class TextGraphicsElement public class TextGraphicsElement
{ {
public int? Opacity { get; set; } [YamlMember(Alias = "opacity_percent", ApplyNamingConventions = false)]
public int? OpacityPercent { get; set; }
[YamlMember(Alias = "opacity_expression", ApplyNamingConventions = false)] [YamlMember(Alias = "opacity_expression", ApplyNamingConventions = false)]
public string OpacityExpression { get; set; } public string OpacityExpression { get; set; }

2
ErsatzTV.Infrastructure/Streaming/ImageElement.cs

@ -40,7 +40,7 @@ public class ImageElement(ImageGraphicsElement imageGraphicsElement, ILogger log
} }
else else
{ {
_opacity = (imageGraphicsElement.Opacity ?? 100) / 100.0f; _opacity = (imageGraphicsElement.OpacityPercent ?? 100) / 100.0f;
} }
ZIndex = imageGraphicsElement.ZIndex ?? 0; ZIndex = imageGraphicsElement.ZIndex ?? 0;

2
ErsatzTV.Infrastructure/Streaming/TextElement.cs

@ -40,7 +40,7 @@ public class TextElement(TextGraphicsElement textElement, Dictionary<string, obj
} }
else else
{ {
_opacity = (textElement.Opacity ?? 100) / 100.0f; _opacity = (textElement.OpacityPercent ?? 100) / 100.0f;
} }
ZIndex = textElement.ZIndex ?? 0; ZIndex = textElement.ZIndex ?? 0;

Loading…
Cancel
Save