1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
use super::{App, controller_feedback};
use crate::ui::scene_instance::SceneInstanceUi;
use egui::{CentralPanel, Color32, Margin, RichText};
impl App {
#[cfg_attr(feature = "profiling", profiling::function)]
pub(crate) fn config(&mut self, ui: &mut egui::Ui) {
let Some(project) = self.project.as_mut() else {
return;
};
egui::Panel::top("project config")
.resizable(false)
.frame(egui::Frame::NONE.inner_margin(Margin::from(4.0)))
.show(ui, |ui| {
if project.patch.topology.fixtures.is_empty() {
ui.painter().rect_filled(
{
let rect = ui.cursor();
rect.with_max_y(rect.min.y + 20.0)
},
0.0,
Color32::ORANGE,
);
ui.add_sized(
[ui.available_width(), 20.0],
egui::Label::new(
RichText::new("☢ No fixtures patched = no output! ☢")
.color(Color32::DARK_RED),
),
);
}
});
CentralPanel::default()
.frame(egui::Frame::NONE.inner_margin(Margin::from(4.0)))
.show(ui, |ui| {
// The patch and the scenes are borrowed apart, so the patch is
// not copied every frame.
let patch = &project.patch;
match project
.scenes_instances_grid
.get_mut(&self.selected_scene_instance)
{
Some(scene_instance) => {
controller_feedback::set_shown_effect(
ui.ctx(),
self.selected_scene_instance,
self.selected_scene_effect_editor.selected_effect,
);
scene_instance.config_ui(
ui,
&mut self.selected_scene_effect_editor,
&self.thumbnail_textures,
patch,
&self.timing,
&mut self.model.replica.assets,
&self.model.sound,
)
}
None => {
ui.label("There's no Effect to configure.");
}
};
});
}
}