public void OnViewFrameTime(float dt) { if (this.animatingProgress != null) { if (this.animatingProgress.NeedsUpdate) { this.animatingProgress.Update(dt); } else { this.animatingProgress = null; this.InvalidateHideProgressTimers(); this.hideProgressTimerId = Service.ViewTimerManager.CreateViewTimer(1f, false, new TimerDelegate(this.NextProgressCallback), null); } } Animator component = this.widgetBtn.Root.GetComponent <Animator>(); if (this.showTimer && component.isActiveAndEnabled) { this.AnimResetTrigger(component, "ShowTimer"); this.AnimResetTrigger(component, "HideTimer"); this.AnimSetTrigger(component, "ShowTimer"); this.showTimer = false; } if (!this.showTimer && this.animatingProgress == null) { Service.ViewTimeEngine.UnregisterFrameTimeObserver(this); } }
private bool UpdateTaskProgressUI(EpisodeProgressData progressData) { if (progressData == null) { Service.Logger.Error("EpisodeWidgetView: no progress data given to show"); return(false); } string arg = string.Empty; EventId progressType = progressData.progressType; if (progressType != EventId.PvpBattleWon) { if (progressType != EventId.TournamentTierReached) { if (progressType != EventId.RaidComplete) { if (progressType != EventId.ObjectiveCompleted) { if (progressType != EventId.EpisodeComplexTask) { Service.Logger.ErrorFormat("Unknown event type {0} when displaying episode points", new object[] { progressData.progressType }); return(false); } arg = "epw_event_points_generic_"; } else { arg = "epw_event_point_obje_"; } } else { arg = "epw_event_point_raid_"; } } else { arg = "epw_event_point_conf_"; } } else { arg = "epw_event_point_pvp_"; } this.progressLabel.Text = this.lang.Get(arg + progressData.progressIndex, new object[] { progressData.progress }); EpisodeProgressInfo episodeProgressInfo = Service.CurrentPlayer.EpisodeProgressInfo; EpisodeTaskProgressInfo currentTask = episodeProgressInfo.currentTask; int target = currentTask.target; this.animatingProgress = new HUDResourceView("episodeProgress", this.progressSlider, null, null); this.animatingProgress.SetAmount(progressData.prevProgress, target, false); float delay = 0f; if (!this.progressEarnedToast.Visible) { this.progressSliderGoal.Value = (float)progressData.prevProgress / (float)target; delay = 1.5f; } KeyValuePair <int, int> keyValuePair = new KeyValuePair <int, int>(progressData.prevProgress + progressData.progress, target); this.animateProgressTimerId = Service.ViewTimerManager.CreateViewTimer(delay, false, new TimerDelegate(this.AnimateProgressStartCallback), keyValuePair); return(true); }