replace text buttons for exit and save with icon buttons

This commit is contained in:
Crispy 2024-12-22 21:04:27 +01:00
parent 8b62aec760
commit b9f76bb486
2 changed files with 14 additions and 10 deletions

BIN
assets/exit.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 B

View file

@ -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 {