diff options
| author | Jon Santmyer <jon@jonsantmyer.com> | 2026-05-07 10:12:11 -0400 |
|---|---|---|
| committer | Jon Santmyer <jon@jonsantmyer.com> | 2026-05-07 10:12:11 -0400 |
| commit | c9041e2e6fe59d6127bb1085b874e8e3cda8000e (patch) | |
| tree | c339cf86b88743b1c74707f6d714b1a0950c43ff /src/ui.rs | |
| parent | c1adf64c1aaecd5a2b9d532d707ef35971f1aa18 (diff) | |
| download | systemic4x-c9041e2e6fe59d6127bb1085b874e8e3cda8000e.tar.gz systemic4x-c9041e2e6fe59d6127bb1085b874e8e3cda8000e.tar.bz2 systemic4x-c9041e2e6fe59d6127bb1085b874e8e3cda8000e.zip | |
more intense position-relative rendering to fix some precision problems
Diffstat (limited to 'src/ui.rs')
| -rw-r--r-- | src/ui.rs | 25 |
1 files changed, 9 insertions, 16 deletions
@@ -1,22 +1,21 @@ pub mod topbar; -pub mod camera_info; pub mod bodies_window; pub mod fleet_window; use std::{borrow::Borrow, cell::RefCell}; - -use crate::{GameState, eguictx::EguiCtx, ui::{bodies_window::BodiesWindowState, camera_info::CameraWindowState, fleet_window::FleetWindowState, topbar::TopBarState}}; - -mod ui { - -} +use crate::GameState; +use crate::eguictx::EguiCtx; +use crate::solar_system::body::BodyId; +use crate::ui::bodies_window::BodiesWindowState; +use crate::ui::fleet_window::FleetWindowState; +use crate::ui::topbar::TopBarState; #[derive(Default, Clone)] pub struct State { + pub camera_target: Option<BodyId>, pub topbar_sate: TopBarState, - pub camera_info: CameraWindowState, pub bodies_window: BodiesWindowState, pub fleet_window: FleetWindowState @@ -45,17 +44,11 @@ impl State None => return }; - CameraWindowState::render( - self, - &game_state, - eguictx); - if self.topbar_sate.bodies_window_visible { let bodies_window_action = self.bodies_window.render(current_system, eguictx); - - if let Some(body) = bodies_window_action.focus_body { - self.camera_info.target = Some(body); + if bodies_window_action.focus_body.is_some() { + self.camera_target = bodies_window_action.focus_body; } } |
