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 Kyle H
on
I've solved a couple of my issues with some very messy work. Don't yell at me, I'm no programmer! I have the "OFF" and "LDR" text showing correctly, but now I've noticed the liveGap binding doesnt seem to be showing the number of laps down a driver is when or if they return to the track.


using System;
using ATVO.ThemesSDK;
using ATVO.ThemeEditor.ThemeModels;
using ATVO.ThemeEditor.Scripting.DotNET;
using ATVO.ThemesSDK.Data.Results;

namespace Scripts
{
public class LiveGap : IScript
{
public object Execute(ThemeContentItem item, object value, string parameter, ISimulation sim)
{
IEntitySessionResult result = (IEntitySessionResult) value;

if (result.Out)
{
return "OFF";
}

else if (result.Position == 1)
{
return "LDR";
}
else if (result.LiveGap == 0.000)
{
return " ";
}

else
{
return result.LiveGap.ToString("-0.000");
}

}
}
}