summaryrefslogtreecommitdiffstats
path: root/src/ui.rs
diff options
context:
space:
mode:
authorJon Santmyer <jon@jonsantmyer.com>2026-05-07 10:12:11 -0400
committerJon Santmyer <jon@jonsantmyer.com>2026-05-07 10:12:11 -0400
commitc9041e2e6fe59d6127bb1085b874e8e3cda8000e (patch)
treec339cf86b88743b1c74707f6d714b1a0950c43ff /src/ui.rs
parentc1adf64c1aaecd5a2b9d532d707ef35971f1aa18 (diff)
downloadsystemic4x-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.rs25
1 files changed, 9 insertions, 16 deletions
diff --git a/src/ui.rs b/src/ui.rs
index 6a48f2d..235481d 100644
--- a/src/ui.rs
+++ b/src/ui.rs
@@ -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;
}
}