diff --git a/src/main.rs b/src/main.rs index 0b5585c..b79aefb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -207,6 +207,17 @@ fn show_race_state( let mut prev_lap: Option<&LapState> = None; let fastest_lap = race.fastest_lap(); for (i, lap) in race.laps.iter_mut().enumerate() { + if let Some(prev) = &prev_lap { + if lap.gas.unwrap_or_default() > prev.gas.unwrap_or(usize::MAX) || lap.tyres.unwrap_or_default() > prev.tyres.unwrap_or(usize::MAX) { + ui.separator(); + ui.separator(); + ui.separator(); + ui.separator(); + ui.separator(); + ui.separator(); + ui.end_row(); + } + } if let Some(lap_time) = lap.lap_time { ui.label(format!("#{}", lap.lap.unwrap_or(i + 1))); ui.label(format!("P{}", lap.position.unwrap_or_default())); diff --git a/src/state.rs b/src/state.rs index 36a34dd..e5316dd 100644 --- a/src/state.rs +++ b/src/state.rs @@ -143,7 +143,7 @@ impl RaceState { } pub fn fastest_lap(&self) -> Option { - self.laps.iter().filter_map(|lap| lap.lap_time).min() + self.laps.iter().filter(|lap| !lap.striked).filter_map(|lap| lap.lap_time).min() } pub fn tyre_wear(&self) -> Option { diff --git a/suggestions.md b/suggestions.md index cded99a..5388da4 100644 --- a/suggestions.md +++ b/suggestions.md @@ -6,8 +6,8 @@ - Detect car name from load screen - Post race metric charts - Show during race instead of table (?) - - Fix 0 tyres parsing as ".0" - [PARTIAL] TTS for pit strategies + - [DONE] Fix 0 tyres parsing as ".0" - [DONE] Show delta positions - [DONE] Track penalties - [DONE] Re-do debug/learn functionality