Make voyages active with dockside orders, crew calls, and ship PA

This commit is contained in:
josh
2026-11-27 23:14:38 -05:00
parent 7951e1c878
commit cc7620c431
71 changed files with 2723 additions and 233 deletions

View File

@@ -31,6 +31,10 @@ namespace Soundings
}
}
passageAudio.Mix(Time.unscaledDeltaTime, underway != null && !paused,
passageHelm?.Speed ?? 0, underway?.Weather ?? WeatherCondition.Calm,
passageBridge || passageExploring, passageServiceArea == 0);
if (underway != null)
{
if (!paused)
@@ -72,7 +76,10 @@ namespace Soundings
}
passageHelm.Advance(delta * passageSpeed, rudder, livePassage.SpeedFactor, underway.Weather);
float progress = passageHelm.Progress;
bool performanceWasActive = livePassage.PerformanceActive;
livePassage.AdvanceTo(progress);
if (!performanceWasActive && livePassage.PerformanceActive)
passageAudio.Announce(PassageAnnouncement.Show);
PresentVessel(delta);
harbor.UpdatePassengers(livePassage, delta);
if (passageHelm.Arrived)
@@ -94,9 +101,16 @@ namespace Soundings
{
Vector2 movement = new Vector2(MoveAxis(KeyCode.D, KeyCode.A), MoveAxis(KeyCode.W, KeyCode.S));
if (movement.sqrMagnitude > 0)
{
Vector3 previous = harbor.FirstPersonPosition;
harbor.Walk(movement, delta, Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift));
passageAudio.Step(Vector3.Distance(previous, harbor.FirstPersonPosition), passageServiceArea >= 0);
}
}
if (Input.GetKeyDown(KeyCode.F))
UseFacingStation();
if (Input.GetKeyDown(KeyCode.Home))
{
if (passageServiceArea >= 0)
@@ -123,6 +137,8 @@ namespace Soundings
UpdatePassageUi(progress);
UpdateServiceNavigation();
UpdateHelmControls();
UpdateStationInteractions();
UpdateAnnouncement();
}
private void TurnPassageCamera(float delta) =>
@@ -160,7 +176,7 @@ namespace Soundings
private bool EditingText()
{
for (var item = root.focusController?.focusedElement as VisualElement; item != null; item = item.parent)
if (item is TextField)
if (item is TextField or IntegerField)
return true;
return false;
}
@@ -183,14 +199,16 @@ namespace Soundings
passageSpeed = 1;
passageDeck = passageServiceArea = -1;
passageBridge = passageExploring = false;
stationFeedbackText = null;
passageBusinessOpen = true;
SetPassageFreeLook(false);
fleetOpen = shipActionsOpen = false;
page = 0;
Notify(null);
harbor.BeginPassage(quote.Weather);
harbor.BeginPassage(quote.Weather, PassageDuration(quote));
harbor.ShowDeck(passageDeck);
harbor.UpdatePassengers(livePassage, 0);
passageAudio.Begin();
Render();
}
@@ -271,6 +289,7 @@ namespace Soundings
livePassage = null;
passageHelm = null;
passageServiceArea = -1;
passageAudio.End();
serviceReadout = null;
SetPassageFreeLook(false);
harbor.EndPassage();