give planets a different, smaller marker

This commit is contained in:
yuni 2024-05-01 18:07:51 +02:00
parent 2cb9f10f4b
commit 2672793df4
3 changed files with 13 additions and 18 deletions

Binary file not shown.

View file

@ -68,6 +68,7 @@ struct ParserState {
is_targeted_on_startup: bool,
is_sun: bool,
is_moon: bool,
is_planet: bool,
is_point_of_interest: bool,
orbit_distance: Option<f64>,
orbit_object_id: Option<String>,
@ -122,6 +123,7 @@ impl Default for ParserState {
is_targeted_on_startup: false,
is_sun: false,
is_moon: false,
is_planet: false,
is_point_of_interest: false,
orbit_distance: None,
orbit_object_id: None,
@ -290,7 +292,7 @@ pub fn load_defs(
state.is_moon = true;
}
["planet", "yes"] => {
state.is_moon = true;
state.is_planet = true;
}
["sun", "yes"] => {
state.is_sun = true;
@ -761,7 +763,7 @@ fn spawn_entities(
skeleton::load(ar_asset_name, &mut entitycmd, &*asset_server);
}
if state.is_point_of_interest {
if state.is_point_of_interest || state.is_moon || state.is_planet {
let mut entitycmd = commands.spawn((
hud::PointOfInterestMarker(actor_entity),
world::DespawnOnPlayerDeath,
@ -773,22 +775,14 @@ fn spawn_entities(
NotShadowCaster,
NotShadowReceiver,
));
skeleton::load("point_of_interest", &mut entitycmd, &*asset_server);
}
if state.is_moon {
let mut entitycmd = commands.spawn((
hud::PointOfInterestMarker(actor_entity),
world::DespawnOnPlayerDeath,
hud::ToggleableHudElement,
SpatialBundle {
visibility: Visibility::Hidden,
..default()
},
NotShadowCaster,
NotShadowReceiver,
));
skeleton::load("marker_satellites", &mut entitycmd, &*asset_server);
let model = if state.is_point_of_interest {
"point_of_interest"
} else if state.is_planet {
"marker_planets"
} else {
"marker_satellites"
};
skeleton::load(model, &mut entitycmd, &*asset_server);
}
if state.has_ring {

View file

@ -46,6 +46,7 @@ pub fn asset_name_to_path(name: &str) -> &'static str {
"clippy_ar" => "models/clippy/ar_happy.glb#Scene0",
"whale" => "models/whale.glb#Scene0",
"marker_satellites" => "models/marker_satellites.glb#Scene0",
"marker_planets" => "models/marker_planets.glb#Scene0",
"point_of_interest" => "models/point_of_interest.glb#Scene0",
_ => "models/error.glb#Scene0",
}