From 2672793df4940db55c814caee4ed0ebdea61e49f Mon Sep 17 00:00:00 2001 From: hut Date: Wed, 1 May 2024 18:07:51 +0200 Subject: [PATCH] give planets a different, smaller marker --- assets/models/marker_planets.glb | Bin 0 -> 4876 bytes src/commands.rs | 30 ++++++++++++------------------ src/skeleton.rs | 1 + 3 files changed, 13 insertions(+), 18 deletions(-) create mode 100644 assets/models/marker_planets.glb diff --git a/assets/models/marker_planets.glb b/assets/models/marker_planets.glb new file mode 100644 index 0000000000000000000000000000000000000000..4837970d133a403e7811d8c9b7c46ed8bbae08a8 GIT binary patch literal 4876 zcmb7Gdu&^06+i1T25q;Fu3O)&xxi=^*Sjy@hhzJ5nkLPwNl4PPBb3NaZc|H+9bG$V z6E~!-qCF%gA;BNhN+hHefyA_R{DIWe&J{x-ZEJxd)JAAi5kg%BQ}kI@3>`+To+ zwaezNO1klpm(Vpkx*{qS{LV0e;NE>E6mod2z z*LvK{q%&FH5Qg~nrHu5TVfvb%>F|xo0U@ABoSz#r%xp4~MrSd=bCZ6~IGHoj)RaAx zH3qp*AJ^K{)ju518D=t`%Jv(>$!s<`X7p!srjZ`X9p{evx$FQ|}q{{KnY5U8dQX!s;NO< z5&V1kfT-v~kRDZ4lvPEvZKAHL=oeHa)lUOuUQl&0C@P{H6hwB}cnU8@v-0dmlr&k; zf~rpaOD0W{WhKaqEJcNh-M>r-YjrR)nn)Sl$wA6k&Kxz6N1La{_y8M5pWw$|EWbc7 z9oPNHMHeSiw?lYHL^=Y3CJB5{R*-?oNhGwy_Cb440iLJh9Z8r6ja)pHN)B{oMu(24 zjV#U}&n4nnqdt?$nC0v70j<=hAm}2mi8n$I9kiUIaE+yq8Gt zWhRG{Ib5UCs>E|SGnp98(PN(L?C5UpY3^ueThZRpb+E3D3kiO%r{PF_M@QHGex3`7 z*m5#Gm>i%X5|*?3#+XSqp!fhj%4W<`fyC&sV}{wAG)}Oj1DWBGOxj52dd5d^6>u*U zKR1vWP2(%1BOH#O#JLIqQIdk1CJLI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H< zz5_nk0b5XR0S=x48FZ97d>y_4H4s1, orbit_object_id: Option, @@ -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 { diff --git a/src/skeleton.rs b/src/skeleton.rs index df5269d..f131ff3 100644 --- a/src/skeleton.rs +++ b/src/skeleton.rs @@ -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", }