Skip to content

Commit

Permalink
- Adding logic for property generation for Overlay properties
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Olivo committed Oct 30, 2024
1 parent 00965ab commit 0960457
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions MixItUp.Base/Model/Overlay/OverlayPropertyV3Model.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,34 @@ public OverlayFontV3Model FontValue
return null;
}
}

public Dictionary<string, object> GetGenerationProperties()
{
Dictionary<string, object> properties = new Dictionary<string, object>();
if (this.Type == OverlayPropertyTypeV3Enum.Font)
{
properties[this.Name + nameof(this.FontValue.FontSize)] = this.FontValue.FontSize;
properties[this.Name + nameof(this.FontValue.FontFamily)] = this.FontValue.FontFamily;
properties[this.Name + nameof(this.FontValue.FontColor)] = this.FontValue.FontColor;
properties[this.Name + nameof(this.FontValue.FontWeight)] = this.FontValue.FontWeight;
properties[this.Name + nameof(this.FontValue.TextDecoration)] = this.FontValue.TextDecoration;
properties[this.Name + nameof(this.FontValue.FontStyle)] = this.FontValue.FontStyle;
properties[this.Name + nameof(this.FontValue.TextAlignment)] = this.FontValue.TextAlignment.ToString().ToLower();
properties[this.Name + nameof(this.FontValue.ShadowColor)] = (!string.IsNullOrEmpty(this.FontValue.ShadowColor)) ? $"1px 1px {this.FontValue.ShadowColor}" : "none";
}
else if (this.Type == OverlayPropertyTypeV3Enum.Number)
{
properties[this.Name] = this.NumberValue;
}
else if (this.Type == OverlayPropertyTypeV3Enum.Checkbox)
{
properties[this.Name] = this.CheckboxValue;
}
else
{
properties[this.Name] = this.TextValue;
}
return properties;
}
}
}

0 comments on commit 0960457

Please sign in to comment.