Add scroll area to tile db

This commit is contained in:
crumblingstatue 2023-04-08 17:54:25 +02:00
parent 38b6a476d9
commit 1662857731
3 changed files with 21 additions and 17 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Before After
Before After

View file

@ -9,6 +9,9 @@ pub fn tiledb_edit_ui(ctx: &egui::Context, tile_db: &mut TileDb) {
egui::Window::new("Tiledb editor").show(ctx, |ui| {
ui.label(format!("Number of tile defs: {}", tile_db.db.len()));
ui.separator();
egui::ScrollArea::vertical()
.max_height(400.0)
.show(ui, |ui| {
for (i, def) in tile_db.db.iter_mut().enumerate() {
ui.label(i.to_string());
match &mut def.light {
@ -28,6 +31,7 @@ pub fn tiledb_edit_ui(ctx: &egui::Context, tile_db: &mut TileDb) {
}
}
}
});
ui.separator();
if ui.button("Add new default").clicked() {
tile_db.db.push(super::TileDef::default());

BIN
tiles.dat

Binary file not shown.