chore: sync codebase remediation, gameplay systems, and docs
Security & infrastructure: - Remove unused services/ (auth, spacetimedb) and auth.db - Add .env.example template, expand .gitignore for env/db files - Add GitHub Actions CI + commitlint config and workflows - Add manual vendor chunking and source maps to docs/site vite configs Shared UI & docs app: - Add ARIA props and focus-visible rings to Button/Panel - Add ButtonAsLink primitive; use shared Button in NotFound - Wire @void-nav/ui into docs app; refresh content pages - Replace Todo page with Kanban board Gameplay (Bevy): - Add ai module (behavior, faction, navigation, perception, spawning, states) - Add narrative module (events, history, synthesis, ui) - Refine galaxy contents and in-system flight/scene systems
This commit is contained in:
@@ -13,7 +13,8 @@ use crate::gameplay::movement::components::{Velocity, MoveTarget};
|
||||
use crate::gameplay::galaxy::Identifiable;
|
||||
use super::{DockedState, UndockEvent};
|
||||
use super::scene::{Docked, PlayerShip};
|
||||
use super::flight_ui::setup_flight_ui;
|
||||
// UI removed - no longer needed
|
||||
// use super::flight_ui::setup_flight_ui;
|
||||
|
||||
/// Flight state component attached to the player ship when actively flying.
|
||||
#[derive(Component, Debug, Clone, Default)]
|
||||
@@ -53,7 +54,7 @@ fn handle_undock(
|
||||
mut docked_state: ResMut<DockedState>,
|
||||
mut camera_state: ResMut<CameraState>,
|
||||
player_query: Query<(Entity, &Transform), (With<PlayerShip>, With<Docked>)>,
|
||||
docked_ui_query: Query<Entity, With<super::ui::DockedUi>>,
|
||||
// docked_ui_query removed - UI no longer needed
|
||||
) {
|
||||
for event in events.read() {
|
||||
bevy::log::info!("Handling undock from station {:?}", event.station_entity);
|
||||
@@ -86,19 +87,19 @@ fn handle_undock(
|
||||
// Update docked state resource
|
||||
docked_state.undock();
|
||||
|
||||
// Transition camera to follow mode
|
||||
// Transition camera to tactical follow mode (isometric view)
|
||||
camera_state.mode = CameraMode::Follow;
|
||||
camera_state.target_entity = Some(player_entity);
|
||||
camera_state.follow_distance = 15.0;
|
||||
camera_state.follow_height = 5.0;
|
||||
camera_state.follow_distance = 45.0; // Higher for tactical view
|
||||
camera_state.follow_height = 35.0; // Isometric angle
|
||||
|
||||
// Spawn flight HUD
|
||||
setup_flight_ui(commands.reborrow());
|
||||
// UI removed - gameplay only
|
||||
// setup_flight_ui(commands.reborrow());
|
||||
|
||||
// Despawn docked UI
|
||||
for entity in docked_ui_query.iter() {
|
||||
commands.entity(entity).despawn();
|
||||
}
|
||||
// Despawn docked UI (commented out - UI being removed)
|
||||
// for entity in docked_ui_query.iter() {
|
||||
// commands.entity(entity).despawn();
|
||||
// }
|
||||
|
||||
bevy::log::info!("Transitioned to flight mode");
|
||||
}
|
||||
@@ -111,7 +112,7 @@ fn handle_docking(
|
||||
mut docked_state: ResMut<DockedState>,
|
||||
mut camera_state: ResMut<CameraState>,
|
||||
identifiable_query: Query<&Identifiable>,
|
||||
flight_ui_query: Query<Entity, With<super::flight_ui::FlightUi>>,
|
||||
// flight_ui_query removed - UI no longer needed
|
||||
) {
|
||||
for event in events.read() {
|
||||
bevy::log::info!("Handling docking at target {:?}", event.station);
|
||||
@@ -137,13 +138,13 @@ fn handle_docking(
|
||||
camera_state.mode = CameraMode::Cinematic;
|
||||
camera_state.target_entity = Some(event.station);
|
||||
|
||||
// UI removed - no longer needed
|
||||
// Despawn flight HUD
|
||||
for entity in flight_ui_query.iter() {
|
||||
commands.entity(entity).despawn();
|
||||
}
|
||||
|
||||
// for entity in flight_ui_query.iter() {
|
||||
// commands.entity(entity).despawn();
|
||||
// }
|
||||
// Respawn docked UI
|
||||
super::ui::setup_docked_ui(commands.reborrow());
|
||||
// super::ui::setup_docked_ui(commands.reborrow());
|
||||
|
||||
bevy::log::info!("Docked at {}", identifiable.display_name);
|
||||
}
|
||||
|
||||
@@ -39,24 +39,27 @@ impl Plugin for InSystemPlugin {
|
||||
OnEnter(AppState::InGame),
|
||||
(
|
||||
scene::setup_in_system_view,
|
||||
ui::setup_docked_ui,
|
||||
// UI removed - no longer needed
|
||||
// ui::setup_docked_ui,
|
||||
add_targetable_to_pois,
|
||||
).chain(),
|
||||
)
|
||||
.add_systems(
|
||||
OnExit(AppState::InGame),
|
||||
(
|
||||
ui::despawn_docked_ui,
|
||||
flight_ui::despawn_flight_ui,
|
||||
// UI removed - no longer needed
|
||||
// ui::despawn_docked_ui,
|
||||
// flight_ui::despawn_flight_ui,
|
||||
scene::despawn_in_system_scene,
|
||||
).chain(),
|
||||
)
|
||||
.add_systems(
|
||||
Update,
|
||||
(
|
||||
ui::refresh_docked_ui,
|
||||
ui::undock_button_handler,
|
||||
flight_ui::update_flight_ui,
|
||||
// UI removed - no longer needed
|
||||
// ui::refresh_docked_ui,
|
||||
// ui::undock_button_handler,
|
||||
// flight_ui::update_flight_ui,
|
||||
handle_action_triggered,
|
||||
)
|
||||
.chain()
|
||||
|
||||
@@ -248,9 +248,48 @@ fn spawn_system_scene(
|
||||
contents,
|
||||
star_entity,
|
||||
&content_assets,
|
||||
materials,
|
||||
);
|
||||
});
|
||||
|
||||
// Spawn tactical grid helper for spatial reference
|
||||
// Matches the movement demo styling: subtle dark grid
|
||||
const GRID_SIZE: f32 = 200.0;
|
||||
const GRID_DIVISIONS: usize = 20;
|
||||
const GRID_COLOR: Color = Color::srgba(0.05, 0.08, 0.13, 0.5); // #0d1520 with transparency
|
||||
|
||||
// Create grid lines
|
||||
let step = GRID_SIZE / GRID_DIVISIONS as f32;
|
||||
let half_size = GRID_SIZE * 0.5;
|
||||
|
||||
for i in 0..=GRID_DIVISIONS {
|
||||
let offset = (i as f32 * step) - half_size;
|
||||
|
||||
// X-axis line
|
||||
commands.spawn((
|
||||
Mesh3d(meshes.add(Cuboid::new(GRID_SIZE, 0.02, 0.02))),
|
||||
MeshMaterial3d(materials.add(StandardMaterial {
|
||||
base_color: GRID_COLOR,
|
||||
unlit: true,
|
||||
..default()
|
||||
})),
|
||||
Transform::from_translation(Vec3::new(0.0, -2.0, offset)),
|
||||
InSystemSpawned,
|
||||
));
|
||||
|
||||
// Z-axis line
|
||||
commands.spawn((
|
||||
Mesh3d(meshes.add(Cuboid::new(0.02, 0.02, GRID_SIZE))),
|
||||
MeshMaterial3d(materials.add(StandardMaterial {
|
||||
base_color: GRID_COLOR,
|
||||
unlit: true,
|
||||
..default()
|
||||
})),
|
||||
Transform::from_translation(Vec3::new(offset, -2.0, 0.0)),
|
||||
InSystemSpawned,
|
||||
));
|
||||
}
|
||||
|
||||
// If we have a docking target, spawn player ship docked at it
|
||||
let station_entity = if let Some(target) = docking_target {
|
||||
// Calculate target position
|
||||
|
||||
Reference in New Issue
Block a user