A Razor UI panel that renders a dialogue line for a character's speech bubble. Applies a presentation style based on variant and age, scales the font by the player's text size preference, and filters the text through DialogueFilter using the censorship setting.
@using Sandbox
@using Sandbox.UI
@using Socer
@using System
@inherits Panel
<div class="field-speech-design speech-design-@Variant localized-text" style="@FieldSpeechPresentation.Motion(Age,Duration,Variant)"><label class="dialogue-line" style="@FormattableString.Invariant($"font-size:{15*GamePreferences.TextSizePercent/100f:0.##}px;")">@DialogueFilter.Format(Text,CleanText,GamePreferences.Censorship)</label></div>
@code {
[Parameter] public string Text {get;set;}="";
[Parameter] public string CleanText {get;set;}="";
[Parameter] public int Variant {get;set;}
[Parameter] public float Age {get;set;}
[Parameter] public float Duration {get;set;}=1.4f;
public FieldSpeechView(){StyleSheet.Load("/FieldSpeechView.razor.scss");}
protected override int BuildHash()=>HashCode.Combine(Text,CleanText,Variant,Age,Duration,GamePreferences.Revision);
}