private void UpdateParticleEffectVisibility() { ScreenController screenController = Service.ScreenController; MiscElementsManager miscElementsManager = Service.UXController.MiscElementsManager; SquadSlidingScreen highestLevelScreen = screenController.GetHighestLevelScreen <SquadSlidingScreen>(); bool effectsVisible = !miscElementsManager.IsHudFactionIconTooltipVisible() && screenController.GetHighestLevelScreen <EpisodeInfoScreen>() == null && screenController.GetHighestLevelScreen <InventoryCrateCollectionScreen>() == null && screenController.GetHighestLevelScreen <PrizeInventoryScreen>() == null && screenController.GetHighestLevelScreen <SquadJoinScreen>() == null && (highestLevelScreen == null || !highestLevelScreen.IsOpen()); this.UpdateParticleEffectVisibility(effectsVisible); }
public void AnimateHideUI() { if (base.Root != null) { base.Root.GetComponent <Animator>().SetTrigger("HideUI"); Service.Get <ViewTimerManager>().CreateViewTimer(0.2f, false, new TimerDelegate(this.OnTimerCallback), null); } MiscElementsManager miscElementsManager = Service.Get <UXController>().MiscElementsManager; miscElementsManager.HideEventsTickerView(); }
public void AnimateShowUI() { if (base.Root != null && this.CurrentPlanet.PlanetGameObject != null) { Service.Get <GalaxyPlanetController>().UpdateEventEffectStatus(this.CurrentPlanet); this.CurrentPlanet.PlanetGameObject.SetActive(true); this.planetDetailsTop.Visible = true; this.planetDetailsBottom.Visible = true; base.Root.GetComponent <Animator>().SetTrigger("ShowUI"); } MiscElementsManager miscElementsManager = Service.Get <UXController>().MiscElementsManager; miscElementsManager.ShowEventsTickerView(); this.featuredView.OnAnimateShowUI(); }
public void TeardownElements() { if (!this.IsInitialized) { return; } this.IsInitialized = false; MiscElementsManager miscElementsManager = Service.Get <UXController>().MiscElementsManager; if (this.slider != null) { miscElementsManager.DestroyHealthSlider(this.slider, false); this.slider = null; } this.tooltipHelper.TeardownElements(true); if (this.secondarySlider != null) { miscElementsManager.DestroyHealthSlider(this.secondarySlider, true); this.secondarySlider = null; } this.secondaryTooltipHelper.TeardownElements(false); }
private void RebuildPlanetEvent(Planet planet) { GalaxyViewController galaxyViewController = Service.Get <GalaxyViewController>(); MiscElementsManager miscElementsManager = Service.Get <UXController>().MiscElementsManager; this.UpdateEventEffectStatus(planet); AssetManager assetManager = Service.Get <AssetManager>(); if (planet.ParticleFXHandle != AssetHandle.Invalid) { assetManager.Unload(planet.ParticleFXHandle); planet.ParticleFXHandle = AssetHandle.Invalid; } planet.DestroyParticles(); int arg_52_0 = 0; int b = this.planetParticleCount - 1; this.planetParticleCount = b; this.planetParticleCount = Mathf.Max(arg_52_0, b); if (planet.Tournament == null) { if (this.planetsWithActiveEvents.Contains(planet)) { this.planetsWithActiveEvents.Remove(planet); } if (this.planetsWithEvent.Contains(planet)) { this.planetsWithEvent.Remove(planet); } galaxyViewController.HideBackgroundPlanetUI(planet); } else { AssetHandle particleFXHandle = AssetHandle.Invalid; TimedEventState tournamentState = planet.TournamentState; if (tournamentState != TimedEventState.Upcoming) { if (tournamentState == TimedEventState.Live) { if (!this.planetsWithEvent.Contains(planet)) { this.planetsWithEvent.Add(planet); } if (!this.planetsWithActiveEvents.Contains(planet)) { this.planetsWithActiveEvents.Add(planet); } assetManager.Load(ref particleFXHandle, "fx_planet_Conflict", new AssetSuccessDelegate(this.OnEventParticleFXLoaded), null, planet); } else { if (this.planetsWithEvent.Contains(planet)) { this.planetsWithEvent.Remove(planet); } if (this.planetsWithActiveEvents.Contains(planet)) { this.planetsWithActiveEvents.Remove(planet); } } } else { if (!this.planetsWithEvent.Contains(planet)) { this.planetsWithEvent.Add(planet); } assetManager.Load(ref particleFXHandle, "fx_planet_Imminent", new AssetSuccessDelegate(this.OnEventParticleFXLoaded), null, planet); } planet.ParticleFXHandle = particleFXHandle; miscElementsManager.DestroyPlanetBackgroundUI(planet); miscElementsManager.CreatePlanetBackgroundUI(planet); } miscElementsManager.UpdateFrontPlanetEventTimer(); }
public DevNotesHolonetTab(HolonetScreen screen, HolonetControllerType holonetControllerType) : base(screen, holonetControllerType) { base.InitializeTab("NotesTab", "hn_devnotes_tab"); this.notesTable = screen.GetElement <UXTable>("NotesTable"); this.notesTable.SetTemplateItem("NotesItem"); List <DevNoteEntryVO> devNotes = Service.HolonetController.DevNotesController.DevNotes; int i = 0; int count = devNotes.Count; while (i < count) { DevNoteEntryVO devNoteEntryVO = devNotes[i]; UXElement item = this.notesTable.CloneTemplateItem(devNoteEntryVO.Uid); this.notesTable.GetSubElement <UXLabel>(devNoteEntryVO.Uid, "NotesItemLabelTitle").Text = this.lang.Get(devNoteEntryVO.TitleText, new object[0]); UXButton subElement = this.notesTable.GetSubElement <UXButton>(devNoteEntryVO.Uid, "NotesItemBtnAction"); UXLabel subElement2 = this.notesTable.GetSubElement <UXLabel>(devNoteEntryVO.Uid, "NotesItemBtnActionLabel"); base.PrepareButton(devNoteEntryVO, 1, subElement, subElement2); this.notesTable.GetSubElement <UXButton>(devNoteEntryVO.Uid, "NotesBackCollider").OnClicked = new UXButtonClickedDelegate(this.ClickedLink); UXTexture subElement3 = this.notesTable.GetSubElement <UXTexture>(devNoteEntryVO.Uid, "NotesThumbTexture"); UXSprite subElement4 = this.notesTable.GetSubElement <UXSprite>(devNoteEntryVO.Uid, "SpriteNotesThumbnailFrame"); string text = this.lang.Get(devNoteEntryVO.BodyText, new object[0]); List <string> list = new List <string>(); List <UXTexture> list2 = new List <UXTexture>(); MiscElementsManager miscElementsManager = Service.UXController.MiscElementsManager; if (text.Contains("src=")) { string[] separator = new string[] { "[img]" }; string[] array = text.Split(separator, StringSplitOptions.None); int j = 0; int num = array.Length; while (j < num) { list.Add(array[j]); j++; } this.notesTable.GetSubElement <UXLabel>(devNoteEntryVO.Uid, "NotesItemLabelBody").Text = string.Empty; } else { this.notesTable.GetSubElement <UXLabel>(devNoteEntryVO.Uid, "NotesItemLabelBody").Text = text; } int k = 0; int count2 = list.Count; while (k < count2) { if (list[k].Contains("src=")) { UXTexture uXTexture = miscElementsManager.CloneUXTexture(subElement3, "newImage #" + k, subElement3.Root.transform.parent.gameObject); string[] array2 = list[k].Split(new char[] { '=' }); string assetName = array2[1]; uXTexture.Visible = true; uXTexture.LoadTexture(assetName); list2.Add(uXTexture); string oldValue = "[img]" + list[k] + "[img]"; text = text.Replace(oldValue, "IMAGE_TOKEN"); } k++; } if (text.Contains("IMAGE_TOKEN")) { string[] separator2 = new string[] { "IMAGE_TOKEN" }; string[] array3 = text.Split(separator2, StringSplitOptions.None); int l = 0; int num2 = array3.Length; while (l < num2) { UXLabel uXLabel = miscElementsManager.CloneUXLabel(this.notesTable.GetSubElement <UXLabel>(devNoteEntryVO.Uid, "NotesItemLabelBody"), "thisLabel #" + l, subElement3.Root.transform.parent.gameObject); uXLabel.LocalPosition = new Vector2(this.notesTable.GetSubElement <UXLabel>(devNoteEntryVO.Uid, "NotesItemLabelBody").LocalPosition.x, this.notesTable.GetSubElement <UXLabel>(devNoteEntryVO.Uid, "NotesItemLabelBody").LocalPosition.y); uXLabel.Text = array3[l]; if (list2.Count > 0) { list2[0].LocalPosition = new Vector2(uXLabel.LocalPosition.x - 115f * uXLabel.UXCamera.Camera.transform.localScale.x, uXLabel.LocalPosition.y - uXLabel.Height); list2.Remove(list2[0]); } UXButton uXButton = miscElementsManager.CloneUXButton(this.notesTable.GetSubElement <UXButton>(devNoteEntryVO.Uid, "NotesBackCollider"), "thisButton #" + l, subElement3.Root.transform.parent.gameObject); uXButton.LocalPosition = uXLabel.LocalPosition; uXButton.GetUIWidget.SetAnchor(uXLabel.GetUIWidget.transform); uXButton.OnClicked = new UXButtonClickedDelegate(this.ClickedLink); this.notesTable.GetSubElement <UXLabel>(devNoteEntryVO.Uid, "NotesItemLabelBody").LocalPosition = new Vector2(this.notesTable.GetSubElement <UXLabel>(devNoteEntryVO.Uid, "NotesItemLabelBody").LocalPosition.x, this.notesTable.GetSubElement <UXLabel>(devNoteEntryVO.Uid, "NotesItemLabelBody").LocalPosition.y - uXLabel.Height); this.newLabels.Add(uXLabel); l++; } } else { this.newLabels.Add(this.notesTable.GetSubElement <UXLabel>(devNoteEntryVO.Uid, "NotesItemLabelBody")); } if (!string.IsNullOrEmpty(devNoteEntryVO.Image)) { subElement3.Visible = true; subElement4.Visible = true; subElement3.LoadTexture(devNoteEntryVO.Image); } else { subElement3.Visible = false; subElement4.Visible = false; } this.notesTable.AddItem(item, this.notesTable.Count); i++; } }
public void EnsureBuildingTooltip(SmartEntity building) { if (building == null || building.SupportViewComp == null || Service.PostBattleRepairController.IsEntityInRepair(building)) { return; } SupportViewComponent supportViewComp = building.SupportViewComp; BuildingComponent buildingComp = building.BuildingComp; BuildingTypeVO buildingType = buildingComp.BuildingType; if (!supportViewComp.Enabled) { return; } IState currentState = Service.GameStateMachine.CurrentState; if (currentState is WarBoardState) { return; } bool flag = currentState is HomeState; bool editState = currentState is EditBaseState; bool baseLayoutState = currentState is BaseLayoutToolState; int num = -1; int timeTotal = -1; string text = null; IUpgradeableVO iconAsset = null; bool flag2 = Service.BuildingController.SelectedBuilding == building; SupportViewComponentState supportViewComponentState = SupportViewComponentState.Dormant; Contract contract = Service.ISupportController.FindCurrentContract(buildingComp.BuildingTO.Key); if (contract != null) { if (this.ShouldShowProgress(contract, flag, editState, baseLayoutState, building)) { int remainingTimeForView = contract.GetRemainingTimeForView(); if (remainingTimeForView <= 0 || !Service.ISupportController.IsContractValidForStorage(contract)) { text = Service.Lang.Get("STOPPED", new object[0]); supportViewComponentState = SupportViewComponentState.Bubble; } else { num = remainingTimeForView; timeTotal = contract.TotalTime; if (this.ShouldShowIcon(contract.DeliveryType, flag)) { StaticDataController staticDataController = Service.StaticDataController; DeliveryType deliveryType = contract.DeliveryType; if (deliveryType != DeliveryType.UpgradeStarship) { if (deliveryType == DeliveryType.UpgradeEquipment) { iconAsset = staticDataController.Get <EquipmentVO>(contract.ProductUid); goto IL_19B; } if (deliveryType != DeliveryType.Starship) { iconAsset = staticDataController.Get <TroopTypeVO>(contract.ProductUid); goto IL_19B; } } iconAsset = staticDataController.Get <SpecialAttackTypeVO>(contract.ProductUid); IL_19B: supportViewComponentState = SupportViewComponentState.IconProgress; } else { supportViewComponentState = SupportViewComponentState.Progress; } } } } else { text = this.GetBubbleText(building, flag, editState, flag2); if (text != null) { supportViewComponentState = this.GetBubbleViewComponentStateBasedOnBuilding(building); } } if (flag2 && flag && supportViewComponentState == SupportViewComponentState.Dormant && buildingType.Type == BuildingType.Starport) { supportViewComponentState = SupportViewComponentState.General; } if (supportViewComponentState != SupportViewComponentState.Dormant) { bool flag3 = supportViewComponentState == supportViewComp.State; BuildingTooltip buildingTooltip; if (flag3) { buildingTooltip = supportViewComp.BuildingTooltip; } else { supportViewComp.TeardownElements(); UXController uXController = Service.UXController; MiscElementsManager miscElementsManager = uXController.MiscElementsManager; GameObjectViewComponent gameObjectViewComp = building.GameObjectViewComp; string str = gameObjectViewComp.MainGameObject.GetInstanceID().ToString(); string name = "BuildingTooltip" + str; GameObject worldUIParent = Service.UXController.WorldUIParent; switch (supportViewComponentState) { case SupportViewComponentState.Bubble: if (buildingType.Type == BuildingType.ChampionPlatform) { buildingTooltip = miscElementsManager.CreateBubbleRepairTooltip(name, worldUIParent); } else { buildingTooltip = miscElementsManager.CreateBubbleTooltip(name, worldUIParent); } break; case SupportViewComponentState.BubbleHQ: case SupportViewComponentState.BubbleArmoryUpgrade: case SupportViewComponentState.BubbleShardUpgrade: buildingTooltip = miscElementsManager.CreateHQBubbleTooltip(name, worldUIParent); break; case SupportViewComponentState.Progress: buildingTooltip = miscElementsManager.CreateProgressTooltip(name, worldUIParent); break; case SupportViewComponentState.IconProgress: buildingTooltip = miscElementsManager.CreateIconProgressTooltip(name, worldUIParent); break; default: buildingTooltip = miscElementsManager.CreateGeneralTooltip(name, worldUIParent); break; } } buildingTooltip.SetSelected(flag2); buildingTooltip.SetTitle(this.GetBuildingTitle(buildingType)); buildingTooltip.SetLevel(buildingType); buildingTooltip.SetBubbleText(text); buildingTooltip.SetIconAsset(iconAsset); buildingTooltip.SetTime(num); buildingTooltip.SetProgress(num, timeTotal); if (!flag3) { supportViewComp.SetupElements(buildingTooltip, supportViewComponentState); } } }
private void OnEquipmentTabDimClicked(UXButton button) { MiscElementsManager miscElementsManager = Service.UXController.MiscElementsManager; miscElementsManager.ShowPlayerInstructionsError(this.lang.Get("EQUIPMENT_RESEARCH_LOCKED", new object[0])); }