highlight completed levels green
This commit is contained in:
parent
9bee7c0e10
commit
ae226026dd
1 changed files with 8 additions and 1 deletions
|
@ -116,7 +116,14 @@ impl Game {
|
||||||
if self.selected_level == i {
|
if self.selected_level == i {
|
||||||
d.draw_rectangle_rec(bounds, Color::DARKCYAN);
|
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
|
let solution_count = self
|
||||||
.solutions
|
.solutions
|
||||||
.get(level.id())
|
.get(level.id())
|
||||||
|
|
Loading…
Reference in a new issue