disable jupiter orbital clock when not in orbit around jupiter
This commit is contained in:
parent
11dfbad5af
commit
324659e041
15
src/menu.rs
15
src/menu.rs
|
@ -481,12 +481,21 @@ pub fn update_menu(
|
||||||
id2pos.0.get(cmd::ID_PLAYER),
|
id2pos.0.get(cmd::ID_PLAYER),
|
||||||
id2pos.0.get(cmd::ID_JUPITER),
|
id2pos.0.get(cmd::ID_JUPITER),
|
||||||
) {
|
) {
|
||||||
|
let clock = if player_pos.y.abs() < 1e7 && player_pos.distance(*jupiter_pos) < 1e10
|
||||||
|
{
|
||||||
let (clock_max, clock_current) =
|
let (clock_max, clock_current) =
|
||||||
nature::pos_to_orbit_time(*player_pos, *jupiter_pos, nature::JUPITER_MASS);
|
nature::pos_to_orbit_time(*player_pos, *jupiter_pos, nature::JUPITER_MASS);
|
||||||
text.sections[0].value = format!(
|
format!(
|
||||||
"Orbital Clock:\n{} of {}\n{} {}",
|
"{} of {}",
|
||||||
nature::format_seconds_to_hour_min(clock_current),
|
nature::format_seconds_to_hour_min(clock_current),
|
||||||
nature::format_seconds_to_hour_min(clock_max),
|
nature::format_seconds_to_hour_min(clock_max)
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
String::from("ERROR: Not in orbit around Jupiter.")
|
||||||
|
};
|
||||||
|
text.sections[0].value = format!(
|
||||||
|
"Orbital Clock:\n{}\n{} {}",
|
||||||
|
clock,
|
||||||
GAME_NAME,
|
GAME_NAME,
|
||||||
settings.version.as_str()
|
settings.version.as_str()
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue