using System; using System.Collections; using System.IO; using UnityEngine; using UnityEngine.UIElements; namespace Soundings { public sealed partial class SoundingsApp { private IEnumerator VisualSmoke() { string[] args = Environment.GetCommandLineArgs(); int index = Array.IndexOf(args, "-soundings-smoke"); if (index + 1 >= args.Length) { Application.Quit(1); yield break; } string directory = args[index + 1]; Directory.CreateDirectory(directory); if (!CheckSmoke(Harbor.AllPortsHaveScenery, "Every destination has a port scenery profile")) yield break; for (int port = 0; port < Market.Ports.Count; port++) { if (!CheckSmoke(PassageAudio.LoadPortClip("Departure", port) is { length: > 1 } && PassageAudio.LoadPortClip("Approach", port) is { length: > 1 }, "Named PA recordings for " + Market.Ports[port].Name)) yield break; } Vector2[] pacific = MapPaths(new[] { 15, 16 })[0]; if (!CheckSmoke(Mathf.Abs(pacific[MapSamples].x - pacific[0].x) < 45, "Voyage map wraps the date line")) yield break; yield return CaptureSmoke(directory, "01-title"); if (!CheckSmoke(guidedCareer, "The guide is on by default") || !SubmitSmoke("guide-toggle") || !CheckSmoke(!guidedCareer, "Guide can be turned off at title") || !SubmitSmoke("guide-toggle") || !SubmitSmoke("start-used") || !CheckSmoke(Ship?.Name == "MV Meridian" && guideContext == GuideStep.SetCourse, "Guided used start")) yield break; yield return CaptureSmoke(directory, "02-harbor"); float harborOverview = harbor.OrbitVerticalSpan; Vector3 harborCenter = harbor.OrbitTarget; harbor.Zoom(-90, new Vector2(.56f, .54f)); yield return new WaitForSecondsRealtime(.65f); if (!CheckSmoke(harbor.OrbitVerticalSpan < harborOverview * .22f && harbor.OrbitCameraIsClear && Vector3.Distance(harborCenter, harbor.OrbitTarget) > 2f, "Harbor wheel reaches close inspection and follows the pointer")) yield break; harbor.Zoom(90); yield return new WaitForSecondsRealtime(.65f); if (!CheckSmoke(harbor.OrbitVerticalSpan > harborOverview * .97f && Vector3.Distance(harborCenter, harbor.OrbitTarget) < .4f, "Zooming back out restores the harbor framing")) yield break; harbor.ResetView(true); harbor.Zoom(-13, new Vector2(.49f, .56f)); yield return new WaitForSecondsRealtime(.55f); yield return CaptureSmoke(directory, "02a-harbor-close-up"); harbor.ResetView(true); if (!SubmitSmoke("plan-voyage") || !CheckSmoke(page == 3 && destination == 1 && guideContext == GuideStep.Fare, "Set course and fare guide")) yield break; yield return CaptureSmoke(directory, "03-passage-chart"); int fare = Ship.Fare; if (!SubmitSmoke("fare-plus") || !CheckSmoke(Ship.Fare == fare + 50 && guideContext == GuideStep.CastOff, "Fare control and departure guide")) yield break; if (!SubmitSmoke("port-plan-open")) yield break; IntegerField provisioning = root.Q("port-food-units"); if (!CheckSmoke(provisioning != null && provisioning.value > 0, "Dockside orders show recommended provisions")) yield break; provisioning.value = 1120; if (!SubmitSmoke("port-program-1") || !CheckSmoke(portFoodOrder == 1120 && portProgram == EntertainmentProgram.LiveMusic, "Order an exact food quantity and book local musicians")) yield break; yield return CaptureSmoke(directory, "03a-dockside-orders"); if (!SubmitSmoke("port-plan-close")) yield break; if (!SubmitSmoke("weather-swell") || !CheckSmoke(PassageWeatherFor(0, 1) == WeatherCondition.Swell, "Select forecast conditions") || !SubmitSmoke("weather-calm")) yield break; if (!SubmitSmoke("dispatch") || !CheckSmoke(underway != null && livePassage != null && Ship.Port == 0 && company.Voyages == 0 && PassageDuration(underway) >= 120 && livePassage.Assisted && underway.Weather == WeatherCondition.Calm && underway.Plan?.FoodUnits == 1120 && underway.Plan.Program == EntertainmentProgram.LiveMusic, "Cast off into an assisted live crossing")) yield break; if (!CheckSmoke(harbor.PortCinematicActive && Harbor.PortCinematicDuration < 5 && root.Q