public static int GetNumCompletedMissions(bool skipSupportMissions = false) { int num = 0; foreach (WrapperGarrisonMission value in PersistentMissionData.missionDictionary.Values) { GarrMissionRec record = StaticDB.garrMissionDB.GetRecord(value.MissionRecID); if (record != null) { if (record.GarrFollowerTypeID == (uint)GarrisonStatus.GarrisonFollowerType) { if (!skipSupportMissions || (record.Flags & 16) == 0) { TimeSpan timeSpan = GarrisonStatus.CurrentTime() - value.StartTime; TimeSpan missionDuration = value.MissionDuration - timeSpan; if ((value.MissionState != 1 || missionDuration.TotalSeconds > 0) && value.MissionState != 2 && value.MissionState != 3) { continue; } num++; } } } } return(num); }
private void Start() { bool flag = (GarrisonStatus.Faction() != PVP_FACTION.HORDE ? false : true); this.m_hordeBG.gameObject.SetActive(flag); this.m_allianceBG.gameObject.SetActive(!flag); }
private void Update() { int num = 0; foreach (WrapperCharacterShipment value in PersistentShipmentData.shipmentDictionary.Values) { TimeSpan timeSpan = GarrisonStatus.CurrentTime() - value.CreationTime; if ((value.ShipmentDuration - timeSpan).TotalSeconds > 0) { continue; } num++; } if (num != this.m_numReadyTroops) { if (num == 0 || num < this.m_numReadyTroops) { this.ClearEffects(); } if (num > this.m_numReadyTroops) { this.ClearEffects(); this.m_glowHandle = UiAnimMgr.instance.PlayAnim("MinimapPulseAnim", base.transform, Vector3.zero, 3f, 0f); this.m_glowLoopHandle = UiAnimMgr.instance.PlayAnim("MinimapLoopPulseAnim", base.transform, Vector3.zero, 3f, 0f); iTween.PunchScale(this.m_theActualButton, iTween.Hash(new object[] { "name", "RecruitWobble", "x", this.amount, "y", this.amount, "time", this.duration, "delay", 0.1f, "looptype", iTween.LoopType.none })); iTween.PunchScale(this.m_theActualButton, iTween.Hash(new object[] { "name", "RecruitWobbleL", "x", this.amount, "y", this.amount, "time", this.duration, "delay", this.delay, "looptype", iTween.LoopType.loop })); iTween.PunchRotation(this.m_theActualButton, iTween.Hash(new object[] { "name", "RecruitButtonSwing", "z", 30f, "time", 2f })); iTween.PunchRotation(this.m_numReadyTroopsTextBG, iTween.Hash(new object[] { "name", "RecruitNumSwing", "z", 50f, "time", 3f })); } this.m_numReadyTroops = num; this.m_numReadyTroopsText.text = string.Concat(string.Empty, (this.m_numReadyTroops <= 0 ? string.Empty : string.Concat(string.Empty, this.m_numReadyTroops))); this.m_numReadyTroopsTextBG.SetActive(this.m_numReadyTroops > 0); } }
private void InitPlayerDisplay(int playerLevel) { this.m_characterName.text = Singleton <CharacterData> .instance.CharacterName; if (Main.instance.GetLocale() == "frFR") { this.m_characterClassName.text = string.Concat(new string[] { GarrisonStatus.CharacterClassName(), " ", StaticDB.GetString("LEVEL", null), " ", playerLevel.ToString() }); } else { this.m_characterClassName.text = GeneralHelpers.TextOrderString(StaticDB.GetString("LEVEL", null), playerLevel.ToString()) + " " + GarrisonStatus.CharacterClassName(); } this.m_characterListButton.text = StaticDB.GetString("LOG_OUT", null); Sprite sprite = GeneralHelpers.LoadClassIcon(GarrisonStatus.CharacterClassID()); if (sprite != null) { this.m_classIcon.sprite = sprite; } }
private void UpdateTimeRemaining() { TimeSpan timeSpan = this.m_bounty.EndTime - GarrisonStatus.CurrentTime(); timeSpan = ((timeSpan.TotalSeconds <= 0.0) ? TimeSpan.Zero : timeSpan); this.m_timeLeft.text = StaticDB.GetString("TIME_LEFT", "Time Left: PH") + " " + timeSpan.GetDurationString(false); }
private void Update() { TimeSpan timeSpan; if (this.m_mission.MissionState == 1) { TimeSpan t = GarrisonStatus.CurrentTime() - this.m_mission.StartTime; timeSpan = this.m_mission.MissionDuration - t; if (timeSpan.TotalSeconds > 0.0) { this.m_statusText.text = timeSpan.GetDurationString(false, TimeUnit.Second) + " <color=#ff0000ff>(" + StaticDB.GetString("IN_PROGRESS", null) + ")</color>"; } else { this.m_statusText.text = "<color=#00ff00ff>(" + StaticDB.GetString("TAP_TO_COMPLETE", null) + ")</color>"; } } TimeSpan t2 = GarrisonStatus.CurrentTime() - this.m_mission.OfferTime; timeSpan = this.m_mission.OfferDuration - t2; timeSpan = ((timeSpan.TotalSeconds <= 0.0) ? TimeSpan.Zero : timeSpan); if (timeSpan.TotalSeconds > 0.0) { timeSpan.GetDurationString(false, TimeUnit.Second); } else if (this.m_mission.MissionState == 0 && this.m_mission.OfferDuration.TotalSeconds > 0.0) { AdventureMapPanel.instance.SelectMissionFromList(0); Singleton <DialogFactory> .Instance.CloseMissionDialog(); Object.Destroy(base.gameObject); return; } }
private void Update() { if (this.m_training) { TimeSpan t = GarrisonStatus.CurrentTime() - this.m_shipmentCreationTime; float fillAmount = Mathf.Clamp((float)t.TotalSeconds / (float)this.m_shipmentDuration.TotalSeconds, 0f, 1f); this.m_troopBuildProgressRing.fillAmount = fillAmount; this.m_troopBuildProgressFill.fillAmount = fillAmount; TimeSpan timeSpan = this.m_shipmentDuration - t; if (timeSpan.TotalSeconds < 0.0) { timeSpan = TimeSpan.Zero; } if (timeSpan.TotalSeconds > 0.0) { this.m_timeRemainingText.text = timeSpan.GetDurationString(true); } else if (this.m_glowLoopHandle == null) { this.m_glowLoopHandle = UiAnimMgr.instance.PlayAnim("MinimapLoopPulseAnim", base.transform, Vector3.zero, 2f, 0f); this.m_timeRemainingText.text = StaticDB.GetString("COLLECT", null); Main.instance.m_UISound.Play_TroopsReadyToast(); } } }
private void OnEnable() { this.InitPlayerDisplay(GarrisonStatus.CharacterLevel()); Main instance = Main.instance; instance.PlayerLeveledUpAction = (Action <int>)Delegate.Combine(instance.PlayerLeveledUpAction, new Action <int>(this.HandlePlayerLeveledUp)); }
private void Update() { foreach (WrapperGarrisonMission wrapperGarrisonMission in PersistentMissionData.missionDictionary.Values) { bool flag = false; GarrMissionRec record = StaticDB.garrMissionDB.GetRecord(wrapperGarrisonMission.MissionRecID); if (record != null) { if ((GARR_FOLLOWER_TYPE)record.GarrFollowerTypeID == GarrisonStatus.GarrisonFollowerType) { if (wrapperGarrisonMission.MissionState == 1) { TimeSpan t = GarrisonStatus.CurrentTime() - wrapperGarrisonMission.StartTime; if ((wrapperGarrisonMission.MissionDuration - t).TotalSeconds <= 0.0) { flag = true; } } if (wrapperGarrisonMission.MissionState == 2) { flag = true; } if (flag) { } } } } }
private void UpdateTimeRemaining() { TimeSpan endTime = this.m_bounty.EndTime - GarrisonStatus.CurrentTime(); endTime = (endTime.TotalSeconds <= 0 ? TimeSpan.Zero : endTime); this.m_timeLeft.text = string.Concat(StaticDB.GetString("TIME_LEFT", "Time Left: PH"), " ", endTime.GetDurationString(false)); }
private void Update() { foreach (WrapperGarrisonMission value in PersistentMissionData.missionDictionary.Values) { bool flag = false; GarrMissionRec record = StaticDB.garrMissionDB.GetRecord(value.MissionRecID); if (record != null) { if (record.GarrFollowerTypeID == (uint)GarrisonStatus.GarrisonFollowerType) { if (value.MissionState == 1) { TimeSpan timeSpan = GarrisonStatus.CurrentTime() - value.StartTime; if ((value.MissionDuration - timeSpan).TotalSeconds <= 0) { flag = true; } } if (value.MissionState == 2) { flag = true; } !flag; } } } }
private void Update() { if (!this.m_onMission) { return; } if (this.m_isCombatAlly) { return; } TimeSpan timeSpan = GarrisonStatus.CurrentTime() - this.m_missionStartedTime; TimeSpan mMissionDuration = this.m_missionDuration - timeSpan; mMissionDuration = (mMissionDuration.TotalSeconds <= 0 ? TimeSpan.Zero : mMissionDuration); if (mMissionDuration.TotalSeconds <= 0) { this.m_statusTextSB.Length = 0; this.m_statusTextSB.ConcatFormat <string, string>("{0} - {1}", FollowerListItem.m_onMissionString, FollowerListItem.m_missionCompleteString); this.m_statusText.text = this.m_statusTextSB.ToString(); } else { this.m_statusTextSB.Length = 0; this.m_statusTextSB.ConcatFormat <string, string>("{0} - {1}", FollowerListItem.m_onMissionString, mMissionDuration.GetDurationString(false)); this.m_statusText.text = this.m_statusTextSB.ToString(); } }
private void Update() { TimeSpan missionDuration; if (this.m_mission.MissionState == 1) { TimeSpan timeSpan = GarrisonStatus.CurrentTime() - this.m_mission.StartTime; missionDuration = this.m_mission.MissionDuration - timeSpan; if (missionDuration.TotalSeconds <= 0) { this.m_statusText.text = string.Concat("<color=#00ff00ff>(", StaticDB.GetString("TAP_TO_COMPLETE", null), ")</color>"); } else { this.m_statusText.text = string.Concat(missionDuration.GetDurationString(false), " <color=#ff0000ff>(", StaticDB.GetString("IN_PROGRESS", null), ")</color>"); } } TimeSpan timeSpan1 = GarrisonStatus.CurrentTime() - this.m_mission.OfferTime; missionDuration = this.m_mission.OfferDuration - timeSpan1; missionDuration = (missionDuration.TotalSeconds <= 0 ? TimeSpan.Zero : missionDuration); if (missionDuration.TotalSeconds > 0) { missionDuration.GetDurationString(false); } else if (this.m_mission.MissionState == 0 && this.m_mission.OfferDuration.TotalSeconds > 0) { AdventureMapPanel.instance.SelectMissionFromList(0); Singleton <DialogFactory> .Instance.CloseMissionDialog(); UnityEngine.Object.Destroy(base.gameObject); return; } }
private void OnEnable() { this.GetRequestedMissionCollectionDictionary().Clear(); this.okButton.SetActive(false); this.mainCanvas.renderMode = RenderMode.ScreenSpaceCamera; if (GarrisonStatus.Faction() != PVP_FACTION.HORDE) { this.hordeCommander.SetActive(false); this.allianceCommander.SetActive(true); } else { this.hordeCommander.SetActive(true); this.allianceCommander.SetActive(false); } this.completedMissionsText.text = string.Concat(string.Empty, PersistentMissionData.GetNumCompletedMissions(false), " Completed Missions"); MissionListItem[] componentsInChildren = this.completedMissionListContents.GetComponentsInChildren <MissionListItem>(true); for (int i = 0; i < (int)componentsInChildren.Length; i++) { UnityEngine.Object.Destroy(componentsInChildren[i].gameObject); } MissionRewardDisplay[] missionRewardDisplayArray = this.missionRewardsIconArea.GetComponentsInChildren <MissionRewardDisplay>(true); for (int j = 0; j < (int)missionRewardDisplayArray.Length; j++) { UnityEngine.Object.Destroy(missionRewardDisplayArray[j].gameObject); } this.missionReportView.SetActive(true); this.missionResultsView.SetActive(false); }
public static int GetNumCompletedMissions(bool skipSupportMissions = false) { int num = 0; foreach (WrapperGarrisonMission wrapperGarrisonMission in PersistentMissionData.missionDictionary.Values) { GarrMissionRec record = StaticDB.garrMissionDB.GetRecord(wrapperGarrisonMission.MissionRecID); if (record != null) { if ((GARR_FOLLOWER_TYPE)record.GarrFollowerTypeID == GarrisonStatus.GarrisonFollowerType) { if (!skipSupportMissions || (record.Flags & 16u) == 0u) { TimeSpan t = GarrisonStatus.CurrentTime() - wrapperGarrisonMission.StartTime; TimeSpan timeSpan = wrapperGarrisonMission.MissionDuration - t; if ((wrapperGarrisonMission.MissionState == 1 && timeSpan.TotalSeconds <= 0.0) || wrapperGarrisonMission.MissionState == 2 || wrapperGarrisonMission.MissionState == 3) { num++; } } } } } return(num); }
private void OnEnable() { this.GetRequestedMissionCollectionDictionary().Clear(); this.okButton.SetActive(false); this.mainCanvas.renderMode = 1; if (GarrisonStatus.Faction() == PVP_FACTION.HORDE) { this.hordeCommander.SetActive(true); this.allianceCommander.SetActive(false); } else { this.hordeCommander.SetActive(false); this.allianceCommander.SetActive(true); } this.completedMissionsText.text = string.Empty + PersistentMissionData.GetNumCompletedMissions(false) + " Completed Missions"; MissionListItem[] componentsInChildren = this.completedMissionListContents.GetComponentsInChildren <MissionListItem>(true); for (int i = 0; i < componentsInChildren.Length; i++) { Object.Destroy(componentsInChildren[i].gameObject); } MissionRewardDisplay[] componentsInChildren2 = this.missionRewardsIconArea.GetComponentsInChildren <MissionRewardDisplay>(true); for (int j = 0; j < componentsInChildren2.Length; j++) { Object.Destroy(componentsInChildren2[j].gameObject); } this.missionReportView.SetActive(true); this.missionResultsView.SetActive(false); }
private void Update() { if (!this.m_onMission) { return; } if (this.m_isCombatAlly) { return; } TimeSpan t = GarrisonStatus.CurrentTime() - this.m_missionStartedTime; TimeSpan timeSpan = this.m_missionDuration - t; timeSpan = ((timeSpan.TotalSeconds <= 0.0) ? TimeSpan.Zero : timeSpan); if (timeSpan.TotalSeconds > 0.0) { this.m_statusTextSB.Length = 0; this.m_statusTextSB.ConcatFormat("{0} {1} - {2} - {3}", FollowerListItem.m_iLvlString, this.m_itemLevel, FollowerListItem.m_onMissionString, timeSpan.GetDurationString(false)); this.m_statusText.text = this.m_statusTextSB.ToString(); } else { this.m_statusTextSB.Length = 0; this.m_statusTextSB.ConcatFormat("{0} {1} - {2} - {3}", FollowerListItem.m_iLvlString, this.m_itemLevel, FollowerListItem.m_onMissionString, FollowerListItem.m_missionCompleteString); this.m_statusText.text = this.m_statusTextSB.ToString(); } }
private void UpdateCurrencyDisplayAmount() { Text mCurrencyAmountText = this.m_currencyAmountText; int num = GarrisonStatus.WarResources(); mCurrencyAmountText.text = num.ToString("N0", MobileDeviceLocale.GetCultureInfoLocale()); }
private void UpdateRecruitButtonState() { bool flag = GarrisonStatus.WarResources() >= this.m_shipmentCost; this.m_itemResourceCostText.color = ((!flag) ? Color.red : Color.white); bool flag2 = true; if (this.m_charShipmentRec != null && !PersistentShipmentData.CanOrderShipmentType(this.m_charShipmentRec.ID)) { flag2 = false; } TroopSlot[] componentsInChildren = this.m_troopSlotsRootObject.GetComponentsInChildren <TroopSlot>(true); if (componentsInChildren.Length < 6) { this.m_troopSlotsRootObject.GetComponent <GridLayoutGroup>().constraintCount = 2; } else { this.m_troopSlotsRootObject.GetComponent <GridLayoutGroup>().constraintCount = 3; } bool flag3 = false; foreach (TroopSlot troopSlot in componentsInChildren) { if (troopSlot.IsEmpty()) { flag3 = true; break; } } this.m_recruitButtonText.color = new Color(1f, 0.82f, 0f, 1f); if (!flag3) { this.m_recruitButtonText.text = StaticDB.GetString("SLOTS_FULL", null); this.m_recruitButtonText.color = new Color(0.5f, 0.5f, 0.5f, 1f); } else if (!flag) { this.m_recruitButtonText.text = StaticDB.GetString("CANT_AFFORD", "Can't Afford"); this.m_recruitButtonText.color = new Color(0.5f, 0.5f, 0.5f, 1f); } else if (this.m_isTroop) { this.m_recruitButtonText.text = StaticDB.GetString("RECRUIT", null); } else { this.m_recruitButtonText.text = StaticDB.GetString("PLACE_ORDER", null); } if (flag3 && flag && flag2) { this.m_recruitTroopsButton.interactable = true; } else { this.m_recruitTroopsButton.interactable = false; this.m_recruitButtonText.color = new Color(0.5f, 0.5f, 0.5f, 1f); } }
private bool UpdateTimeRemaining() { TimeSpan timeSpan = this.m_bounty.EndTime - GarrisonStatus.CurrentTime(); timeSpan = ((timeSpan.TotalSeconds <= 0.0) ? TimeSpan.Zero : timeSpan); this.m_timeLeft.text = StaticDB.GetString("TIME_LEFT", "Time Left: PH") + " " + timeSpan.GetDurationString(timeSpan.Days == 0, TimeUnit.Minute); return(timeSpan.TotalSeconds > 0.0); }
private void RequestMaxFollowersResultHandler(LegionCompanionWrapper.RequestMaxFollowersResultEvent eventArgs) { GarrisonStatus.SetMaxActiveFollowers(eventArgs.MaxFollowers); if (this.MaxActiveFollowersChangedAction != null) { this.MaxActiveFollowersChangedAction(); } }
private void InitMissionList() { RectTransform[] componentsInChildren = this.missionListViewContents.GetComponentsInChildren <RectTransform>(true); for (int i = 0; i < componentsInChildren.Length; i++) { if (componentsInChildren[i] != null && componentsInChildren[i] != this.missionListViewContents.transform) { componentsInChildren[i].gameObject.transform.SetParent(null); Object.Destroy(componentsInChildren[i].gameObject); } } List <WrapperGarrisonMission> list = PersistentMissionData.missionDictionary.Values.ToList <WrapperGarrisonMission>(); if (this.isInProgressMissionList) { list = (from mission in list orderby mission.StartTime + mission.MissionDuration select mission).ToList <WrapperGarrisonMission>(); } else { list = (from mission in list orderby StaticDB.garrMissionDB.GetRecord(mission.MissionRecID).TargetLevel select mission).ToList <WrapperGarrisonMission>(); } foreach (WrapperGarrisonMission wrapperGarrisonMission in list) { GarrMissionRec record = StaticDB.garrMissionDB.GetRecord(wrapperGarrisonMission.MissionRecID); if (record != null) { if (record.GarrFollowerTypeID == (uint)GarrisonStatus.GarrisonFollowerType) { if (this.isInProgressMissionList) { if (wrapperGarrisonMission.MissionState == 0) { continue; } if (wrapperGarrisonMission.MissionState == 1) { TimeSpan t = GarrisonStatus.CurrentTime() - wrapperGarrisonMission.StartTime; if ((wrapperGarrisonMission.MissionDuration - t).TotalSeconds <= 0.0) { continue; } } } if (this.isInProgressMissionList || wrapperGarrisonMission.MissionState == 0) { GameObject gameObject = Object.Instantiate <GameObject>(this.missionListItemPrefab); gameObject.transform.SetParent(this.missionListViewContents.transform, false); MissionListItem component = gameObject.GetComponent <MissionListItem>(); component.Init(record.ID); } } } } }
public void UpdateVisuals() { CombatAllyMissionState combatAllyMissionState = CombatAllyMissionState.notAvailable; foreach (WrapperGarrisonMission wrapperGarrisonMission in PersistentMissionData.missionDictionary.Values) { GarrMissionRec record = StaticDB.garrMissionDB.GetRecord(wrapperGarrisonMission.MissionRecID); if (record != null) { if ((record.Flags & 16u) != 0u) { this.m_combatAllyMissionID = wrapperGarrisonMission.MissionRecID; if (wrapperGarrisonMission.MissionState == 1) { combatAllyMissionState = CombatAllyMissionState.inProgress; } else { combatAllyMissionState = CombatAllyMissionState.available; } break; } } } if (combatAllyMissionState == CombatAllyMissionState.inProgress) { foreach (WrapperGarrisonFollower wrapperGarrisonFollower in PersistentFollowerData.followerDictionary.Values) { if (wrapperGarrisonFollower.CurrentMissionID == this.m_combatAllyMissionID) { this.m_combatAllySlot.SetFollower(wrapperGarrisonFollower.GarrFollowerID); this.m_combatAllyLabel.gameObject.SetActive(false); this.m_assignChampionText.gameObject.SetActive(false); this.m_championName.gameObject.SetActive(true); GarrFollowerRec record2 = StaticDB.garrFollowerDB.GetRecord(wrapperGarrisonFollower.GarrFollowerID); CreatureRec record3 = StaticDB.creatureDB.GetRecord((GarrisonStatus.Faction() != PVP_FACTION.ALLIANCE) ? record2.HordeCreatureID : record2.AllianceCreatureID); if (wrapperGarrisonFollower.Quality == 6 && record2.TitleName != null && record2.TitleName.Length > 0) { this.m_championName.text = record2.TitleName; } else if (record2 != null) { this.m_championName.text = record3.Name; } this.m_championName.color = GeneralHelpers.GetQualityColor(wrapperGarrisonFollower.Quality); this.m_combatAllySupportSpellDisplay.gameObject.SetActive(true); this.m_combatAllySupportSpellDisplay.SetSpell(wrapperGarrisonFollower.ZoneSupportSpellID); this.m_unassignCombatAllyButton.SetActive(true); break; } } } else { this.ClearCombatAllyDisplay(); } }
private void Update() { if (this.m_lootDisplayPending && this.m_contributeButton.interactable) { this.m_delayBeforeShowingLoot -= Time.deltaTime; if (this.m_delayBeforeShowingLoot > 0f) { return; } } if (this.m_delayBeforeShowingLoot <= 0f && this.m_lootDisplayTimeRemaining > 0f && this.m_lootItemQuantity > 0) { if (!this.m_gotLootArea.activeSelf) { Main.instance.m_UISound.Play_GetItem(); this.m_gotLootArea.SetActive(true); this.m_lootAreaCanvasGroup.alpha = 0f; iTween.ValueTo(base.gameObject, iTween.Hash(new object[] { "name", "Fade Loot In", "from", 0f, "to", 1f, "easeType", "easeOutCubic", "time", 0.5f, "onupdate", "FadeLootInCallback", "oncomplete", "FadeLootInCompleteCallback" })); } ItemRec record = StaticDB.itemDB.GetRecord(this.m_lootItemID); if (record == null) { this.m_gotLootItemName.text = string.Concat("???", (this.m_lootItemQuantity != 1 ? string.Concat(" (", this.m_lootItemQuantity, "x)") : string.Empty)); } else { this.m_gotLootItemName.text = string.Concat(record.Display, (this.m_lootItemQuantity != 1 ? string.Concat(" (", this.m_lootItemQuantity, "x)") : string.Empty)); } this.m_rewardDisplay.InitReward(MissionRewardDisplay.RewardType.item, this.m_lootItemID, 1, 0, 0); this.m_lootDisplayTimeRemaining -= Time.deltaTime; } else if (this.m_lootDisplayTimeRemaining <= 0f && this.m_lootDisplayPending) { if (this.m_gotLootArea.activeSelf) { iTween.ValueTo(base.gameObject, iTween.Hash(new object[] { "name", "Fade Loot Out", "from", 0f, "to", 1f, "easeType", "easeOutCubic", "time", 0.5f, "onupdate", "FadeLootOutCallback", "oncomplete", "FadeLootOutCompleteCallback" })); } this.m_lootDisplayPending = false; } if (LegionfallData.legionfallDictionary.ContainsKey(this.m_contributionID)) { LegionfallData.ContributionData item = LegionfallData.legionfallDictionary[this.m_contributionID]; WrapperContribution wrapperContribution = item.contribution; if (wrapperContribution.State == 3) { if (item.underAttackExpireTime <= DateTime.UtcNow) { DateTime dateTime = GarrisonStatus.CurrentTime(); item.underAttackExpireTime = dateTime.AddSeconds((double)item.contribution.CurrentValue); } TimeSpan timeSpan = item.underAttackExpireTime - GarrisonStatus.CurrentTime(); timeSpan = (timeSpan.TotalSeconds <= 0 ? TimeSpan.Zero : timeSpan); this.m_healthText.text = string.Concat(StaticDB.GetString("TIME_LEFT", null), " ", timeSpan.GetDurationString(false)); this.m_progressFillBar.fillAmount = wrapperContribution.CurrentValue / wrapperContribution.UpperValue; } } }
private void SetCharShipmentTroop(WrapperShipmentType shipmentType, CharShipmentRec charShipmentRec) { this.m_rightStackLayoutElement.minHeight = 170f; this.m_isTroop = true; this.m_charShipmentRec = charShipmentRec; this.m_troopSpecificArea.SetActive(true); this.m_itemSpecificArea.SetActive(false); this.m_troopName.gameObject.SetActive(true); this.m_itemName.gameObject.SetActive(false); GarrFollowerRec record = StaticDB.garrFollowerDB.GetRecord((int)charShipmentRec.GarrFollowerID); if (record == null) { this.m_troopName.text = "Invalid Follower ID: " + charShipmentRec.GarrFollowerID; return; } this.m_followerRec = record; int num = (GarrisonStatus.Faction() != PVP_FACTION.HORDE) ? record.AllianceCreatureID : record.HordeCreatureID; CreatureRec record2 = StaticDB.creatureDB.GetRecord(num); if (record2 == null) { this.m_troopName.text = "Invalid Creature ID: " + num; return; } string text = "Assets/BundleAssets/PortraitIcons/cid_" + record2.ID.ToString("D8") + ".png"; Sprite sprite = AssetBundleManager.PortraitIcons.LoadAsset <Sprite>(text); if (sprite != null) { this.m_troopSnapshotImage.sprite = sprite; } for (int i = 0; i < record.Vitality; i++) { GameObject gameObject = Object.Instantiate <GameObject>(this.m_troopHeartPrefab); gameObject.transform.SetParent(this.m_troopHeartContainer.transform, false); } this.m_troopName.text = record2.Name; foreach (GarrFollowerXAbilityRec garrFollowerXAbilityRec in from rec in StaticDB.garrFollowerXAbilityDB.GetRecordsByParentID((int)charShipmentRec.GarrFollowerID) where rec.FactionIndex == (int)GarrisonStatus.Faction() select rec) { GameObject gameObject2 = Object.Instantiate <GameObject>(this.m_abilityDisplayPrefab); gameObject2.transform.SetParent(this.m_traitsAndAbilitiesRootObject.transform, false); AbilityDisplay component = gameObject2.GetComponent <AbilityDisplay>(); component.SetAbility(garrFollowerXAbilityRec.GarrAbilityID, true, true, null); } this.UpdateTroopSlots(); this.m_troopResourceCostText.text = string.Empty + shipmentType.CurrencyCost; Sprite sprite2 = GeneralHelpers.LoadCurrencyIcon(shipmentType.CurrencyTypeID); if (sprite2 != null) { this.m_troopResourceIcon.sprite = sprite2; } this.UpdateRecruitButtonState(); }
private void SetCharShipmentTroop(WrapperShipmentType shipmentType, CharShipmentRec charShipmentRec) { this.m_isTroop = true; this.m_charShipmentRec = charShipmentRec; this.m_troopSpecificArea.SetActive(true); this.m_itemSpecificArea.SetActive(false); this.m_troopName.gameObject.SetActive(true); this.m_itemName.gameObject.SetActive(false); GarrFollowerRec record = StaticDB.garrFollowerDB.GetRecord((int)charShipmentRec.GarrFollowerID); if (record == null) { Debug.LogError(string.Concat("Invalid Follower ID: ", charShipmentRec.GarrFollowerID)); this.m_troopName.text = string.Concat("Invalid Follower ID: ", charShipmentRec.GarrFollowerID); return; } this.m_followerRec = record; int num = (GarrisonStatus.Faction() != PVP_FACTION.HORDE ? record.AllianceCreatureID : record.HordeCreatureID); CreatureRec creatureRec = StaticDB.creatureDB.GetRecord(num); if (creatureRec == null) { Debug.LogError(string.Concat("Invalid Creature ID: ", num)); this.m_troopName.text = string.Concat("Invalid Creature ID: ", num); return; } int d = creatureRec.ID; string str = string.Concat("Assets/BundleAssets/PortraitIcons/cid_", d.ToString("D8"), ".png"); AssetBundleManager.PortraitIcons.LoadAsset <Sprite>(str); for (int i = 0; i < record.Vitality; i++) { GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(this.m_troopHeartPrefab); gameObject.transform.SetParent(this.m_troopHeartContainer.transform, false); } this.m_troopName.text = creatureRec.Name; foreach (GarrFollowerXAbilityRec garrFollowerXAbilityRec in from rec in StaticDB.garrFollowerXAbilityDB.GetRecordsByParentID((int)charShipmentRec.GarrFollowerID) where rec.FactionIndex == (int)GarrisonStatus.Faction() select rec) { GameObject gameObject1 = UnityEngine.Object.Instantiate <GameObject>(this.m_abilityDisplayPrefab); gameObject1.transform.SetParent(this.m_traitsAndAbilitiesRootObject.transform, false); AbilityDisplay component = gameObject1.GetComponent <AbilityDisplay>(); component.SetAbility(garrFollowerXAbilityRec.GarrAbilityID, true, true, null); } this.UpdateTroopSlots(); this.m_troopResourceCostText.text = string.Concat(string.Empty, shipmentType.CurrencyCost); Sprite sprite = GeneralHelpers.LoadCurrencyIcon(shipmentType.CurrencyTypeID); if (sprite != null) { this.m_troopResourceIcon.sprite = sprite; } this.UpdateRecruitButtonState(); }
private void UpdateTimeRemaining() { TimeSpan mEndTime = this.m_endTime - GarrisonStatus.CurrentTime(); if (mEndTime.TotalSeconds < 0) { mEndTime = TimeSpan.Zero; } this.m_worldQuestTimeText.text = string.Concat(this.m_timeLeftString, " ", mEndTime.GetDurationString(false)); this.m_expiringSoon.gameObject.SetActive(mEndTime.TotalSeconds < 4500); }
private void Update() { if (!this.missionTimeRemainingText.gameObject.activeSelf) { return; } TimeSpan t = GarrisonStatus.CurrentTime() - this.missionStartedTime; TimeSpan timeSpan = this.missionDurationInSeconds - t; timeSpan = ((timeSpan.TotalSeconds <= 0.0) ? TimeSpan.Zero : timeSpan); this.missionTimeRemainingText.text = timeSpan.GetDurationString(false, TimeUnit.Second) + " <color=#ff0000ff>(In Progress)</color>"; }
public void SetStartingMapByFaction() { if (GarrisonStatus.Faction() == PVP_FACTION.HORDE) { this.m_zoneID = AdventureMapPanel.eZone.Zandalar; } else if (GarrisonStatus.Faction() == PVP_FACTION.ALLIANCE) { this.m_zoneID = AdventureMapPanel.eZone.Kultiras; } this.SetMapByActiveZoneID(); }
private void Update() { if (!this.missionTimeRemainingText.gameObject.activeSelf) { return; } TimeSpan timeSpan = GarrisonStatus.CurrentTime() - this.missionStartedTime; TimeSpan timeSpan1 = this.missionDurationInSeconds - timeSpan; timeSpan1 = (timeSpan1.TotalSeconds <= 0 ? TimeSpan.Zero : timeSpan1); this.missionTimeRemainingText.text = string.Concat(timeSpan1.GetDurationString(false), " <color=#ff0000ff>(In Progress)</color>"); }