Report post

Are you sure you want to report the post shown below? This will send an email to the ATVO administrators. Please include a short reason for reporting.

Users reporting for no reason may be locked out.


Post

Posted by Lukas R
on
I got inspired by the ATVO Theme's script to change the Tower widget ticker data on the fly. In the past, I used to have different widgets for every data set, but I like the way that in the Theme example, it's via a script, which seems much easier on the FPS.

I'm trying to add to the original ConvertToGapOrInterval part that the font color of the Gap or Interval should get colourized in case the cars are close each other. However, there seem to be a problem. It says that ForeColor for Label isn't possible. How do I change the colour? Before, I used an override font colour, but that does not work, when I change the data via the script.

Also, I'd like to put P1 position data to the Bold font style and it says the same thing? And also that he tWidgetBase.Font is READ only.

var inter = race.LiveInterval;
var color = "#F59784";
var widget = item.Theme.Widgets.Find("W_Tower");

foreach (var subwidget in widget.Ticker.RepeatedSubWidgets)
{
      var label = subwidget.Labels.Find("L_Tower_Temp");ont, FontStyle.Bold);
   
      if (inter < 0.300 && inter > 0)
label.ForeColor = ColorConverter.ConvertFromString(color);
      else
label.ForetColor = System.Drawing.Color.White;
}