~starkingdoms/starkingdoms

967e654f181005058e691f7663a35ec39a14d2f4 — ghostly_zsh 16 hours ago a83976b
feat: drill button below close button + planet resources
M crates/unified/assets/config/planets.pc.toml => crates/unified/assets/config/planets.pc.toml +1 -0
@@ 38,6 38,7 @@ indicator_sprite = "textures/moon_icon.png"
radius = 545.4 # m
mass = 360_236_000.0 # kg
default_transform = [312_700.0, 0.0, 0.0]
planet_resource = { name = "Silicon", color = { LinearRgba = { red = 0.7, green = 0.7, blue = 0.7, alpha = 1.0 } }, mining_speed = 2.0 }
orbit = { orbiting = "Earth", eccentricity = 0.0549 }

[[planets]]

M crates/unified/src/client/crafting/ui.rs => crates/unified/src/client/crafting/ui.rs +5 -0
@@ 51,6 51,8 @@ fn setup_ui(
            top: Val::Px(parent_pos.y),
            width: Val::Px(100.0),
            height: Val::Px(100.0),
            display: Display::Flex,
            flex_direction: FlexDirection::Column,
            ..default()
        },
        AutoFocus,


@@ 84,6 86,8 @@ fn setup_ui(
        if let Ok(drill) = drills.get(parent_part) {
            parent.spawn((
                Node {
                    width: Val::Px(100.0),
                    height: Val::Px(30.0),
                    ..Default::default()
                },
                Button,


@@ 96,6 100,7 @@ fn setup_ui(
                    Node {
                        ..Default::default()
                    },
                    TextLayout::new(Justify::Center, LineBreak::WordBoundary),
                    TextFont {
                        font_size: 10.0,
                        ..Default::default()

M crates/unified/src/config/planet.rs => crates/unified/src/config/planet.rs +8 -0
@@ 16,11 16,19 @@ pub struct Planet {
    pub radius: f32,
    pub mass: f32,
    pub default_transform: [f32; 3],
    pub planet_resource: Option<PlanetResource>,
    pub special_sprite_properties: Option<SpecialSpriteProperties>,
    pub orbit: Option<OrbitData>
}

#[derive(Deserialize, TypePath, Serialize, Clone, Debug)]
pub struct PlanetResource {
    pub name: String,
    pub color: Color,
    pub mining_speed: f32, // resource / second
}

#[derive(Deserialize, TypePath, Serialize, Clone, Debug)]
pub struct OrbitData {
    pub orbiting: String,
    pub eccentricity: f32,