summaryrefslogtreecommitdiffstats
path: root/src/ui.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui.rs')
-rw-r--r--src/ui.rs14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/ui.rs b/src/ui.rs
index c2c4b05..73389a8 100644
--- a/src/ui.rs
+++ b/src/ui.rs
@@ -23,15 +23,15 @@ pub struct State
impl State
{
- pub fn render(
+ pub fn paint(
&mut self,
game_state: &RefCell<GameState>,
- eguictx: &EguiCtx)
+ ui: &mut egui::Ui)
{
let mut game_state = game_state.borrow_mut();
let topbar_action = self.topbar_sate.paint(
- eguictx,
+ ui,
&game_state,
&self.bodies_window,
&self.fleet_window);
@@ -48,13 +48,17 @@ impl State
};
let bodies_window_action =
- self.bodies_window.render(current_system, eguictx);
+ self.bodies_window.paint(ui, current_system);
if bodies_window_action.focus_body.is_some() {
self.camera_target = bodies_window_action.focus_body;
}
let fleet_window_action =
- self.fleet_window.paint(game_state.borrow(), eguictx, &self.camera_target);
+ self.fleet_window.paint(
+ ui,
+ game_state.borrow(),
+ &self.topbar_sate.current_system,
+ &self.camera_target);
if let Some(new_fleet) = fleet_window_action.new_fleet {
game_state.new_fleet_from_ui(new_fleet);