use crate::ecs::world::World;
#[derive(Default)]
pub struct EguiState {
pub enabled: bool,
pub frame_active: bool,
pub state: Option<egui_winit::State>,
pub frame_output: Option<(egui::FullOutput, Vec<egui::ClippedPrimitive>)>,
#[cfg(target_arch = "wasm32")]
pub wasm_paste_queue: std::sync::Arc<std::sync::Mutex<Vec<String>>>,
}
pub fn egui_context(world: &World) -> Option<egui::Context> {
if !world.resources.egui.frame_active {
return None;
}
world
.resources
.egui
.state
.as_ref()
.map(|state| state.egui_ctx().clone())
}
pub struct EguiPlugin;
impl crate::app::Plugin for EguiPlugin {
fn build(&self, app: &mut crate::app::App) {
app.world.resources.egui.enabled = true;
}
}