mirror of
https://github.com/Noratrieb/game-wip-dontplay.git
synced 2026-01-16 20:35:02 +01:00
Add scroll area to tile db
This commit is contained in:
parent
38b6a476d9
commit
1662857731
3 changed files with 21 additions and 17 deletions
BIN
res/tiles.png
BIN
res/tiles.png
Binary file not shown.
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
|
|
@ -9,25 +9,29 @@ pub fn tiledb_edit_ui(ctx: &egui::Context, tile_db: &mut TileDb) {
|
||||||
egui::Window::new("Tiledb editor").show(ctx, |ui| {
|
egui::Window::new("Tiledb editor").show(ctx, |ui| {
|
||||||
ui.label(format!("Number of tile defs: {}", tile_db.db.len()));
|
ui.label(format!("Number of tile defs: {}", tile_db.db.len()));
|
||||||
ui.separator();
|
ui.separator();
|
||||||
for (i, def) in tile_db.db.iter_mut().enumerate() {
|
egui::ScrollArea::vertical()
|
||||||
ui.label(i.to_string());
|
.max_height(400.0)
|
||||||
match &mut def.light {
|
.show(ui, |ui| {
|
||||||
Some(light) => {
|
for (i, def) in tile_db.db.iter_mut().enumerate() {
|
||||||
ui.label("x");
|
ui.label(i.to_string());
|
||||||
ui.add(egui::DragValue::new(&mut light.x));
|
match &mut def.light {
|
||||||
ui.label("y");
|
Some(light) => {
|
||||||
ui.add(egui::DragValue::new(&mut light.y));
|
ui.label("x");
|
||||||
}
|
ui.add(egui::DragValue::new(&mut light.x));
|
||||||
None => {
|
ui.label("y");
|
||||||
if ui.button("Insert light emit").clicked() {
|
ui.add(egui::DragValue::new(&mut light.y));
|
||||||
def.light = Some(ScreenVec {
|
}
|
||||||
x: TILE_SIZE as ScreenSc / 2,
|
None => {
|
||||||
y: TILE_SIZE as ScreenSc / 2,
|
if ui.button("Insert light emit").clicked() {
|
||||||
});
|
def.light = Some(ScreenVec {
|
||||||
|
x: TILE_SIZE as ScreenSc / 2,
|
||||||
|
y: TILE_SIZE as ScreenSc / 2,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
}
|
|
||||||
ui.separator();
|
ui.separator();
|
||||||
if ui.button("Add new default").clicked() {
|
if ui.button("Add new default").clicked() {
|
||||||
tile_db.db.push(super::TileDef::default());
|
tile_db.db.push(super::TileDef::default());
|
||||||
|
|
|
||||||
BIN
tiles.dat
BIN
tiles.dat
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue