-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
845595b
commit e8c9044
Showing
6 changed files
with
34 additions
and
25 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
use bevy::prelude::*; | ||
use bevy_egui::egui::{self, Widget}; | ||
use egui_extras::DatePickerButton; | ||
use hifitime::prelude::*; | ||
use lofitime::{HifiDateTime, LofiDateTime}; | ||
|
||
use crate::physics::time::CoordinateTime; | ||
|
||
pub fn set_time_menu(ui: &mut egui::Ui, coordinate_time: &mut ResMut<CoordinateTime>) { | ||
ui.menu_button("Coordinate Time...", |ui| { | ||
ui.menu_button("Scale...", |ui| { | ||
ui.vertical(|ui| { | ||
ui.radio_value(&mut coordinate_time.scale, TimeScale::UTC, "UTC"); | ||
ui.radio_value(&mut coordinate_time.scale, TimeScale::TAI, "TAI"); | ||
ui.radio_value(&mut coordinate_time.scale, TimeScale::BDT, "BDT"); | ||
}); | ||
}); | ||
ui.menu_button("Epoch...", |ui| { | ||
let mut selected_date = coordinate_time.epoch().to_lofi_naive().date(); | ||
if DatePickerButton::new(&mut selected_date).ui(ui).changed() { | ||
// Update the Time resource with the selected date | ||
let new_time = selected_date.and_time(chrono::NaiveTime::from_hms_milli_opt(0, 0, 0, 0).unwrap()); | ||
coordinate_time.start_epoch = Some(new_time.and_utc().to_hifi_epoch()); | ||
} | ||
}); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters