Make voyages active with dockside orders, crew calls, and ship PA
This commit is contained in:
@@ -13,7 +13,7 @@ namespace Soundings
|
||||
private readonly Button[] passagePlus = new Button[5];
|
||||
private bool passageBusinessOpen = true;
|
||||
private VisualElement passageProgress, passageEventHost;
|
||||
private Label passageRemaining, passageHappiness, passageHealth, passageSupplies, passageSales, passageEventClock, passageEventResult;
|
||||
private Label passageRemaining, passageHappiness, passageHealth, passageSupplies, passageSales, passageEventClock, passageEventResult, passagePerformance;
|
||||
private float renderedPassageProgress = -1, nextPassageReadout;
|
||||
private Button passageEventAccept;
|
||||
private string passageEventTitle;
|
||||
@@ -40,6 +40,7 @@ namespace Soundings
|
||||
passageSales = null;
|
||||
passageHealth = null;
|
||||
passageSupplies = null;
|
||||
passagePerformance = null;
|
||||
for (int i = 0; i < PassageServices.Length; i++)
|
||||
{
|
||||
passageDemand[i] = null;
|
||||
@@ -57,7 +58,9 @@ namespace Soundings
|
||||
passageEventAccept = null;
|
||||
passageEventResult = null;
|
||||
|
||||
var controls = Add(overlay, "voyage-deckbar");
|
||||
var footer = Add(overlay, "voyage-footer");
|
||||
footer.pickingMode = PickingMode.Ignore;
|
||||
var controls = Add(footer, "voyage-deckbar");
|
||||
controls.pickingMode = PickingMode.Ignore;
|
||||
AddText(controls, "SHIP VIEW", "voyage-caption voyage-deck-caption");
|
||||
AddPassageDeckButton(controls, -1, "Exterior", "passage-deck-all");
|
||||
@@ -78,7 +81,7 @@ namespace Soundings
|
||||
harbor.ResetView();
|
||||
}, "voyage-view-button voyage-reset", "passage-camera-reset"));
|
||||
|
||||
var rail = Add(overlay, "voyage-rail");
|
||||
var rail = Add(footer, "voyage-rail");
|
||||
var route = Add(rail, "voyage-route");
|
||||
string sea = underway.Weather switch
|
||||
{
|
||||
@@ -92,6 +95,7 @@ namespace Soundings
|
||||
? "voyage-conditions voyage-conditions-warning" : "voyage-conditions");
|
||||
AddDisplay(route, $"{Market.Ports[underway.Origin].Name} → {Market.Ports[underway.Destination].Name}", "voyage-route-name");
|
||||
passageRemaining = AddText(route, "", "voyage-remaining");
|
||||
crewCallReadout = AddText(route, "", "crew-call-readout");
|
||||
var progress = Add(route, "voyage-progress");
|
||||
passageProgress = Add(progress, "voyage-progress-fill");
|
||||
renderedPassageProgress = -1;
|
||||
@@ -116,6 +120,8 @@ namespace Soundings
|
||||
AddText(camera, cameraHelp, "voyage-camera-help");
|
||||
rail.Add(Action("Skip to arrival", FinishVoyage, "voyage-view-button voyage-skip", "dock-now"));
|
||||
DrawHelmControls(overlay);
|
||||
DrawAnnouncement(overlay);
|
||||
DrawStationInteractions(overlay);
|
||||
UpdatePassageUi(passageHelm.Progress);
|
||||
}
|
||||
|
||||
@@ -141,6 +147,8 @@ namespace Soundings
|
||||
var line = Add(entry, "voyage-service-line");
|
||||
AddText(line, OnboardSession.ServiceLabel(service), "voyage-service-name");
|
||||
passageDemand[i] = AddText(line, "", "voyage-service-demand");
|
||||
if (service == OnboardService.Shows && underway.Plan?.Program is EntertainmentProgram.LiveMusic or EntertainmentProgram.Headline)
|
||||
passagePerformance = AddText(entry, "", "voyage-service-included");
|
||||
if (service == OnboardService.Amenities && underway.Weather == WeatherCondition.Storm)
|
||||
AddText(entry, "Outdoor venues closed", "voyage-service-included voyage-demand-short");
|
||||
if (service == OnboardService.Rooms)
|
||||
@@ -157,11 +165,7 @@ namespace Soundings
|
||||
passagePlus[i] = Action("+", () => AdjustPassagePrice(service, 1), "voyage-price-step", $"passage-price-{slug}-plus");
|
||||
passagePlus[i].tooltip = "Raise the onboard price by $1";
|
||||
prices.Add(passagePlus[i]);
|
||||
passageSpecials[i] = Action("Special −25%", () =>
|
||||
{
|
||||
livePassage.StartSpecial(service);
|
||||
RefreshPassageBusiness();
|
||||
}, "voyage-special", $"passage-special-{slug}");
|
||||
passageSpecials[i] = Action("Special −25%", () => StartPassageSpecial(service), "voyage-special", $"passage-special-{slug}");
|
||||
prices.Add(passageSpecials[i]);
|
||||
}
|
||||
AddText(book, "Guests served / requesting right now", "voyage-metric-help");
|
||||
@@ -208,6 +212,7 @@ namespace Soundings
|
||||
nextPassageReadout = Time.unscaledTime + .12f;
|
||||
RefreshPassageBusiness();
|
||||
RefreshPassageEvent();
|
||||
UpdateCrewCall();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -219,6 +224,8 @@ namespace Soundings
|
||||
SetPassageText(passageHealth, $"{livePassage.Health}/100");
|
||||
SetPassageText(passageSupplies, $"Provisions remaining · {livePassage.ProvisionsRemaining:N0}");
|
||||
SetPassageText(passageSales, Money(livePassage.Revenue));
|
||||
if (passagePerformance != null)
|
||||
SetPassageText(passagePerformance, livePassage.PerformanceLabel);
|
||||
for (int i = 0; i < PassageServices.Length; i++)
|
||||
{
|
||||
OnboardService service = (OnboardService)i;
|
||||
@@ -287,7 +294,12 @@ namespace Soundings
|
||||
|
||||
private void DecidePassageEvent(bool accept)
|
||||
{
|
||||
VoyageEvent? chosen = accept && livePassage.CanAcceptEvent ? livePassage.CurrentEvent : null;
|
||||
livePassage.ResolveEvent(accept);
|
||||
if (chosen?.Service == (int)OnboardService.Meals)
|
||||
passageAudio.Announce(PassageAnnouncement.Dining);
|
||||
else if (chosen?.Service == (int)OnboardService.Shows)
|
||||
passageAudio.Announce(PassageAnnouncement.Show);
|
||||
RefreshPassageBusiness();
|
||||
RefreshPassageEvent();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user