summaryrefslogtreecommitdiffstats
path: root/src/window.rs
diff options
context:
space:
mode:
authorJon Santmyer <jon@jonsantmyer.com>2026-05-03 17:31:47 -0400
committerJon Santmyer <jon@jonsantmyer.com>2026-05-03 17:31:47 -0400
commit759d5d27c7773c7fe8b165ce08b57204db990b74 (patch)
treeb9fd06e7b76490ba15dd3a87d83253a7b0bd68cf /src/window.rs
parentb14dd1c1f3e198137fa8b9e0c4f5e56949b11cd0 (diff)
downloadsystemic4x-759d5d27c7773c7fe8b165ce08b57204db990b74.tar.gz
systemic4x-759d5d27c7773c7fe8b165ce08b57204db990b74.tar.bz2
systemic4x-759d5d27c7773c7fe8b165ce08b57204db990b74.zip
move topbar ui rendering into it's own module
Diffstat (limited to 'src/window.rs')
-rw-r--r--src/window.rs15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/window.rs b/src/window.rs
index ce1b555..c64d653 100644
--- a/src/window.rs
+++ b/src/window.rs
@@ -44,7 +44,10 @@ impl GameWindow
winit::dpi::LogicalSize::new(1.0, 1.0));
let ui_state = ui::State{
- current_system: Some(0),
+ topbar_sate: ui::topbar::TopBarState {
+ current_system : Some(0),
+ ..Default::default()
+ },
camera_info: ui::camera_info::CameraWindowState {
target: Some(0),
..Default::default()
@@ -68,13 +71,13 @@ impl GameWindow
dt: Duration)
{
let mut game_state = game_state.borrow_mut();
- if self.ui_state.do_auto_tick {
- game_state.timeman.auto_tick = self.ui_state.auto_time;
+ if self.ui_state.topbar_sate.do_auto_tick {
+ game_state.timeman.auto_tick = self.ui_state.topbar_sate.auto_tick;
}else{
game_state.timeman.auto_tick = None;
}
- let current_system = match self.ui_state.current_system {
+ let current_system = match self.ui_state.topbar_sate.current_system {
Some(id) => &game_state.solar_systems()[id],
None => { return; }
};
@@ -98,9 +101,9 @@ impl GameWindow
return Ok(());
}
- if self.ui_state.current_system.is_some() {
+ if self.ui_state.topbar_sate.current_system.is_some() {
let game_state = game_state.borrow();
- let current_system = &game_state.solar_systems()[self.ui_state.current_system.unwrap()];
+ let current_system = &game_state.solar_systems()[self.ui_state.topbar_sate.current_system.unwrap()];
self.tactical_map.draw(
&self.wgpuctx,