public void OnViewClockTime(float dt) { string planetDisplayName = LangUtils.GetPlanetDisplayName(this.screen.viewingPlanetVO); if (!this.player.Objectives.ContainsKey(this.screen.viewingPlanetVO.Uid) || this.player.Objectives[this.screen.viewingPlanetVO.Uid].ProgressObjects.Count <= 0) { this.timer.Text = this.lang.Get("NO_OBJECTIVES_AVAILABLE", new object[0]); this.timer.TextColor = ObjectiveController.TEXT_WHITE_COLOR; this.header.Text = this.lang.Get("OBJECTIVE_DETAILS_HEADER", new object[] { planetDisplayName }); return; } ObjectiveGroup objectiveGroup = this.player.Objectives[this.screen.viewingPlanetVO.Uid]; ObjectiveSeriesVO objectiveSeriesVO = Service.StaticDataController.Get <ObjectiveSeriesVO>(objectiveGroup.GroupSeriesId); this.objectiveController.GetTimeData(this.lang, objectiveGroup, ref this.tempIsGrace, ref this.tempTimeString); if (objectiveSeriesVO.SpecialEvent) { this.header.Text = ((!this.tempIsGrace) ? this.lang.Get(objectiveSeriesVO.ObjectiveString, new object[0]) : this.lang.Get(objectiveSeriesVO.ObjectiveExpiringString, new object[0])); } else { this.header.Text = ((!this.tempIsGrace) ? this.lang.Get("OBJECTIVE_DETAILS_HEADER", new object[] { planetDisplayName }) : this.lang.Get("OBJECTIVES_DETAILS_HEADER_EXPIRED", new object[] { planetDisplayName })); } this.timer.Text = this.tempTimeString; this.timer.TextColor = ((!this.tempIsGrace) ? ObjectiveController.TEXT_RED_COLOR : ObjectiveController.TEXT_YELLOW_COLOR); }
public void RefreshScreenForPlanetChange() { if (!this.CanRefresh(this.player)) { this.objectivesPanel.Visible = false; if (this.objectiveController.ShouldShowObjectives()) { this.labelOperationsLocked.Visible = true; this.labelOperationsLocked.Text = this.lang.Get("NO_OBJECTIVES_AVAILABLE", new object[0]); } return; } if (!this.player.Objectives.ContainsKey(this.screen.viewingPlanetVO.Uid) || this.player.Objectives[this.screen.viewingPlanetVO.Uid].ProgressObjects.Count == 0) { this.objectivesPanel.Visible = false; this.labelOperationsLocked.Visible = true; this.labelOperationsLocked.Text = this.lang.Get("NO_OBJECTIVES_AVAILABLE", new object[0]); this.specialObjectiveIcon.Visible = false; this.specialObjectiveFrame.Visible = false; return; } this.objectiveController.GetTimeData(this.lang, this.player.Objectives[this.screen.viewingPlanetVO.Uid], ref this.tempIsGrace, ref this.tempTimeString); this.objectivesPanel.Visible = true; ObjectiveGroup objectiveGroup = this.player.Objectives[this.screen.viewingPlanetVO.Uid]; ObjectiveSeriesVO objectiveSeriesVO = Service.StaticDataController.Get <ObjectiveSeriesVO>(objectiveGroup.GroupSeriesId); this.specialObjectiveIcon.Visible = objectiveSeriesVO.SpecialEvent; this.specialObjectiveFrame.Visible = objectiveSeriesVO.SpecialEvent; if (objectiveSeriesVO.SpecialEvent) { this.specialObjectiveIcon.LoadTexture(objectiveSeriesVO.EventIcon); this.specialObjectiveFrame.LoadTexture(objectiveSeriesVO.EventPlayArt); this.labelObjectivesTitle.Text = Service.Lang.Get(objectiveSeriesVO.ObjectiveString, new object[0]); } else { this.labelObjectivesTitle.Text = Service.Lang.Get("OBJECTIVES", new object[0]); } int i = 0; int num = 3; while (i < num) { if (i >= objectiveGroup.ProgressObjects.Count) { this.data[i].Objective = null; this.data[i].BtnSupplyCrate.Visible = false; } else { ObjectiveProgress objective = objectiveGroup.ProgressObjects[i]; this.data[i].Objective = objective; this.data[i].BtnSupplyCrate.Visible = true; this.data[i].SpecailObjectiveFx.Visible = objectiveSeriesVO.SpecialEvent; this.objectiveController.UpdateObjectiveEntry(this.data[i], this.tempIsGrace); } i++; } this.OnViewClockTime(0f); }
public void RefreshScreenForPlanetChange() { if (!this.objectiveController.ShouldShowObjectives()) { return; } if (this.specialEventIcon == null || this.specialEventFrame == null || this.player.Objectives == null || this.screen.viewingPlanetVO == null || this.grid == null || this.relocation == null) { return; } this.tempIsGrace = true; this.specialEventIcon.Visible = false; this.specialEventFrame.Visible = false; string planetDisplayName = LangUtils.GetPlanetDisplayName(this.screen.viewingPlanetVO); if (this.player.Objectives.ContainsKey(this.screen.viewingPlanetVO.Uid)) { this.objectiveController.GetTimeData(this.lang, this.player.Objectives[this.screen.viewingPlanetVO.Uid], ref this.tempIsGrace, ref this.tempTimeString); ObjectiveGroup objectiveGroup = this.player.Objectives[this.screen.viewingPlanetVO.Uid]; if (objectiveGroup == null) { Service.Logger.WarnFormat("Player objectives for planet {0} are null", new object[] { this.screen.viewingPlanetVO.Uid }); return; } ObjectiveSeriesVO objectiveSeriesVO = Service.StaticDataController.Get <ObjectiveSeriesVO>(objectiveGroup.GroupSeriesId); if (objectiveGroup.ProgressObjects != null && objectiveGroup.ProgressObjects.Count > 0) { this.specialEventIcon.Visible = objectiveSeriesVO.SpecialEvent; this.specialEventFrame.Visible = objectiveSeriesVO.SpecialEvent; } if (objectiveSeriesVO.SpecialEvent) { this.specialEventIcon.LoadTexture(objectiveSeriesVO.EventIcon); this.specialEventFrame.LoadTexture(objectiveSeriesVO.EventDetailsArt); } int i = 0; int num = 3; while (i < num) { UXElement item = this.grid.GetItem(i); ObjectiveViewData objectiveViewData = item.Tag as ObjectiveViewData; if (i >= objectiveGroup.ProgressObjects.Count) { item.Visible = false; } else { item.Visible = true; objectiveViewData.SpecailObjectiveFx.Visible = objectiveSeriesVO.SpecialEvent; objectiveViewData.Objective = objectiveGroup.ProgressObjects[i]; this.objectiveController.UpdateObjectiveEntry(objectiveViewData, this.tempIsGrace); } i++; } } else { this.header.Text = this.lang.Get("OBJECTIVE_DETAILS_HEADER", new object[] { planetDisplayName }); int j = 0; int num2 = 3; while (j < num2) { UXElement item2 = this.grid.GetItem(j); item2.Visible = false; j++; } } if (this.screen.viewingPlanetVO == this.player.Planet || this.tempIsGrace) { this.relocation.Text = string.Empty; } else { this.relocation.Text = this.lang.Get("RELOCATE_TO_PLANET_MESSAGE", new object[] { planetDisplayName }); } this.OnViewClockTime(0f); }