private void OnEnable() { this.SetVisibility(LegionfallData.HasAccess()); PinchZoomContentManager pinchZoomManager = this.m_pinchZoomManager; pinchZoomManager.ZoomFactorChanged = (Action <bool>)Delegate.Combine(pinchZoomManager.ZoomFactorChanged, new Action <bool>(this.OnZoomChanged)); Singleton <GarrisonWrapper> .Instance.ContributionInfoChangedAction += this.HandleContributionInfoChanged; }
private void SpreadText() { if (LegionfallData.HasCurrentInvasionPOI()) { this.MoveText(this.m_headerTextSpreadPosition, this.m_timerTextSpreadPosition); this.FadeCenterIcons(1f); } }
private void CollapseText() { if (LegionfallData.HasCurrentInvasionPOI()) { this.FadeCenterIcons(0f); this.MoveText(this.m_headerTextCollapsedPosition, this.m_timerTextCollapsedPosition); } }
private void OnEnable() { this.SetVisibility(LegionfallData.HasAccess()); PinchZoomContentManager pinchZoomManager = this.m_pinchZoomManager; pinchZoomManager.ZoomFactorChanged = (Action <bool>)Delegate.Combine(pinchZoomManager.ZoomFactorChanged, new Action <bool>(this.OnZoomChanged)); Main instance = Main.instance; instance.ContributionInfoChangedAction = (Action)Delegate.Combine(instance.ContributionInfoChangedAction, new Action(this.HandleContributionInfoChanged)); }
private void HandleInvasionPOIChanged() { if (LegionfallData.HasCurrentInvasionPOI() && LegionfallData.GetCurrentInvasionPOI().AreaPoiID == this.m_invasionPOIID) { this.m_invasionZoneNameArea.SetActive(true); } else { this.m_invasionZoneNameArea.SetActive(false); } }
private void Update() { if (this.m_invasionZoneNameArea.activeSelf) { TimeSpan timeSpan = LegionfallData.GetCurrentInvasionExpirationTime() - GarrisonStatus.CurrentTime(); if (((timeSpan.TotalSeconds <= 0.0) ? TimeSpan.Zero : timeSpan).TotalSeconds <= 0.0) { this.m_invasionZoneNameArea.SetActive(false); } } }
private void RequestAreaPoiInfoResultHandler(LegionCompanionWrapper.AreaPoiInfoResultEvent eventArgs) { LegionfallData.SetCurrentInvasionPOI(null); if (eventArgs.POIData != null && eventArgs.POIData.Count > 0) { LegionfallData.SetCurrentInvasionPOI(new WrapperAreaPoi?(eventArgs.POIData[0])); LegionfallData.SetCurrentInvasionExpirationTime(eventArgs.POIData[0].TimeRemaining); } if (this.InvasionPOIChangedAction != null) { this.InvasionPOIChangedAction(); } }
private void Update() { if (this.m_invasionZoneNameArea.activeSelf) { TimeSpan currentInvasionExpirationTime = LegionfallData.GetCurrentInvasionExpirationTime() - GarrisonStatus.CurrentTime(); currentInvasionExpirationTime = (currentInvasionExpirationTime.TotalSeconds <= 0 ? TimeSpan.Zero : currentInvasionExpirationTime); if (currentInvasionExpirationTime.TotalSeconds <= 0) { this.m_invasionZoneNameArea.SetActive(false); this.m_zoneNameArea.SetActive(!string.IsNullOrEmpty(this.zoneNameTag)); } } }
private void HandleInvasionPOIChanged() { if (LegionfallData.HasCurrentInvasionPOI()) { base.gameObject.SetActive(true); this.m_headerText.text = ((!LegionfallData.GetCurrentInvasionPOI().IsHordeAssault()) ? StaticDB.GetString("ALLIANCE_ATTACKING", "[PH] ALLIANCE ATTACKING") : StaticDB.GetString("HORDE_ATTACKING", "[PH] HORDE ATTACKING")); this.GetActiveCrest().SetActive(true); } else { base.gameObject.SetActive(false); } }
private void RequestContributionInfoResultHandler(LegionCompanionWrapper.ContributionInfoResultEvent eventArgs) { LegionfallData.ClearData(); LegionfallData.SetLegionfallWarResources(eventArgs.LegionfallWarResources); LegionfallData.SetHasAccess(eventArgs.HasAccess); foreach (WrapperContribution contribution in eventArgs.Contributions) { LegionfallData.AddOrUpdateLegionfallBuilding(contribution); } if (this.ContributionInfoChangedAction != null) { this.ContributionInfoChangedAction(); } }
private void HandleInvasionPOIChanged() { if (!LegionfallData.HasCurrentInvasionPOI()) { this.m_invasionNotification.gameObject.SetActive(false); } else { WrapperAreaPoi currentInvasionPOI = LegionfallData.GetCurrentInvasionPOI(); this.m_invasionNotification.gameObject.SetActive(true); this.m_invasionTitle.text = currentInvasionPOI.Description; TimeSpan timeSpan = LegionfallData.GetCurrentInvasionExpirationTime() - GarrisonStatus.CurrentTime(); timeSpan = ((timeSpan.TotalSeconds <= 0.0) ? TimeSpan.Zero : timeSpan); this.m_invasionTimeRemaining.text = timeSpan.GetDurationString(false); } this.SetActiveMapViewSize(); }
private void Update() { if (base.gameObject.activeSelf) { TimeSpan timeSpan = LegionfallData.GetCurrentInvasionExpirationTime() - GarrisonStatus.CurrentTime(); if (timeSpan.TotalSeconds < 0.0) { base.gameObject.SetActive(false); return; } string text = StaticDB.GetString("ASSAULT_TIME_REMAINING", "[PH] %s REMAINING"); Regex regex = new Regex(Regex.Escape("%.2d")); text = regex.Replace(text, "{0:D}", 1); text = regex.Replace(text, "{1,2:D2}", 1); this.m_timerText.text = string.Format(text, timeSpan.Hours, timeSpan.Minutes); } }
private void Update() { this.m_currentVisibleZone = null; if (this.m_currentMapMission > 0) { this.m_secondsMissionHasBeenSelected += Time.deltaTime; } if (this.m_invasionNotification.gameObject.activeSelf) { TimeSpan timeSpan = LegionfallData.GetCurrentInvasionExpirationTime() - GarrisonStatus.CurrentTime(); timeSpan = ((timeSpan.TotalSeconds <= 0.0) ? TimeSpan.Zero : timeSpan); if (timeSpan.TotalSeconds > 0.0) { this.m_invasionTimeRemaining.text = timeSpan.GetDurationString(false); } else { this.m_invasionNotification.gameObject.SetActive(false); this.SetActiveMapViewSize(); Main.instance.RequestWorldQuests(); } } this.UpdateCompletedMissionsDisplay(); }
private void OnEnable() { this.SetVisibility(LegionfallData.HasAccess()); this.m_pinchZoomManager.ZoomFactorChanged += new Action <bool>(this.OnZoomChanged); Main.instance.ContributionInfoChangedAction += new Action(this.HandleContributionInfoChanged); }
public void InitPanel(int contributionID, int questID) { if (this.m_grayscaleShader != null) { Material material = new Material(this.m_grayscaleShader); this.m_buildingTitleBanner.material = material; } this.m_questID = questID; this.m_contributionID = contributionID; this.m_buildingName.font = GeneralHelpers.LoadFancyFont(); this.m_buildingState.font = GeneralHelpers.LoadStandardFont(); this.m_buildingDescription.font = GeneralHelpers.LoadStandardFont(); this.m_costLabel.font = GeneralHelpers.LoadStandardFont(); this.m_cost.font = GeneralHelpers.LoadStandardFont(); this.m_contributeButtonLabel.font = GeneralHelpers.LoadStandardFont(); this.m_cantContributeText.font = GeneralHelpers.LoadStandardFont(); this.m_cantContributeText.text = StaticDB.GetString("CANT_CONTRIBUTE", "You can only contribute when the building is under construction."); this.m_healthText.font = GeneralHelpers.LoadStandardFont(); this.m_gotLootLabel.font = GeneralHelpers.LoadStandardFont(); this.m_gotLootLabel.text = StaticDB.GetString("YOU_RECEIVED_ITEM", "You received item: (PH)"); this.m_gotLootItemName.font = GeneralHelpers.LoadStandardFont(); this.m_gotLootArea.SetActive(false); if (!LegionfallData.legionfallDictionary.ContainsKey(contributionID)) { return; } WrapperContribution contribution = LegionfallData.legionfallDictionary[contributionID].contribution; this.m_buildingStateImageFrame_building.gameObject.SetActive(false); this.m_buildingStateImageFrame_active.gameObject.SetActive(false); this.m_buildingStateImageFrame_underAttack.gameObject.SetActive(false); this.m_buildingStateImageFrame_destroyed.gameObject.SetActive(false); this.m_contributeArea.SetActive(false); this.m_cantContributeArea.SetActive(true); this.m_healthText.gameObject.SetActive(true); this.m_buildingTitleBanner.material.SetFloat("_GrayscaleAmount", (contribution.State != 4) ? 0f : 1f); this.m_buildingTitleBanner.color = ((contribution.State != 4) ? Color.white : Color.gray); this.m_progressFillGlow.gameObject.SetActive(false); int num; switch (contribution.State) { case 1: this.m_progressFillGlow.gameObject.SetActive(true); num = contribution.UitextureAtlasMemberIDUnderConstruction; this.m_buildingState.text = StaticDB.GetString("UNDER_CONSTRUCTION", "Under Construction (PH)"); this.m_buildingState.color = new Color(1f, 0.8235f, 0f, 1f); this.m_buildingStateImageFrame_building.gameObject.SetActive(true); this.m_contributeArea.SetActive(true); this.m_cantContributeArea.SetActive(false); this.m_progressFillBar.sprite = AssetBundleManager.LoadAsset <Sprite>(LegionfallBuildingPanel.LegionfallBundleName, "LegionfallCompanion_BarFilling_UnderConstruction"); break; case 2: num = contribution.UitextureAtlasMemberIDActive; this.m_buildingState.text = StaticDB.GetString("BUILDING_ACTIVE", "Building Active (PH)"); this.m_buildingState.color = new Color(0f, 1f, 0f, 1f); this.m_buildingStateImageFrame_active.gameObject.SetActive(true); this.m_progressFillBar.sprite = AssetBundleManager.LoadAsset <Sprite>(LegionfallBuildingPanel.LegionfallBundleName, "LegionfallCompanion_BarFilling_Active"); break; case 3: num = contribution.UitextureAtlasMemberIDUnderAttack; this.m_buildingState.text = StaticDB.GetString("UNDER_ATTACK", "Under Attack (PH)"); this.m_buildingState.color = new Color(1f, 0f, 0f, 1f); this.m_buildingStateImageFrame_underAttack.gameObject.SetActive(true); this.m_progressFillBar.sprite = AssetBundleManager.LoadAsset <Sprite>(LegionfallBuildingPanel.LegionfallBundleName, "LegionfallCompanion_BarFilling_UnderAttack"); break; case 4: num = contribution.UitextureAtlasMemberIDDestroyed; this.m_buildingState.text = StaticDB.GetString("DESTROYED", "Destroyed (PH)"); this.m_buildingState.color = new Color(0.6f, 0.6f, 0.6f, 1f); this.m_buildingStateImageFrame_destroyed.gameObject.SetActive(true); this.m_progressFillBar.sprite = AssetBundleManager.LoadAsset <Sprite>(LegionfallBuildingPanel.LegionfallBundleName, "LegionfallCompanion_BarFilling_UnderConstruction"); break; default: return; } Sprite sprite = null; switch (num) { case 6318: sprite = AssetBundleManager.LoadAsset <Sprite>(LegionfallBuildingPanel.LegionfallBundleName, "LegionfallCompanion_CommandCenter_Active-v2"); break; case 6319: sprite = AssetBundleManager.LoadAsset <Sprite>(LegionfallBuildingPanel.LegionfallBundleName, "LegionfallCompanion_CommandCenter_Destroyed-v2"); break; case 6320: sprite = AssetBundleManager.LoadAsset <Sprite>(LegionfallBuildingPanel.LegionfallBundleName, "LegionfallCompanion_CommandCenter_UnderAttack-v2"); break; case 6321: sprite = AssetBundleManager.LoadAsset <Sprite>(LegionfallBuildingPanel.LegionfallBundleName, "LegionfallCompanion_CommandCenter_UnderConstruction-v2"); break; case 6322: sprite = AssetBundleManager.LoadAsset <Sprite>(LegionfallBuildingPanel.LegionfallBundleName, "LegionfallCompanion_MageTower_Active-v2"); break; case 6323: sprite = AssetBundleManager.LoadAsset <Sprite>(LegionfallBuildingPanel.LegionfallBundleName, "LegionfallCompanion_MageTower_Destroyed-v2"); break; case 6324: sprite = AssetBundleManager.LoadAsset <Sprite>(LegionfallBuildingPanel.LegionfallBundleName, "LegionfallCompanion_MageTower_UnderAttack-v2"); break; case 6325: sprite = AssetBundleManager.LoadAsset <Sprite>(LegionfallBuildingPanel.LegionfallBundleName, "LegionfallCompanion_MageTower_UnderConstruction-v2"); break; case 6326: sprite = AssetBundleManager.LoadAsset <Sprite>(LegionfallBuildingPanel.LegionfallBundleName, "LegionfallCompanion_NetherDisruptor_Active-v2"); break; case 6327: sprite = AssetBundleManager.LoadAsset <Sprite>(LegionfallBuildingPanel.LegionfallBundleName, "LegionfallCompanion_NetherDisruptor_Destroyed-v2"); break; case 6328: sprite = AssetBundleManager.LoadAsset <Sprite>(LegionfallBuildingPanel.LegionfallBundleName, "LegionfallCompanion_NetherDisruptor_UnderAttack-v2"); break; case 6329: sprite = AssetBundleManager.LoadAsset <Sprite>(LegionfallBuildingPanel.LegionfallBundleName, "LegionfallCompanion_NetherDisruptor_UnderConstruction-v2"); break; } if (sprite != null) { this.m_buildingStateImage.sprite = sprite; } this.m_buildingName.text = contribution.Name; this.m_buildingDescription.text = GeneralHelpers.LimitZhLineLength(contribution.Description, 16); this.m_progressFillBar.fillAmount = contribution.UnitCompletion; this.m_progressFillGlow.anchorMin = new Vector2(this.m_progressFillBar.fillAmount, 0.5f); this.m_progressFillGlow.anchorMax = new Vector2(this.m_progressFillBar.fillAmount, 0.5f); this.m_progressFillGlow.anchoredPosition = Vector2.zero; if (contribution.State == 3) { this.m_healthText.text = StaticDB.GetString("TIME_LEFT", "Time Left (PH):") + " 123 Hours"; } else { this.m_healthText.text = ((int)(this.m_progressFillBar.fillAmount * 100f)).ToString() + "%"; } this.m_costLabel.text = StaticDB.GetString("COST", null); if (LegionfallData.WarResources() >= contribution.ContributionCurrencyCost) { this.m_cost.text = LegionfallData.WarResources().ToString("N0") + "/" + contribution.ContributionCurrencyCost; this.m_contributeButton.interactable = true; this.m_contributeButtonLabel.color = new Color(1f, 0.859f, 0f, 1f); } else { this.m_cost.text = string.Concat(new object[] { "<color=#ff0000ff>", LegionfallData.WarResources().ToString("N0"), "</color>/", contribution.ContributionCurrencyCost }); this.m_contributeButton.interactable = false; this.m_contributeButtonLabel.color = new Color(0.6f, 0.6f, 0.6f, 1f); } this.m_currencyIcon.sprite = GeneralHelpers.LoadCurrencyIcon(contribution.ContributionCurrencyType); this.m_contributeButtonLabel.text = StaticDB.GetString("CONTRIBUTE", "Contribute (PH)"); SpellDisplay[] componentsInChildren = this.m_buffArea.GetComponentsInChildren <SpellDisplay>(); foreach (SpellDisplay spellDisplay in componentsInChildren) { Object.Destroy(spellDisplay.gameObject); } foreach (int spell in contribution.Spells) { SpellDisplay spellDisplay2 = Object.Instantiate <SpellDisplay>(this.m_legionfallBuffSpellDisplayPrefab); spellDisplay2.transform.SetParent(this.m_buffArea, false); spellDisplay2.SetSpell(spell); spellDisplay2.SetLocked(contribution.State != 2 && contribution.State != 3); } iTween.Stop(base.gameObject); this.m_progressBarGlow.color = new Color(1f, 1f, 1f, 0f); this.m_progressFillGlowGlow.color = new Color(1f, 1f, 1f, 0f); }
private void HandleContributionInfoChanged() { this.SetVisibility(LegionfallData.HasAccess()); }
private GameObject GetActiveCrest() { return((!LegionfallData.GetCurrentInvasionPOI().IsHordeAssault()) ? this.m_allianceBG : this.m_hordeBG); }