summaryrefslogtreecommitdiffstats
path: root/src/ui.rs
blob: ab7500117572521eaed4fe26cb98eecd2f9a3403 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
pub mod topbar;
pub mod camera_info;

use std::cell::RefCell;

use cgmath::Vector3;

use crate::{GameState, eguictx::EguiCtx, solar_system, timeman::{self, Second, TimeMan}, ui::{camera_info::CameraWindowState, topbar::TopBarState}};

mod ui {
    pub use super::camera_info;
}

#[derive(Default, Clone)]
pub struct State
{
    pub topbar_sate: TopBarState,
    pub camera_info: CameraWindowState
}

impl State
{
    pub fn render(
        &mut self,
        game_state: &RefCell<GameState>,
        eguictx: &EguiCtx)
    {
        TopBarState::render(
            &mut self.topbar_sate,
            game_state,
            eguictx);

        CameraWindowState::render(
            self, 
            game_state, 
            eguictx);
    }
}