highlight completed levels green

This commit is contained in:
Crispy 2024-10-06 23:44:29 +02:00
parent 9bee7c0e10
commit ae226026dd

View file

@ -116,7 +116,14 @@ impl Game {
if self.selected_level == i {
d.draw_rectangle_rec(bounds, Color::DARKCYAN);
}
d.draw_text(level.name(), 10, y, 30, Color::WHITE);
let mut title_color = Color::WHITE;
if let Some(solutions) = self.solutions.get(level.id()) {
if solutions.iter().any(|s| s.score.is_some()) {
title_color = Color::LIGHTGREEN;
}
}
d.draw_text(level.name(), 10, y, 30, title_color);
let solution_count = self
.solutions
.get(level.id())