diff --git a/src/main.rs b/src/main.rs index 714d2da..742c440 100644 --- a/src/main.rs +++ b/src/main.rs @@ -201,12 +201,8 @@ impl Game { ); if let Some(solution) = solutions.get_mut(self.selected_solution) { - let bounds = Rectangle { - x: (level_list_width + 10 + entry_width + 10) as f32, - y: y as f32, - width: 220., - height: 30., - }; + let column_x = level_list_width + entry_width + 20; + let bounds = Rectangle::new(column_x as f32, y as f32, 220., 30.); text_input( d, bounds, @@ -214,12 +210,12 @@ impl Game { &mut self.editing_solution_name, true, ); + d.draw_text(solution.id(), column_x, y + 35, 10, Color::GRAY); - let button_x = level_list_width + entry_width + 20; - if simple_button(d, button_x, y + 40, 220, 30) { + if simple_button(d, column_x, y + 50, 220, 30) { self.open_editor = Some(Editor::new(solution.clone(), level.clone())); } - d.draw_text("edit", button_x + 5, y + 45, 20, Color::WHITE); + d.draw_text("edit", column_x + 5, y + 55, 20, Color::WHITE); } } else { self.solutions.insert(level.id().to_owned(), Vec::new()); diff --git a/src/marble_engine/board.rs b/src/marble_engine/board.rs index 0487607..60c93df 100644 --- a/src/marble_engine/board.rs +++ b/src/marble_engine/board.rs @@ -295,7 +295,6 @@ impl Board { } } } - dbg!(&out); out } diff --git a/src/solution.rs b/src/solution.rs index 06f60ef..addbba9 100644 --- a/src/solution.rs +++ b/src/solution.rs @@ -35,6 +35,10 @@ impl Solution { } } + pub fn id(&self) -> &str { + &self.solution_id + } + pub fn save(&self) { let dir = userdata_dir().join("solutions").join(&self.level_id); fs::create_dir_all(&dir).unwrap();