remove area stat from solutions, add more digits to cycles and tile count in end popup

This commit is contained in:
Crispy 2024-12-09 21:26:14 +01:00
parent e3f8087a6b
commit 14b87e6971
3 changed files with 5 additions and 10 deletions

View file

@ -7,7 +7,6 @@ logic mostly like https://git.crispypin.cc/CrispyPin/marble
- undo/redo - undo/redo
- more levels - more levels
- make direct power (gate -> machine) work, (needs storing power direction in machine tiles) - make direct power (gate -> machine) work, (needs storing power direction in machine tiles)
- story/lore
- cut selections, copy to system clipboard - cut selections, copy to system clipboard
- timestamps in solutions and blueprints - timestamps in solutions and blueprints
- multiple input/output sets - multiple input/output sets

View file

@ -204,7 +204,6 @@ impl Editor {
self.score = Some(Score { self.score = Some(Score {
cycles: self.machine.step_count(), cycles: self.machine.step_count(),
tiles: self.source_board.count_tiles(), tiles: self.source_board.count_tiles(),
area: 0,
}); });
} }
} }
@ -520,11 +519,9 @@ impl Editor {
d.draw_text("Level Complete!", x + 45, y + 10, 30, Color::LIME); d.draw_text("Level Complete!", x + 45, y + 10, 30, Color::LIME);
if let Some(score) = &self.score { if let Some(score) = &self.score {
d.draw_text("cycles", x + 15, y + 45, 20, Color::WHITE); d.draw_text("cycles", x + 15, y + 45, 20, Color::WHITE);
draw_usize(d, textures, score.cycles, x + 10, y + 70, 6, 2); draw_usize(d, textures, score.cycles, x + 10, y + 70, 9, 2);
d.draw_text("tiles", x + 145, y + 45, 20, Color::WHITE); d.draw_text("tiles", x + 215, y + 45, 20, Color::WHITE);
draw_usize(d, textures, score.tiles, x + 140, y + 70, 4, 2); draw_usize(d, textures, score.tiles, x + 210, y + 70, 5, 2);
d.draw_text("area", x + 155 + 80, y + 45, 20, Color::WHITE);
draw_usize(d, textures, score.area, x + 150 + 80, y + 70, 4, 2);
} }
if simple_button(d, x + 10, y + 110, 140, 45) { if simple_button(d, x + 10, y + 110, 140, 45) {
self.complete_popup = Popup::Dismissed; self.complete_popup = Popup::Dismissed;

View file

@ -21,7 +21,6 @@ pub struct Solution {
pub struct Score { pub struct Score {
pub cycles: usize, pub cycles: usize,
pub tiles: usize, pub tiles: usize,
pub area: usize,
} }
impl Solution { impl Solution {
@ -59,8 +58,8 @@ impl Solution {
pub fn score_text(&self) -> String { pub fn score_text(&self) -> String {
if let Some(score) = &self.score { if let Some(score) = &self.score {
format!( format!(
"C: {} T: {} A: {}", "C: {} T: {}",
score.cycles, score.tiles, score.area score.cycles, score.tiles
) )
} else { } else {
"unsolved".into() "unsolved".into()