54 lines
2.0 KiB
C#
54 lines
2.0 KiB
C#
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;
|
|
}
|
|
}
|
|
}
|
|
}
|