Refine cockpit porthole and indicators

This commit is contained in:
chindit committed 2026-10-04 09:30:12 +02:00
1 parent 53288b48c8
commit c2b3ac42a3
8 files changed
+298 -10

No files matched your search

@@ -8,6 +8,9 @@ const CockpitHud = preload("res://game/presentation/cockpit/cockpit_hud.gd")
const CockpitDetailing = preload(
"res://game/presentation/cockpit/cockpit_detailing.gd"
)
const CockpitPressureBulkhead = preload(
"res://game/presentation/cockpit/cockpit_pressure_bulkhead.gd"
)
const PauseMenu = preload("res://game/presentation/pause/pause_menu.gd")
const ControlsSettingsScreen = preload(
"res://game/presentation/settings/controls_settings_screen.gd"
@@ -16,7 +19,7 @@ const ProductionInputAdapter = preload(
"res://game/infrastructure/input/production_input_adapter.gd"
)
const TEST_COUNT := 58
const TEST_COUNT := 64
var _failures: Array[String] = []
@@ -82,6 +85,16 @@ func _test_vehicle_slice(composition: VerticalSliceRoot) -> void:
var detailing: CockpitDetailing = (
instruments.detailing() if instruments != null else null
)
var pressure_bulkhead := (
instruments.get_node_or_null("%CurvedPressureBulkhead") as CockpitPressureBulkhead
if instruments != null
else null
)
var analog_gauges := (
instruments.get_node_or_null("Dashboard/AnalogGauges")
if instruments != null
else null
)
var adapter := composition.input_adapter() as ProductionInputAdapter
var hud := composition.active_screen() as CockpitHud
var sonar_service = composition.sonar_service()
@@ -91,6 +104,8 @@ func _test_vehicle_slice(composition: VerticalSliceRoot) -> void:
_expect(camera != null, "cockpit camera is attached to the submarine")
_expect(instruments != null, "physical cockpit instruments are assembled")
_expect(detailing != null, "cockpit structural detailing is assembled")
_expect(pressure_bulkhead != null, "curved pressure bulkhead is assembled")
_expect(analog_gauges != null, "dashboard analog instruments are assembled")
_expect(hud != null, "critical HUD overlay is assembled")
_expect(sonar_service != null, "production sonar service is assembled")
_expect(sonar_display != null, "shared sonar presentation is assembled")
@@ -100,6 +115,8 @@ func _test_vehicle_slice(composition: VerticalSliceRoot) -> void:
or camera == null
or instruments == null
or detailing == null
or pressure_bulkhead == null
or analog_gauges == null
or adapter == null
or hud == null
):
@@ -114,6 +131,10 @@ func _test_vehicle_slice(composition: VerticalSliceRoot) -> void:
_expect(detailing.textures_are_loaded(), "cockpit loads its overhead and analog gauge textures")
_expect(detailing.gauges_are_dashboard_mounted(), "analog gauges are mounted on the dashboard")
_expect(detailing.dashboard_control_count() >= 8, "dashboard exposes physical auxiliary controls")
_expect(pressure_bulkhead.panel_count() == 12, "porthole bulkhead uses twelve curved pressure panels")
_expect(pressure_bulkhead.rectangular_whitebox_is_hidden(), "porthole rectangular whitebox is hidden")
_expect(analog_gauges.indicator_count() == 3, "instrument binnacle exposes three inset pilot lights")
_expect(analog_gauges.active_indicator_count() == 1, "exactly one pilot light reflects the alert state")
_expect("kWh" in instruments.resources_text() and "kW" in instruments.resources_text(), "battery instrument has exact units")
_expect("L/min" in instruments.resources_text(), "oxygen instrument has volume and consumption")
_expect("bar" in instruments.integrity_text(), "hull instrument has current and certified pressure")