diff --git a/assets/exit.png b/assets/exit.png new file mode 100644 index 0000000..2dca7a5 Binary files /dev/null and b/assets/exit.png differ diff --git a/src/editor.rs b/src/editor.rs index bacdfa3..7f116ff 100644 --- a/src/editor.rs +++ b/src/editor.rs @@ -675,23 +675,27 @@ impl Editor { ); if self.exit_menu { - if simple_button(d, 5, 5, 75, 30) { - self.exit_menu = false; - } - d.draw_text("cancel", 10, 10, 20, Color::WHITE); - if simple_button(d, 85, 5, 60, 30) { + if simple_button(d, 4, 4, 32, 32) { self.exit_state = ExitState::ExitAndSave; } - d.draw_text("exit", 90, 10, 20, Color::WHITE); + self.tooltip.add(4, 4, 32, 32, "exit"); + draw_scaled_texture(d, textures.get("exit"), 4, 4, 2.); + if simple_button(d, 38, 4, 32, 32) { + self.exit_menu = false; + } + draw_scaled_texture(d, textures.get("cancel"), 38, 4, 2.); + self.tooltip.add(38, 4, 32, 32, "cancel"); } else { - if simple_button(d, 5, 5, 75, 30) { + if simple_button(d, 4, 4, 32, 32) { self.exit_menu = true; } - d.draw_text("exit", 10, 10, 20, Color::WHITE); - if simple_button(d, 85, 5, 60, 30) { + self.tooltip.add(4, 4, 32, 32, "exit"); + draw_scaled_texture(d, textures.get("exit"), 4, 4, 2.); + if simple_button(d, 38, 4, 32, 32) { self.exit_state = ExitState::Save; } - d.draw_text("save", 90, 10, 20, Color::WHITE); + draw_scaled_texture(d, textures.get("save"), 38, 4, 2.); + self.tooltip.add(38, 4, 32, 32, "save"); } if self.sim_state == SimState::Editing {