diff --git a/src/main.rs b/src/main.rs index 094509e..6d46762 100644 --- a/src/main.rs +++ b/src/main.rs @@ -13,7 +13,7 @@ use std::{ ops::DerefMut, sync::{Arc, Mutex}, thread, - time::Duration, + time::Duration, path::PathBuf, }; use config::{Config, LearnedConfig}; @@ -43,8 +43,9 @@ fn main() -> anyhow::Result<()> { } let options = eframe::NativeOptions::default(); + let exe = std::env::current_exe().unwrap_or_else(|_| PathBuf::from("supper.exe")); eframe::run_native( - "Supper OCR", + &format!("Supper OCR ({:?})", exe), options, Box::new(|_cc| Box::new(AppUi::new(state))), ); @@ -89,14 +90,14 @@ fn label_time_delta(ui: &mut Ui, time: Duration, old: Option) { ); } std::cmp::Ordering::Equal => { + ui.label("--"); + } + std::cmp::Ordering::Greater => { ui.colored_label( Color32::LIGHT_RED, "+".to_owned() + &format_time(time - old), ); } - std::cmp::Ordering::Greater => { - ui.label("--"); - } } } else { ui.label("--"); @@ -401,10 +402,10 @@ impl eframe::App for AppUi { img.show_max_size(ui, Vec2::new(600.0, 500.0)); } if !race.exported { - show_combo_box(ui, "car-combo", "Car", &self.data.cars, &mut race.car); + show_combo_box(ui, &format!("car-combo {}", i), "Car", &self.data.cars, &mut race.car); show_combo_box( ui, - "track-combo", + &format!("track-combo {}", i), "Track", &self.data.tracks, &mut race.track,