kaiusl / KLPlugins.DynLeaderboards

ACC leaderboard plugin for SimHub
https://kaiusl.github.io/KLPlugins.DynLeaderboards/
MIT License
13 stars 1 forks source link

Request: Valid lap status #9

Closed Mtrade closed 1 year ago

Mtrade commented 1 year ago

Hi, Great plugin and additional properties, thanks for all the hard work.

Wondering if it is possible to add a property that determines if a given car is currently on a valid lap? I.E. if Car X is on an outlap or has invalidated the current lap, return 0, else return 1 , for example.

It seems this info is available within ACC on the track map but the current Simhub property (isValidLap) is available only for yourself and not other drivers.

Thank you

kaiusl commented 1 year ago

Hi,

Yes, the validity of the lap is available through the ACC's broadcast data. That doesn't take into count in or out laps, but it should be simple to calculate it ourselves.

I'm thinking to add .IsValid, .IsOutLap and .IsInLap properties for current and last lap, such that IsValid is the property directly from ACC. Then your use case can be solved by checking if Laps.Current.IsValid == 1 && Laps.Current.IsOutLap == 0.

It's great idea to make these available👍. I'm probably going to work on it after christmas, should be relatively quick addition.

Mtrade commented 1 year ago

Great, that is perfect. Thanks for the response and implementation! Looking forward to it.

kaiusl commented 1 year ago

We now have 6 new properties for every car:

Added in cd7193e85b655f13699cdbc75860b39235d63faf, released in 1.2.1.