working emulator UI - just need to implement the instruction set

This commit is contained in:
2025-06-15 00:39:08 +01:00
parent 68c8da4271
commit 4e9cc2849e
16 changed files with 5219 additions and 56 deletions
+30
View File
@@ -0,0 +1,30 @@
use crate::emulator::ui::interface::{Category, EmulatorUI};
pub fn render_menu(state: &mut EmulatorUI, ui: &mut egui::Ui, _ctx: &egui::Context) {
ui.with_layout(
egui::Layout::top_down_justified(egui::Align::Center),
|ui| {
ui.set_max_width(300.0);
ui.set_min_width(300.0);
ui.spacing_mut().button_padding = egui::vec2(10.0, 5.0);
for cat in Category::list() {
ui.add_space(10.0);
ui.heading(cat.as_str());
ui.add_space(10.0);
for comp in state.components.iter_mut() {
let name = comp.name();
if comp.category() == cat {
ui.toggle_value(comp.visible(), name);
}
}
ui.add_space(10.0);
ui.separator();
}
ui.add_space(10.0);
},
);
}