mod left;
mod project_menu;
pub(crate) mod tools_menu;
mod top;
pub(crate) mod view_menu;

use crate::Editor;
use crate::engine_editor::InspectorContext;
use nightshade::prelude::*;

impl Editor {
    pub fn right_panel_ui(&mut self, world: &mut World, ui_context: &egui::Context) {
        egui::SidePanel::right("right_panel")
            .default_width(250.0)
            .show(ui_context, |ui| {
                ui.heading("Inspector");
                ui.separator();
                egui::ScrollArea::vertical()
                    .id_salt("inspector_scroll")
                    .show(ui, |ui| {
                        let mut inspector_context = InspectorContext {
                            transform_edit_pending: &mut self.context.editor.transform_edit.pending,
                            undo_history: &mut self.context.editor.undo_history,
                            #[cfg(not(target_arch = "wasm32"))]
                            pending_notifications: &mut self.context.notifications,
                            actions: &mut self.context.assets.inspector_actions,
                            selection: &self.context.editor.selection,
                        };
                        if self.inspector_ui.ui(&mut inspector_context, world, ui) {
                            self.project_state.mark_modified();
                        }
                    });
            });
    }
}
