Enable placeable sun deck attractions and finish project rebrand
This commit is contained in:
53
Assets/BigShipTycoon/Runtime/PassageAnnouncements.cs
Normal file
53
Assets/BigShipTycoon/Runtime/PassageAnnouncements.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
using UnityEngine.UIElements;
|
||||
|
||||
namespace BigShipTycoon
|
||||
{
|
||||
public sealed partial class TycoonApp
|
||||
{
|
||||
private VisualElement announcementBanner;
|
||||
private Label announcementCaption;
|
||||
|
||||
private void DrawAnnouncement(VisualElement overlay)
|
||||
{
|
||||
announcementBanner = Add(overlay, "passage-announcement");
|
||||
announcementBanner.pickingMode = PickingMode.Ignore;
|
||||
AddText(announcementBanner, "SHIP PA", "voyage-caption");
|
||||
announcementCaption = AddText(announcementBanner, "", "passage-announcement-caption");
|
||||
UpdateAnnouncement();
|
||||
}
|
||||
|
||||
private void UpdateAnnouncement()
|
||||
{
|
||||
if (announcementBanner == null)
|
||||
return;
|
||||
string text = passageAudio.Caption;
|
||||
announcementBanner.style.display = text == null ? DisplayStyle.None : DisplayStyle.Flex;
|
||||
if (text != null)
|
||||
SetPassageText(announcementCaption, text);
|
||||
}
|
||||
|
||||
private void StartPassageSpecial(OnboardService service)
|
||||
{
|
||||
if (livePassage.StartSpecial(service))
|
||||
{
|
||||
if (service == OnboardService.Meals)
|
||||
passageAudio.Announce(PassageAnnouncement.DiningSpecial);
|
||||
else if (service == OnboardService.Drinks)
|
||||
passageAudio.Announce(PassageAnnouncement.Bar);
|
||||
}
|
||||
RefreshPassageBusiness();
|
||||
}
|
||||
|
||||
private void AnnounceStation(StationKind station)
|
||||
{
|
||||
switch (station)
|
||||
{
|
||||
case StationKind.Galley:
|
||||
case StationKind.Dining: passageAudio.Announce(PassageAnnouncement.Dining); break;
|
||||
case StationKind.Bar: passageAudio.Announce(PassageAnnouncement.Bar); break;
|
||||
case StationKind.Stage: passageAudio.Announce(PassageAnnouncement.Show); break;
|
||||
case StationKind.Pool: passageAudio.Announce(PassageAnnouncement.Terrace); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user