From 21d6e79529e27fcd3a247c2769d5a3adff1bfa73 Mon Sep 17 00:00:00 2001 From: ghostly_zsh Date: Fri, 28 Mar 2025 10:59:13 -0500 Subject: [PATCH] chassis --- crates/client/src/networking/mod.rs | 4 ++-- crates/common/src/lib.rs | 2 +- crates/server/parts.toml | 2 +- crates/server/src/module/mod.rs | 8 ++++---- crates/server/src/module/save.rs | 4 ++-- crates/server/src/player/player_mouse_input.rs | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/crates/client/src/networking/mod.rs b/crates/client/src/networking/mod.rs index c332e6c1028f54baca05a8fce7bbafe066c185e8..c07588bce7c86ad6dbedd6880c39d9842d606d99 100644 --- a/crates/client/src/networking/mod.rs +++ b/crates/client/src/networking/mod.rs @@ -24,7 +24,7 @@ fn texture_name(part_type: PartType, attached: bool) -> String { match part_type { Placeholder => panic!("AHHHH PLACEHOLDER PANIC"), Hearty => "hearty.svg", - Cargo => "cargo_on.svg", + Chassis => "chassis.svg", Hub => "hub_on.svg", LandingThruster => "landingthruster_on.svg", LandingThrusterSuspension => "landingleg.svg", @@ -34,7 +34,7 @@ fn texture_name(part_type: PartType, attached: bool) -> String { match part_type { Placeholder => panic!("AHHHH PLACEHOLDER PANIC"), Hearty => "hearty.svg", - Cargo => "cargo_off.svg", + Chassis => "chassis.svg", Hub => "hub_off.svg", LandingThruster => "landingthruster_off.svg", LandingThrusterSuspension => "landingleg.svg", diff --git a/crates/common/src/lib.rs b/crates/common/src/lib.rs index 71343ab05ee5d6b46c50a55d6b2439a4cdb37d38..363a40c59aab6bb3f44f960b2ac137c247103835 100644 --- a/crates/common/src/lib.rs +++ b/crates/common/src/lib.rs @@ -46,7 +46,7 @@ pub enum PartType { #[default] Placeholder, Hearty, - Cargo, + Chassis, Hub, LandingThruster, LandingThrusterSuspension, diff --git a/crates/server/parts.toml b/crates/server/parts.toml index d02f79c64ca5fd3ce14abd5458c35862192ef943..5f8867eca18b87d0fb2e9fe7e6cf69d90fecbe90 100644 --- a/crates/server/parts.toml +++ b/crates/server/parts.toml @@ -10,7 +10,7 @@ energy_capacity = 1000 thruster_force = 5 thruster_energy = 2 -[part.Cargo] +[part.Chassis] mass = 0.5 energy_capacity = 0 thruster_force = 0 diff --git a/crates/server/src/module/mod.rs b/crates/server/src/module/mod.rs index e94bdf4c5307d4fcf7279abf066a13f00a8006f7..753e251de80c46926cdf4076dc42525e00034cfb 100644 --- a/crates/server/src/module/mod.rs +++ b/crates/server/src/module/mod.rs @@ -44,7 +44,7 @@ pub fn module_spawn( transform.translation += Vec3::new(6000.0, 0.0, 0.0); let flags = PartFlags { attached: false }; let mut entity = commands.spawn(PartBundle { - part_type: c_PartType::Cargo.into(), + part_type: c_PartType::Chassis.into(), transform: TransformBundle::from(transform), flags, ..default() @@ -57,14 +57,14 @@ pub fn module_spawn( }) .insert(AdditionalMassProperties::MassProperties(MassProperties { local_center_of_mass: vec2(0.0, 0.0), - mass: part!(c_PartType::Cargo.into()).mass, + mass: part!(c_PartType::Chassis.into()).mass, principal_inertia: 7.5, })); let packet = Packet::SpawnPart { id: entity.id().index(), part: Part { - part_type: c_PartType::Cargo.into(), + part_type: c_PartType::Chassis.into(), transform: proto_transform!(transform), flags: proto_part_flags!(flags), }, @@ -479,7 +479,7 @@ fn convert_modules_recursive( module_transform, part_flags, ) = attached_query.get_mut(*child).unwrap(); - if *part_type == c_PartType::Cargo.into() { + if *part_type == c_PartType::Chassis.into() { match planet_type.0 { c_PlanetType::Mars => { *part_type = c_PartType::Hub.into(); diff --git a/crates/server/src/module/save.rs b/crates/server/src/module/save.rs index 06a3e0d7124fffa9369d3fe27fd995bbcba90b58..49dc79bd292a4f64c2c1d4e569a57772c8aef272 100644 --- a/crates/server/src/module/save.rs +++ b/crates/server/src/module/save.rs @@ -150,7 +150,7 @@ pub fn load_savefile( module .with_children(|children| { children - .spawn(if part_type.0 == c_PartType::Cargo { + .spawn(if part_type.0 == c_PartType::Chassis { Collider::cuboid(0.375, 0.46875) } else if part_type.0 == c_PartType::Hub { Collider::cuboid(0.5, 0.5) @@ -161,7 +161,7 @@ pub fn load_savefile( }) .insert(TransformBundle::from(Transform::from_xyz( 0., - if part_type.0 == c_PartType::Cargo { + if part_type.0 == c_PartType::Chassis { 0.03125 } else if part_type.0 == c_PartType::Hub { 0. diff --git a/crates/server/src/player/player_mouse_input.rs b/crates/server/src/player/player_mouse_input.rs index 418a6d6f303f65743937c6e9a26a30faff7c98b8..a76c07e4fabca45b1bd16d253e69c52aacef3959 100644 --- a/crates/server/src/player/player_mouse_input.rs +++ b/crates/server/src/player/player_mouse_input.rs @@ -139,7 +139,7 @@ pub fn mouse_picking( let x = rel_x * angle.cos() - rel_y * angle.sin(); let y = rel_x * angle.sin() + rel_y * angle.cos(); let mut bound = [-0.5, 0.5, -0.5, 0.5]; // left, right, top, bottom - if let c_PartType::Cargo = part_type.0 { + if let c_PartType::Chassis = part_type.0 { bound = [-0.375, 0.375, -0.5, 0.4375]; } @@ -164,7 +164,7 @@ pub fn mouse_picking( let x = rel_x * angle.cos() - rel_y * angle.sin(); let y = rel_x * angle.sin() + rel_y * angle.cos(); let mut bound = [-0.5, 0.5, -0.5, 0.5]; // left, right, top, bottom - if let c_PartType::Cargo = part_type.0 { + if let c_PartType::Chassis = part_type.0 { bound = [-0.375, 0.375, -0.5, 0.4375]; }