diff options
Diffstat (limited to 'src/ui/camera_info.rs')
| -rw-r--r-- | src/ui/camera_info.rs | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/src/ui/camera_info.rs b/src/ui/camera_info.rs deleted file mode 100644 index 5332370..0000000 --- a/src/ui/camera_info.rs +++ /dev/null @@ -1,58 +0,0 @@ -use std::cell::RefCell; - -use crate::{GameState, eguictx::EguiCtx, solar_system, ui}; - - -#[derive(Default, Clone)] -pub struct CameraWindowState -{ - pub camera_scale: f32, - pub camera_pos: Option<cgmath::Vector3<f64>>, - pub camera_rot: Option<cgmath::Vector2<cgmath::Rad<f32>>>, - pub target: Option<solar_system::body::BodyId>, -} - -impl CameraWindowState -{ - pub fn render( - ui_state: &mut ui::State, - game_state: &GameState, - eguictx: &EguiCtx) - { - let topbar_state = &ui_state.topbar_sate; - if topbar_state.current_system.is_none() { - return; - } - - let camera_state = &mut ui_state.camera_info; - - let current_system = &game_state.solar_systems()[topbar_state.current_system.unwrap()]; - - egui::Window::new("Debug Camera Info") - .title_bar(false) - .show(eguictx.context(), |ui| { - ui.vertical(|ui| { - let selected_body_label = match camera_state.target { - Some(id) => current_system.bodies()[id].name(), - None => "" - }; - - ui.separator(); - - egui::ComboBox::from_label("Camera Target") - .selected_text(selected_body_label) - .show_ui(ui, |ui| { - - for (i, body) in current_system.bodies().iter().enumerate() { - ui.selectable_value( - &mut camera_state.target, - Some(i), - body.name()); - } - }); - - ui.label(format!("Scale: {}", camera_state.camera_scale)); - }); - }); - } -} |
