use egui::{Color32, Label, RichText}; use super::{State, Window}; #[derive(Debug, Default)] pub struct GuiError { text: String, } impl Window for GuiError { fn ui(&mut self, _: &mut State, ctx: &egui::Context, open: &mut bool) -> anyhow::Result<()> { egui::Window::new("ERROR!!!! D:") .open(open) .show(ctx, |ui| { ui.vertical(|ui| { ui.label(RichText::new("Error:").size(30.0).color(Color32::RED)); ui.horizontal(|ui| { ui.add(Label::new(self.text.clone()).wrap(true)); }) }) }); Ok(()) } } impl GuiError { pub fn set_error_message(&mut self, text: S) { self.text = text.to_string(); } }