private NotificationObject GetNextRaidNotification() { RaidDefenseController raidDefenseController = Service.Get <RaidDefenseController>(); CurrentPlayer currentPlayer = Service.Get <CurrentPlayer>(); if (!raidDefenseController.AreRaidsAccessible()) { return(null); } uint secondsTillNextRaid = raidDefenseController.GetSecondsTillNextRaid(); if (secondsTillNextRaid == 0u) { Service.Get <StaRTSLogger>().Error("Failed to schedule raid notif due to invalid start time: " + currentPlayer.CurrentRaid.Uid); return(null); } string text = "raid_start_next"; NotificationTypeVO notificationTypeVO = Service.Get <IDataController>().Get <NotificationTypeVO>(text); string id = "notif_" + text; string message = this.lang.Get(id, new object[0]); string inProgressMessage = this.lang.Get("notif_" + text + "_progress", new object[0]); DateTime time = DateTime.get_Now().AddSeconds(secondsTillNextRaid); if (!this.CheckValidNotificationTime(notificationTypeVO, time)) { return(null); } return(new NotificationObject(text, inProgressMessage, message, notificationTypeVO.SoundName, time, text, text)); }
private void OnDefendButtonClicked(UXButton notifyButton) { Service.BILoggingController.TrackGameAction("UI_raid", "start", "briefing", string.Empty, 1); RaidDefenseController raidDefenseController = Service.RaidDefenseController; this.Close(true); raidDefenseController.StartCurrentRaidDefense(); }
private void OnRaidInfoScreenClosed(object result, object cookie) { if (result == null) { RaidDefenseController raidDefenseController = Service.RaidDefenseController; raidDefenseController.AttemptToShowRaidWaitConfirmation(); Service.BILoggingController.TrackGameAction("UI_raid_briefing", "close", string.Empty, string.Empty, 1); } }
private void UpdateRaidTimer() { RaidDefenseController raidDefenseController = Service.RaidDefenseController; this.raidTimer.Text = this.lang.Get(this.raidTimerText, new object[] { LangUtils.FormatTime((long)raidDefenseController.GetRaidTimeSeconds()) }); }
private void SetupRaidStateColors() { RaidDefenseController raidDefenseController = Service.RaidDefenseController; Color textColor; Color color; if (this.raidAvailable) { textColor = raidDefenseController.ActiveRaidColor; color = raidDefenseController.ActiveRaidColor; } else { textColor = Color.white; color = raidDefenseController.InactiveColor; } this.title.TextColor = textColor; this.raidTimer.TextColor = color; this.messageBorderStroke.Color = color; }