Skip to content

Commit

Permalink
Rearrange
Browse files Browse the repository at this point in the history
  • Loading branch information
Masterchef365 committed Mar 13, 2024
1 parent f7c121d commit af67ce5
Showing 1 changed file with 37 additions and 36 deletions.
73 changes: 37 additions & 36 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,10 @@ impl TemplateApp {
);
});

ui.separator();
ui.strong("Save data");
self.save_menu(ui);

if self.save.working.tweak.particle_mode.uses_nodes() {
ui.separator();
ui.strong("Node graph configuration");
Expand Down Expand Up @@ -805,6 +809,39 @@ impl TemplateApp {
ui.end_row();
});

ui.separator();
ui.strong("Particle source");
Grid::new("Particle source").striped(true).show(ui, |ui| {
ui.label("Particle inflow rate: ");
ui.add(DragValue::new(&mut self.save.working.source_rate).speed(1e-1));
ui.end_row();

ui.label("Particle inflow color: ");
ui.horizontal(|ui| {
for (idx, &color) in self.save.working.life.colors.iter().enumerate() {
let color_marker = RichText::new("#####").color(color_to_egui(color));
let button = ui.selectable_label(
idx as u8 == self.save.working.source_color_idx,
color_marker,
);
if button.clicked() {
self.save.working.source_color_idx = idx as u8;
}
}
});
self.save.working.source_color_idx = self
.save
.working
.source_color_idx
.min(self.save.working.life.colors.len() as u8 - 1);

ui.end_row();

ui.label("Particle well");
ui.checkbox(&mut self.save.working.well, "Enable");
});


if self.save.working.tweak.enable_grid_transfer {
ui.separator();
ui.strong("Incompressibility Solver");
Expand Down Expand Up @@ -850,38 +887,6 @@ impl TemplateApp {
});
}

ui.separator();
ui.strong("Particle source");
Grid::new("Particle source").striped(true).show(ui, |ui| {
ui.label("Particle inflow rate: ");
ui.add(DragValue::new(&mut self.save.working.source_rate).speed(1e-1));
ui.end_row();

ui.label("Particle inflow color: ");
ui.horizontal(|ui| {
for (idx, &color) in self.save.working.life.colors.iter().enumerate() {
let color_marker = RichText::new("#####").color(color_to_egui(color));
let button = ui.selectable_label(
idx as u8 == self.save.working.source_color_idx,
color_marker,
);
if button.clicked() {
self.save.working.source_color_idx = idx as u8;
}
}
});
self.save.working.source_color_idx = self
.save
.working
.source_color_idx
.min(self.save.working.life.colors.len() as u8 - 1);

ui.end_row();

ui.label("Particle well");
ui.checkbox(&mut self.save.working.well, "Enable");
});

/*
if ui.button("Lifeless").clicked() {
self.sim
Expand Down Expand Up @@ -916,10 +921,6 @@ impl TemplateApp {
}
*/

ui.separator();
ui.strong("Save data");
self.save_menu(ui);

if do_reset {
self.reset_sim_state();
}
Expand Down

0 comments on commit af67ce5

Please sign in to comment.