summaryrefslogtreecommitdiffstats
path: root/src/window.rs
diff options
context:
space:
mode:
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,