mirror of
https://github.com/seemueller-io/yachtpit.git
synced 2025-09-08 22:46:45 +00:00
make buttons functional
This commit is contained in:
@@ -6,10 +6,7 @@ use super::depth_gauge::DepthGauge;
|
||||
use super::compass_gauge::CompassGauge;
|
||||
use super::engine_status::EngineStatus;
|
||||
use super::navigation_display::NavigationDisplay;
|
||||
use super::gps_indicator::GpsIndicator;
|
||||
use super::radar_indicator::RadarIndicator;
|
||||
use super::ais_indicator::AisIndicator;
|
||||
use super::system_display::SystemDisplay;
|
||||
use super::system_display::{SystemDisplay, SystemIndicator, SystemDisplayArea};
|
||||
use super::wind_display::WindDisplay;
|
||||
|
||||
/// Main instrument cluster component
|
||||
@@ -145,11 +142,12 @@ pub fn setup_instrument_cluster(mut commands: Commands) {
|
||||
system_indicator_node(),
|
||||
BackgroundColor(BACKGROUND_COLOR_SECONDARY),
|
||||
BorderColor(BORDER_COLOR_SECONDARY),
|
||||
GpsIndicator,
|
||||
SystemIndicator {
|
||||
system_id: "gps".to_string(),
|
||||
},
|
||||
))
|
||||
.with_children(|indicator| {
|
||||
indicator.spawn(create_text("🛰️", FONT_SIZE_NORMAL, TEXT_COLOR_PRIMARY));
|
||||
indicator.spawn(create_text("GPS", FONT_SIZE_SMALL, TEXT_COLOR_PRIMARY));
|
||||
indicator.spawn(create_text("GPS", FONT_SIZE_NORMAL, TEXT_COLOR_PRIMARY));
|
||||
});
|
||||
|
||||
// RADAR Indicator
|
||||
@@ -158,11 +156,12 @@ pub fn setup_instrument_cluster(mut commands: Commands) {
|
||||
system_indicator_node(),
|
||||
BackgroundColor(BACKGROUND_COLOR_SECONDARY),
|
||||
BorderColor(BORDER_COLOR_SECONDARY),
|
||||
RadarIndicator,
|
||||
SystemIndicator {
|
||||
system_id: "radar".to_string(),
|
||||
},
|
||||
))
|
||||
.with_children(|indicator| {
|
||||
indicator.spawn(create_text("📡", FONT_SIZE_NORMAL, Color::linear_rgb(0.0, 1.0, 0.0)));
|
||||
indicator.spawn(create_text("RADAR", FONT_SIZE_SMALL, TEXT_COLOR_PRIMARY));
|
||||
indicator.spawn(create_text("RADAR", FONT_SIZE_NORMAL, Color::linear_rgb(0.0, 1.0, 0.0)));
|
||||
});
|
||||
|
||||
// AIS Indicator
|
||||
@@ -171,11 +170,12 @@ pub fn setup_instrument_cluster(mut commands: Commands) {
|
||||
system_indicator_node(),
|
||||
BackgroundColor(BACKGROUND_COLOR_SECONDARY),
|
||||
BorderColor(BORDER_COLOR_SECONDARY),
|
||||
AisIndicator,
|
||||
SystemIndicator {
|
||||
system_id: "ais".to_string(),
|
||||
},
|
||||
))
|
||||
.with_children(|indicator| {
|
||||
indicator.spawn(create_text("🚢", FONT_SIZE_NORMAL, TEXT_COLOR_PRIMARY));
|
||||
indicator.spawn(create_text("AIS", FONT_SIZE_SMALL, TEXT_COLOR_PRIMARY));
|
||||
indicator.spawn(create_text("AIS", FONT_SIZE_NORMAL, TEXT_COLOR_PRIMARY));
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -211,7 +211,15 @@ pub fn setup_instrument_cluster(mut commands: Commands) {
|
||||
SystemDisplay,
|
||||
))
|
||||
.with_children(|display| {
|
||||
display.spawn(create_text("Select a system above to view details", FONT_SIZE_SMALL, TEXT_COLOR_SECONDARY));
|
||||
display.spawn((
|
||||
Text::new("Select a system above to view details"),
|
||||
TextFont {
|
||||
font_size: FONT_SIZE_SMALL,
|
||||
..default()
|
||||
},
|
||||
TextColor(TEXT_COLOR_SECONDARY),
|
||||
SystemDisplayArea,
|
||||
));
|
||||
});
|
||||
});
|
||||
}
|
@@ -3,3 +3,13 @@ use bevy::prelude::*;
|
||||
/// System display component for showing detailed system information
|
||||
#[derive(Component)]
|
||||
pub struct SystemDisplay;
|
||||
|
||||
/// Component for marking UI elements as system indicators
|
||||
#[derive(Component)]
|
||||
pub struct SystemIndicator {
|
||||
pub system_id: String,
|
||||
}
|
||||
|
||||
/// Component for marking the main system display area
|
||||
#[derive(Component)]
|
||||
pub struct SystemDisplayArea;
|
||||
|
@@ -5,7 +5,6 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
|
||||
<title>yachtpit</title>
|
||||
<link data-trunk rel="copy-dir" href="assets"/>
|
||||
<link data-trunk rel="copy-dir" href="credits"/>
|
||||
<link data-trunk rel="copy-file" href="build/windows/icon.ico"/>
|
||||
<link rel="icon" href="icon.ico">
|
||||
<link data-trunk rel="inline" href="build/web/styles.css"/>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
use bevy::prelude::*;
|
||||
use std::collections::HashMap;
|
||||
use systems::{YachtSystem, SystemInteraction, SystemStatus};
|
||||
use components::YachtData;
|
||||
use components::{YachtData, SystemIndicator, SystemDisplayArea};
|
||||
|
||||
/// Resource for managing all yacht systems
|
||||
#[derive(Resource)]
|
||||
@@ -91,15 +91,6 @@ impl Default for SystemManager {
|
||||
}
|
||||
}
|
||||
|
||||
/// Component for marking UI elements as system indicators
|
||||
#[derive(Component)]
|
||||
pub struct SystemIndicator {
|
||||
pub system_id: String,
|
||||
}
|
||||
|
||||
/// Component for marking the main system display area
|
||||
#[derive(Component)]
|
||||
pub struct SystemDisplayArea;
|
||||
|
||||
/// Plugin for the system manager
|
||||
pub struct SystemManagerPlugin;
|
||||
|
Reference in New Issue
Block a user