Rebrand as Big Ship Tycoon and add crew operations

This commit is contained in:
josh
2026-11-28 17:49:48 -05:00
parent a54f66cec9
commit 2c85a5ba00
68 changed files with 1642 additions and 98 deletions

View File

@@ -7,12 +7,15 @@ namespace Soundings
public sealed partial class SoundingsApp : MonoBehaviour
{
private const string SaveKey = "soundings.company.v1";
private static readonly int[] HotbarPages = { 0, 3, 1, 2, 4 };
private static readonly string[] HotbarNames = { "Harbor", "Chart", "Deck plans", "Shipyard", "Logbook" };
private const string GameTitle = "Big Ship Tycoon";
private const int CrewOfficePage = 5;
private static readonly int[] HotbarPages = { 0, 3, 1, 2, 4, CrewOfficePage };
private static readonly string[] HotbarNames = { "Harbor", "Chart", "Deck plans", "Shipyard", "Logbook", "Crew office" };
private static FontDefinition interfaceFont;
private Company company;
private Harbor harbor;
private PassageAudio passageAudio;
private DeckAmbience deckAmbience;
private PanelSettings panel;
private VisualElement root;
private Font displayFont;
@@ -24,14 +27,14 @@ namespace Soundings
private string shipName = "Peregrine";
private string notice;
private bool warning;
private bool autoSmoke;
private bool autoSmoke, brandingPreview;
private Ship Ship => company?.ActiveShip;
private bool HarborOnScreen => underway != null || page <= 2;
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.AfterSceneLoad)]
private static void Boot()
{
var game = new GameObject("Soundings");
var game = new GameObject(GameTitle);
game.AddComponent<SoundingsApp>().Initialize();
}
@@ -47,9 +50,11 @@ namespace Soundings
harbor.Initialize();
passageAudio = gameObject.AddComponent<PassageAudio>();
passageAudio.Initialize();
deckAmbience = gameObject.AddComponent<DeckAmbience>();
deckAmbience.Initialize(harbor);
displayFont = Resources.Load<Font>("Display");
interfaceFont = FontDefinition.FromFont(Resources.Load<Font>("Interface"));
titleArt = Resources.Load<Texture2D>("Art/FlagshipTitle");
titleArt = Resources.Load<Texture2D>("Art/BigShipTycoonTitle") ?? Resources.Load<Texture2D>("Art/FlagshipTitle");
panel = ScriptableObject.CreateInstance<PanelSettings>();
panel.scaleMode = PanelScaleMode.ScaleWithScreenSize;
panel.referenceResolution = new Vector2Int(1440, 810);
@@ -61,7 +66,7 @@ namespace Soundings
root = document.rootVisualElement;
root.style.flexGrow = 1;
root.style.unityFontDefinition = interfaceFont;
foreach (string sheet in new[] { "Soundings", "Shipwork", "Ledger", "FirstVoyageGuide", "Passage", "ServiceControls", "FleetOverview", "Careers", "ShoreExcursions" })
foreach (string sheet in new[] { "Soundings", "Shipwork", "Ledger", "FirstVoyageGuide", "Passage", "ServiceControls", "FleetOverview", "Careers", "ShoreExcursions", "CrewOffice" })
{
StyleSheet stylesheet = Resources.Load<StyleSheet>(sheet);
if (stylesheet != null)
@@ -187,6 +192,8 @@ namespace Soundings
DrawShell();
if (ShorePlanningOpen)
DrawShorePlanning(root);
else if (crewManifestOpen && !paused && !fleetOpen && underway != null)
DrawCrewManifest(root);
if (paused)
DrawPause();
}
@@ -207,6 +214,8 @@ namespace Soundings
pickingMode = PickingMode.Ignore
};
artwork.AddToClassList("title-picture");
if (brandingPreview)
artwork.style.left = 0;
screen.Add(artwork);
Shade(screen, false, (0f, new Color32(9, 16, 22, 253)), (.24f, new Color32(9, 16, 22, 249)),
(.35f, new Color32(9, 16, 22, 205)),
@@ -215,10 +224,14 @@ namespace Soundings
(1f, new Color32(6, 12, 18, 143)));
var intro = Add(screen, "title-menu");
if (brandingPreview)
intro.AddToClassList("title-thumbnail");
var crest = Add(intro, "title-crest");
GameIcon(crest, "compass");
AddText(crest, "Cruise line simulator", "eyebrow title-kicker");
AddDisplay(intro, "Soundings", "title-wordmark");
DrawTitleWordmark(intro);
if (brandingPreview)
return;
if (pendingStart.HasValue)
{
@@ -303,6 +316,7 @@ namespace Soundings
case 2: DrawShipyard(scene); break;
case 3: DrawPorts(scene); break;
case 4: DrawFinance(scene); break;
case CrewOfficePage: DrawCrewOffice(scene); break;
}
}
@@ -314,7 +328,7 @@ namespace Soundings
menu.tooltip = "Pause menu (Esc)";
GameIcon(menu, "menu");
hudLeft.Add(menu);
AddDisplay(hudLeft, "Soundings", "hud-brand");
AddDisplay(hudLeft, GameTitle, "hud-brand");
var instruments = Add(hud, "hud-instruments");
fleetDayReadout = HeadMetric(instruments, "Day", company.Day.ToString("00"));
@@ -383,6 +397,7 @@ namespace Soundings
OpenVoyageChart, "primary helm-command", "plan-voyage");
GameIcon(plan, "chart");
commands.Add(plan);
commands.Add(Action("Crew office", () => ChangePage(CrewOfficePage), "harbor-crew-link", "harbor-crew-office"));
var camera = Add(commands, "camera-legend");
AddText(camera, "Drag to orbit / Scroll to zoom / Middle-drag to pan", "camera-copy");
Button reset = Action("Reset", () => harbor.ResetView(), "camera-reset", "reset-camera");
@@ -399,7 +414,7 @@ namespace Soundings
int target = HotbarPages[i];
Button nav = Action("", () => ChangePage(target), page == target ? "game-tool selected" : "game-tool", "nav-" + target);
nav.tooltip = $"{HotbarNames[i]} ({i + 1})";
GameIcon(nav, target switch { 0 => "anchor", 1 => "decks", 2 => "yard", 3 => "chart", _ => "log" });
GameIcon(nav, target switch { 0 => "anchor", 1 => "decks", 2 => "yard", 3 => "chart", CrewOfficePage => "crew", _ => "log" });
AddText(nav, HotbarNames[i], "game-tool-name");
AddText(nav, (i + 1).ToString(), "game-key");
tools.Add(nav);