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