private void Start() { this.m_rewardsLabel.font = FontLoader.LoadStandardFont(); this.m_rewardsLabel.text = StaticDB.GetString("REWARDS", "Rewards"); this.m_timeLeftString = StaticDB.GetString("TIME_LEFT", "Time Left: PH"); }
private void Start() { this.m_label.font = GeneralHelpers.LoadStandardFont(); this.m_label.text = StaticDB.GetString(this.m_labelTag, this.m_labelFallbackText); }
public static string GetBonusStatString(BonusStatIndex statIndex) { switch (statIndex) { case BonusStatIndex.MANA: { return(StaticDB.GetString("ITEM_MOD_MANA_SHORT", null)); } case BonusStatIndex.HEALTH: { return(StaticDB.GetString("ITEM_MOD_HEALTH_SHORT", null)); } case BonusStatIndex.AGILITY: { return(StaticDB.GetString("ITEM_MOD_AGILITY_SHORT", null)); } case BonusStatIndex.STRENGTH: { return(StaticDB.GetString("ITEM_MOD_STRENGTH_SHORT", null)); } case BonusStatIndex.INTELLECT: { return(StaticDB.GetString("ITEM_MOD_INTELLECT_SHORT", null)); } case BonusStatIndex.STAMINA: { return(StaticDB.GetString("ITEM_MOD_STAMINA_SHORT", null)); } case BonusStatIndex.DEFENSE_SKILL_RATING: { return(StaticDB.GetString("ITEM_MOD_DEFENSE_SKILL_RATING_SHORT", null)); } case BonusStatIndex.DODGE_RATING: { return(StaticDB.GetString("ITEM_MOD_DODGE_RATING_SHORT", null)); } case BonusStatIndex.PARRY_RATING: { return(StaticDB.GetString("ITEM_MOD_PARRY_RATING_SHORT", null)); } case BonusStatIndex.BLOCK_RATING: { return(StaticDB.GetString("ITEM_MOD_BLOCK_RATING_SHORT", null)); } case BonusStatIndex.HIT_MELEE_RATING: { return(StaticDB.GetString("ITEM_MOD_HIT_MELEE_RATING_SHORT", null)); } case BonusStatIndex.HIT_RANGED_RATING: { return(StaticDB.GetString("ITEM_MOD_HIT_RANGED_RATING_SHORT", null)); } case BonusStatIndex.HIT_SPELL_RATING: { return(StaticDB.GetString("ITEM_MOD_HIT_SPELL_RATING_SHORT", null)); } case BonusStatIndex.CRIT_MELEE_RATING: { return(StaticDB.GetString("ITEM_MOD_CRIT_MELEE_RATING_SHORT", null)); } case BonusStatIndex.CRIT_RANGED_RATING: { return(StaticDB.GetString("ITEM_MOD_CRIT_RANGED_RATING_SHORT", null)); } case BonusStatIndex.CRIT_SPELL_RATING: { return(StaticDB.GetString("ITEM_MOD_CRIT_SPELL_RATING_SHORT", null)); } case BonusStatIndex.HIT_RATING: { return(StaticDB.GetString("ITEM_MOD_HIT_RATING_SHORT", null)); } case BonusStatIndex.CRIT_RATING: { return(StaticDB.GetString("ITEM_MOD_CRIT_RATING_SHORT", null)); } case BonusStatIndex.RESILIENCE_RATING: { return(StaticDB.GetString("ITEM_MOD_RESILIENCE_RATING_SHORT", null)); } case BonusStatIndex.HASTE_RATING: { return(StaticDB.GetString("ITEM_MOD_HASTE_RATING_SHORT", null)); } case BonusStatIndex.EXPERTISE_RATING: { return(StaticDB.GetString("ITEM_MOD_EXPERTISE_RATING_SHORT", null)); } case BonusStatIndex.ATTACK_POWER: { return(StaticDB.GetString("ITEM_MOD_ATTACK_POWER_SHORT", null)); } case BonusStatIndex.VERSATILITY: { return(StaticDB.GetString("ITEM_MOD_VERSATILITY", null)); } default: { if (statIndex == BonusStatIndex.MASTERY_RATING) { break; } else { return(statIndex.ToString()); } } } return(StaticDB.GetString("ITEM_MOD_MASTERY_RATING", null)); }
private void Awake() { this.m_selectionRing.gameObject.SetActive(false); this.m_missionCompleteText.text = StaticDB.GetString("MISSION_COMPLETE", null); this.m_isStackablePreview = false; }
public void SetFollower(int followerID) { this.m_garrFollowerID = followerID; if (followerID == 0) { RectTransform[] componentsInChildren = this.traitsAndAbilitiesRootObject.GetComponentsInChildren <RectTransform>(true); for (int i = 0; i < (int)componentsInChildren.Length; i++) { if (componentsInChildren[i] != null && componentsInChildren[i] != this.traitsAndAbilitiesRootObject.transform) { UnityEngine.Object.Destroy(componentsInChildren[i].gameObject); } } AbilityDisplay[] abilityDisplayArray = this.m_equipmentSlotsRootObject.GetComponentsInChildren <AbilityDisplay>(true); for (int j = 0; j < (int)abilityDisplayArray.Length; j++) { UnityEngine.Object.Destroy(abilityDisplayArray[j].gameObject); } } if (!PersistentFollowerData.followerDictionary.ContainsKey(followerID)) { return; } GarrFollowerRec record = StaticDB.garrFollowerDB.GetRecord(followerID); if (record == null) { return; } CreatureRec creatureRec = StaticDB.creatureDB.GetRecord((GarrisonStatus.Faction() != PVP_FACTION.HORDE ? record.AllianceCreatureID : record.HordeCreatureID)); if (creatureRec == null) { return; } WrapperGarrisonFollower item = PersistentFollowerData.followerDictionary[followerID]; int d = creatureRec.ID; string str = string.Concat("Assets/BundleAssets/PortraitIcons/cid_", d.ToString("D8"), ".png"); Sprite sprite = AssetBundleManager.PortraitIcons.LoadAsset <Sprite>(str); if (sprite != null) { this.followerSnapshot.sprite = sprite; } RectTransform[] rectTransformArray = this.traitsAndAbilitiesRootObject.GetComponentsInChildren <RectTransform>(true); for (int k = 0; k < (int)rectTransformArray.Length; k++) { if (rectTransformArray[k] != null && rectTransformArray[k] != this.traitsAndAbilitiesRootObject.transform) { UnityEngine.Object.Destroy(rectTransformArray[k].gameObject); } } bool flag = false; for (int l = 0; l < item.AbilityIDs.Count; l++) { GarrAbilityRec garrAbilityRec = StaticDB.garrAbilityDB.GetRecord(item.AbilityIDs[l]); if ((garrAbilityRec.Flags & 512) != 0) { if (!flag) { GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(this.specializationHeaderPrefab); gameObject.transform.SetParent(this.traitsAndAbilitiesRootObject.transform, false); flag = true; Text component = gameObject.GetComponent <Text>(); if (component != null) { component.text = StaticDB.GetString("SPECIALIZATION", null); } } GameObject gameObject1 = UnityEngine.Object.Instantiate <GameObject>(this.abilityDisplayPrefab); gameObject1.transform.SetParent(this.traitsAndAbilitiesRootObject.transform, false); AbilityDisplay abilityDisplay = gameObject1.GetComponent <AbilityDisplay>(); abilityDisplay.SetAbility(garrAbilityRec.ID, false, false, null); } } bool flag1 = false; for (int m = 0; m < item.AbilityIDs.Count; m++) { GarrAbilityRec record1 = StaticDB.garrAbilityDB.GetRecord(item.AbilityIDs[m]); if ((record1.Flags & 1) == 0) { if ((record1.Flags & 512) == 0) { if (!flag1) { GameObject gameObject2 = UnityEngine.Object.Instantiate <GameObject>(this.abilitiesHeaderPrefab); gameObject2.transform.SetParent(this.traitsAndAbilitiesRootObject.transform, false); flag1 = true; Text text = gameObject2.GetComponent <Text>(); if (text != null) { text.text = StaticDB.GetString("ABILITIES", null); } } GameObject gameObject3 = UnityEngine.Object.Instantiate <GameObject>(this.abilityDisplayPrefab); gameObject3.transform.SetParent(this.traitsAndAbilitiesRootObject.transform, false); AbilityDisplay component1 = gameObject3.GetComponent <AbilityDisplay>(); component1.SetAbility(item.AbilityIDs[m], false, false, null); } } } if (item.ZoneSupportSpellID > 0) { GameObject gameObject4 = UnityEngine.Object.Instantiate <GameObject>(this.zoneSupportAbilityHeaderPrefab); gameObject4.transform.SetParent(this.traitsAndAbilitiesRootObject.transform, false); GameObject gameObject5 = UnityEngine.Object.Instantiate <GameObject>(this.m_spellDisplayPrefab); gameObject5.transform.SetParent(this.traitsAndAbilitiesRootObject.transform, false); gameObject5.GetComponent <SpellDisplay>().SetSpell(item.ZoneSupportSpellID); Text componentInChildren = gameObject4.GetComponentInChildren <Text>(); if (componentInChildren != null) { componentInChildren.text = StaticDB.GetString("COMBAT_ALLY", null); } } if ((item.Flags & 8) != 0) { GarrStringRec garrStringRec = StaticDB.garrStringDB.GetRecord((GarrisonStatus.Faction() != PVP_FACTION.ALLIANCE ? record.HordeFlavorGarrStringID : record.AllianceFlavorGarrStringID)); if (garrStringRec != null) { Text text1 = UnityEngine.Object.Instantiate <Text>(this.m_troopDescriptionPrefab); text1.transform.SetParent(this.traitsAndAbilitiesRootObject.transform, false); text1.text = garrStringRec.Text; text1.font = FontLoader.LoadStandardFont(); } } this.InitEquipmentSlots(item); this.UpdateChampionButtons(item); }
public static string GetInventoryTypeString(INVENTORY_TYPE invType) { switch (invType) { case INVENTORY_TYPE.HEAD: { return(StaticDB.GetString("INVTYPE_HEAD", null)); } case INVENTORY_TYPE.NECK: { return(StaticDB.GetString("INVTYPE_NECK", null)); } case INVENTORY_TYPE.SHOULDER: { return(StaticDB.GetString("INVTYPE_SHOULDER", null)); } case INVENTORY_TYPE.BODY: { return(StaticDB.GetString("INVTYPE_BODY", null)); } case INVENTORY_TYPE.CHEST: { return(StaticDB.GetString("INVTYPE_CHEST", null)); } case INVENTORY_TYPE.WAIST: { return(StaticDB.GetString("INVTYPE_WAIST", null)); } case INVENTORY_TYPE.LEGS: { return(StaticDB.GetString("INVTYPE_LEGS", null)); } case INVENTORY_TYPE.FEET: { return(StaticDB.GetString("INVTYPE_FEET", null)); } case INVENTORY_TYPE.WRIST: { return(StaticDB.GetString("INVTYPE_WRIST", null)); } case INVENTORY_TYPE.HAND: { return(StaticDB.GetString("INVTYPE_HAND", null)); } case INVENTORY_TYPE.FINGER: { return(StaticDB.GetString("INVTYPE_FINGER", null)); } case INVENTORY_TYPE.TRINKET: { return(StaticDB.GetString("INVTYPE_TRINKET", null)); } case INVENTORY_TYPE.WEAPON: { return(StaticDB.GetString("INVTYPE_WEAPON", null)); } case INVENTORY_TYPE.SHIELD: { return(StaticDB.GetString("INVTYPE_SHIELD", null)); } case INVENTORY_TYPE.RANGED: { return(StaticDB.GetString("INVTYPE_RANGED", null)); } case INVENTORY_TYPE.CLOAK: { return(StaticDB.GetString("INVTYPE_CLOAK", null)); } case INVENTORY_TYPE.TWO_H_WEAPON: { return(StaticDB.GetString("INVTYPE_2HWEAPON", null)); } case INVENTORY_TYPE.BAG: { return(StaticDB.GetString("INVTYPE_BAG", null)); } case INVENTORY_TYPE.TABARD: { return(StaticDB.GetString("INVTYPE_TABARD", null)); } case INVENTORY_TYPE.ROBE: { return(StaticDB.GetString("INVTYPE_ROBE", null)); } case INVENTORY_TYPE.WEAPONMAINHAND: { return(StaticDB.GetString("INVTYPE_WEAPONMAINHAND", null)); } case INVENTORY_TYPE.WEAPONOFFHAND: { return(StaticDB.GetString("INVTYPE_WEAPONOFFHAND", null)); } case INVENTORY_TYPE.HOLDABLE: { return(StaticDB.GetString("INVTYPE_HOLDABLE", null)); } case INVENTORY_TYPE.AMMO: { return(StaticDB.GetString("INVTYPE_AMMO", null)); } case INVENTORY_TYPE.THROWN: { return(StaticDB.GetString("INVTYPE_THROWN", null)); } case INVENTORY_TYPE.RANGEDRIGHT: { return(StaticDB.GetString("INVTYPE_RANGEDRIGHT", null)); } case INVENTORY_TYPE.QUIVER: { return(StaticDB.GetString("INVTYPE_QUIVER", null)); } case INVENTORY_TYPE.RELIC: { return(StaticDB.GetString("INVTYPE_RELIC", null)); } } return(string.Empty); }
public void SetNewStringKey(string key) { this.baseTag = key; this.text = StaticDB.GetString(this.baseTag, this.baseTag); }
public void SetArmament(WrapperFollowerArmamentExt item, FollowerDetailView followerDetailView) { this.m_armamentItem = new WrapperFollowerArmamentExt?(item); this.m_followerDetailView = followerDetailView; ItemRec record = StaticDB.itemDB.GetRecord(item.ItemID); if (record != null) { this.m_equipmentName.text = GeneralHelpers.GetItemQualityColorTag(record.OverallQualityID) + record.Display + "</color>"; } else { this.m_equipmentName.text = "Unknown Item " + item.ItemID; } SpellTooltipRec record2 = StaticDB.spellTooltipDB.GetRecord(item.SpellID); if (record2 != null) { this.m_equipmentDescription.text = record2.Description; } else { this.m_equipmentDescription.text = string.Concat(new object[] { "ERROR. Unknown Spell ID: ", item.SpellID, " Item ID:", item.ItemID }); } this.m_equipmentDescription.text = WowTextParser.parser.Parse(this.m_equipmentDescription.text, item.SpellID); this.m_equipmentDescription.supportRichText = WowTextParser.parser.IsRichText(); if (this.m_iconErrorText != null) { this.m_iconErrorText.gameObject.SetActive(false); } if (record != null) { Sprite sprite = GeneralHelpers.LoadIconAsset(AssetBundleType.Icons, record.IconFileDataID); if (sprite != null) { this.m_equipmentIcon.sprite = sprite; } else if (this.m_iconErrorText != null) { this.m_iconErrorText.gameObject.SetActive(true); this.m_iconErrorText.text = string.Empty + record.IconFileDataID; } } this.m_equipmentQuantity.text = ((item.Quantity <= 1) ? string.Empty : (string.Empty + item.Quantity)); WrapperGarrisonFollower wrapperGarrisonFollower = PersistentFollowerData.followerDictionary[this.m_followerDetailView.GetCurrentFollower()]; bool flag = false; if (wrapperGarrisonFollower.CurrentMissionID != 0) { GarrMissionRec record3 = StaticDB.garrMissionDB.GetRecord(wrapperGarrisonFollower.CurrentMissionID); if (record3 != null && (record3.Flags & 16u) != 0u) { flag = true; } } int num = (wrapperGarrisonFollower.ItemLevelArmor + wrapperGarrisonFollower.ItemLevelWeapon) / 2; bool flag2 = num >= item.MinItemLevel && num < item.MaxItemLevel; if (wrapperGarrisonFollower.CurrentMissionID != 0 && !flag) { this.m_useItemButtonLabel.text = StaticDB.GetString("ON_MISSION", null); this.m_useItemButtonLabel.color = new Color(0.5f, 0.5f, 0.5f, 1f); this.m_useItemButton.interactable = false; } else if (!flag2 || (long)num >= (long)((ulong)GeneralHelpers.GetMaxFollowerItemLevel())) { this.m_useItemButtonLabel.text = FollowerInventoryListItem.m_maxiLevelString; this.m_useItemButtonLabel.color = new Color(0.5f, 0.5f, 0.5f, 1f); this.m_useItemButton.interactable = false; } else { this.m_useItemButtonLabel.text = StaticDB.GetString("USE_ITEM", null); } }
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 SetFollowerAppearance(WrapperGarrisonFollower follower, bool nextCapIsForQuality, bool isMaxLevelAndMaxQuality, bool isTroop, float initialEntranceDelay) { GarrFollowerRec record = StaticDB.garrFollowerDB.GetRecord(follower.GarrFollowerID); this.m_troopHeartContainerEmpty.SetActive(isTroop); this.m_troopHeartContainerFull.SetActive(isTroop); this.m_expiredPortraitX.SetActive(false); if (isTroop) { this.m_levelBorder.gameObject.SetActive(false); this.m_progressBarObj.SetActive(false); this.m_portraitBG.gameObject.SetActive(false); this.m_troopHeartContainerEmpty.SetActive(true); this.m_troopHeartContainerFull.SetActive(true); Transform[] componentsInChildren = this.m_troopHeartContainerEmpty.GetComponentsInChildren <Transform>(true); for (int i = 0; i < (int)componentsInChildren.Length; i++) { Transform transforms = componentsInChildren[i]; if (transforms != this.m_troopHeartContainerEmpty.transform) { UnityEngine.Object.Destroy(transforms.gameObject); } } Transform[] transformArrays = this.m_troopHeartContainerFull.GetComponentsInChildren <Transform>(true); for (int j = 0; j < (int)transformArrays.Length; j++) { Transform transforms1 = transformArrays[j]; if (transforms1 != this.m_troopHeartContainerFull.transform) { UnityEngine.Object.Destroy(transforms1.gameObject); } } float single = 0.15f; WrapperGarrisonFollower item = PersistentFollowerData.preMissionFollowerDictionary[follower.GarrFollowerID]; for (int k = 0; k < item.Durability; k++) { GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(this.m_troopHeartPrefab); gameObject.transform.SetParent(this.m_troopHeartContainerFull.transform, false); if (k >= follower.Durability) { float single1 = initialEntranceDelay + (float)(item.Durability - (k - follower.Durability)) * single; float single2 = 2f; iTween.ValueTo(gameObject, iTween.Hash(new object[] { "name", "fade", "from", 0f, "to", 1f, "time", single2, "easetype", iTween.EaseType.easeOutCubic, "delay", single1, "onupdatetarget", gameObject, "onupdate", "SetHeartEffectProgress", "oncomplete", "FinishHeartEffect" })); } } for (int l = 0; l < record.Vitality; l++) { GameObject gameObject1 = UnityEngine.Object.Instantiate <GameObject>(this.m_troopEmptyHeartPrefab); gameObject1.transform.SetParent(this.m_troopHeartContainerEmpty.transform, false); } if (follower.Durability <= 0) { DelayedUIAnim delayedUIAnim = base.gameObject.AddComponent <DelayedUIAnim>(); float single3 = initialEntranceDelay + (float)(item.Durability - follower.Durability) * single + 1f; delayedUIAnim.Init(single3, "RedFailX", "SFX/UI_Mission_Fail_Red_X", this.m_followerPortrait.transform, 1.5f, 0.3f); DelayedObjectEnable delayedObjectEnable = base.gameObject.AddComponent <DelayedObjectEnable>(); delayedObjectEnable.Init(single3 + 0.25f, this.m_expiredPortraitX); } } Sprite sprite = GeneralHelpers.LoadIconAsset(AssetBundleType.PortraitIcons, (GarrisonStatus.Faction() != PVP_FACTION.HORDE ? record.AllianceIconFileDataID : record.HordeIconFileDataID)); if (sprite != null) { this.m_followerPortrait.sprite = sprite; } if (!isTroop) { if (follower.Quality != 6) { this.m_qualityBorder.gameObject.SetActive(true); this.m_levelBorder.gameObject.SetActive(true); } else { this.m_qualityBorder.gameObject.SetActive(false); this.m_levelBorder.gameObject.SetActive(false); } Color qualityColor = GeneralHelpers.GetQualityColor(follower.Quality); this.m_qualityBorder.color = qualityColor; this.m_troopBackground.SetActive(false); this.m_followerBackground.SetActive(true); } else { this.m_qualityBorder.gameObject.SetActive(false); this.m_levelBorder.gameObject.SetActive(false); this.m_troopBackground.SetActive(true); this.m_followerBackground.SetActive(false); this.m_iLevelText.gameObject.SetActive(false); } CreatureRec creatureRec = StaticDB.creatureDB.GetRecord((GarrisonStatus.Faction() != PVP_FACTION.HORDE ? record.AllianceCreatureID : record.HordeCreatureID)); if (follower.Quality == 6 && record.TitleName != null && record.TitleName.Length > 0) { this.m_followerNameText.text = record.TitleName; } else if (record != null) { this.m_followerNameText.text = creatureRec.Name; } this.m_iLevelText.text = follower.FollowerLevel.ToString(); GarrClassSpecRec garrClassSpecRec = StaticDB.garrClassSpecDB.GetRecord((GarrisonStatus.Faction() != PVP_FACTION.HORDE ? (int)record.AllianceGarrClassSpecID : (int)record.HordeGarrClassSpecID)); this.m_classText.text = garrClassSpecRec.ClassSpec; if (!isTroop) { if (isMaxLevelAndMaxQuality) { this.m_progressBarObj.SetActive(false); this.m_toNextLevelOrUpgradeText.text = string.Empty; } else if (!nextCapIsForQuality) { this.m_progressBarObj.SetActive(true); this.m_toNextLevelOrUpgradeText.text = StaticDB.GetString("TO_NEXT_LEVEL", string.Empty); } else { this.m_progressBarObj.SetActive(true); this.m_toNextLevelOrUpgradeText.text = StaticDB.GetString("TO_NEXT_UPGRADE", string.Empty); } } }
public void SetRealmListTitle() { this.m_titleText.text = StaticDB.GetString("REALM_SELECTION", null); }
public void SetGameAccountTitle() { this.m_titleText.text = StaticDB.GetString("ACCOUNT_SELECTION", null); }
public void SetEquipment(WrapperFollowerEquipment item, FollowerDetailView followerDetailView, int abilityToReplace) { this.m_abilityToReplace = abilityToReplace; this.m_equipmentItem = new WrapperFollowerEquipment?(item); this.m_followerDetailView = followerDetailView; ItemRec record = StaticDB.itemDB.GetRecord(item.ItemID); this.m_equipmentName.text = GeneralHelpers.GetItemQualityColorTag(record.OverallQualityID) + record.Display + "</color>"; GarrAbilityRec record2 = StaticDB.garrAbilityDB.GetRecord(item.GarrAbilityID); if (record2 != null) { this.m_equipmentDescription.text = record2.Description; } else { SpellTooltipRec record3 = StaticDB.spellTooltipDB.GetRecord(item.SpellID); if (record3 != null) { this.m_equipmentDescription.text = record3.Description; } else { this.m_equipmentDescription.text = string.Concat(new object[] { "ERROR. Ability ID:", item.GarrAbilityID, " Spell ID: ", item.SpellID, " Item ID:", item.ItemID }); } } this.m_equipmentDescription.text = GeneralHelpers.LimitZhLineLength(WowTextParser.parser.Parse(this.m_equipmentDescription.text, 0), 18); this.m_equipmentDescription.supportRichText = WowTextParser.parser.IsRichText(); if (this.m_iconErrorText != null) { this.m_iconErrorText.gameObject.SetActive(false); } Sprite sprite = GeneralHelpers.LoadIconAsset(AssetBundleType.Icons, record.IconFileDataID); if (sprite != null) { this.m_equipmentIcon.sprite = sprite; } else if (this.m_iconErrorText != null) { this.m_iconErrorText.gameObject.SetActive(true); this.m_iconErrorText.text = string.Empty + record.IconFileDataID; } this.m_equipmentQuantity.text = ((item.Quantity <= 1) ? string.Empty : (string.Empty + item.Quantity)); if (PersistentFollowerData.followerDictionary[this.m_followerDetailView.GetCurrentFollower()].CurrentMissionID != 0) { this.m_useItemButtonLabel.text = StaticDB.GetString("ON_MISSION", null); this.m_useItemButtonLabel.color = new Color(0.5f, 0.5f, 0.5f, 1f); this.m_useItemButton.interactable = false; } else { this.m_useItemButtonLabel.text = StaticDB.GetString("USE_ITEM", null); } }
public void InitMissionList() { this.m_combatAllyListItem.gameObject.SetActive(false); MiniMissionListItem[] componentsInChildren = this.m_availableMission_listContents.GetComponentsInChildren <MiniMissionListItem>(true); for (int i = 0; i < (int)componentsInChildren.Length; i++) { MiniMissionListItem miniMissionListItem = componentsInChildren[i]; bool flag = true; if (PersistentMissionData.missionDictionary.ContainsKey(miniMissionListItem.GetMissionID())) { WrapperGarrisonMission item = PersistentMissionData.missionDictionary[miniMissionListItem.GetMissionID()]; if (item.MissionState == 0) { flag = false; miniMissionListItem.UpdateMechanicPreview(false, item); } } if (flag) { miniMissionListItem.gameObject.transform.SetParent(null); UnityEngine.Object.Destroy(miniMissionListItem.gameObject); } } MiniMissionListItem[] miniMissionListItemArray = this.m_inProgressMission_listContents.GetComponentsInChildren <MiniMissionListItem>(true); for (int j = 0; j < (int)miniMissionListItemArray.Length; j++) { MiniMissionListItem miniMissionListItem1 = miniMissionListItemArray[j]; bool flag1 = true; if (PersistentMissionData.missionDictionary.ContainsKey(miniMissionListItem1.GetMissionID()) && PersistentMissionData.missionDictionary[miniMissionListItem1.GetMissionID()].MissionState != 0) { flag1 = false; } if (flag1) { miniMissionListItem1.gameObject.transform.SetParent(null); UnityEngine.Object.Destroy(miniMissionListItem1.gameObject); } } MiniMissionListItem[] componentsInChildren1 = this.m_availableMission_listContents.GetComponentsInChildren <MiniMissionListItem>(true); MiniMissionListItem[] miniMissionListItemArray1 = this.m_inProgressMission_listContents.GetComponentsInChildren <MiniMissionListItem>(true); foreach (WrapperGarrisonMission value in PersistentMissionData.missionDictionary.Values) { bool flag2 = false; MiniMissionListItem[] miniMissionListItemArray2 = componentsInChildren1; int num = 0; while (num < (int)miniMissionListItemArray2.Length) { if (miniMissionListItemArray2[num].GetMissionID() != value.MissionRecID) { num++; } else { flag2 = true; break; } } if (!flag2) { MiniMissionListItem[] miniMissionListItemArray3 = miniMissionListItemArray1; int num1 = 0; while (num1 < (int)miniMissionListItemArray3.Length) { if (miniMissionListItemArray3[num1].GetMissionID() != value.MissionRecID) { num1++; } else { flag2 = true; break; } } } if (!flag2) { GarrMissionRec record = StaticDB.garrMissionDB.GetRecord(value.MissionRecID); if (record == null) { Debug.LogWarning(string.Concat("Mission Not Found: ID ", value.MissionRecID)); } else if (record.GarrFollowerTypeID == (uint)GarrisonStatus.GarrisonFollowerType) { if ((record.Flags & 16) == 0) { MiniMissionListItem miniMissionListItem2 = UnityEngine.Object.Instantiate <MiniMissionListItem>(this.m_miniMissionListItemPrefab); if (value.MissionState != 0) { miniMissionListItem2.transform.SetParent(this.m_inProgressMission_listContents.transform, false); this.ShowMissionStartedAnim(); } else { miniMissionListItem2.transform.SetParent(this.m_availableMission_listContents.transform, false); } miniMissionListItem2.SetMission(value); } else { this.m_combatAllyListItem.gameObject.SetActive(true); this.m_combatAllyListItem.UpdateVisuals(); } } } } int num2 = 0; int num3 = 0; PersistentMissionData.GetAvailableAndProgressCounts(ref num3, ref num2); this.m_availableMissionsTabLabel.text = string.Concat(StaticDB.GetString("AVAILABLE", null), " - ", num3); this.m_inProgressMissionsTabLabel.text = string.Concat(StaticDB.GetString("IN_PROGRESS", null), " - ", num2); this.m_noMissionsAvailableLabel.gameObject.SetActive(num3 == 0); this.m_noMissionsInProgressLabel.gameObject.SetActive(num2 == 0); }
private void UpdateOnlineStatus() { if (!this.m_enabled) { this.m_loginButtonNameText.text = string.Concat(this.m_realmName, " (", StaticDB.GetString("OFFLINE", null), ")"); this.m_loginButtonNameText.color = BnLoginButton.s_disabledColor; this.m_numCharactersText.text = string.Concat(string.Empty, this.m_characterCount); this.m_numCharactersText.color = BnLoginButton.s_disabledColor; } else { this.m_loginButtonNameText.text = this.m_realmName; this.m_loginButtonNameText.color = BnLoginButton.s_enabledColor; this.m_numCharactersText.text = string.Concat(string.Empty, this.m_characterCount); this.m_numCharactersText.color = BnLoginButton.s_enabledCharacterCountColor; } base.GetComponent <Button>().interactable = this.m_enabled; if (!this.m_enabled) { this.m_realmStatusIcon.sprite = Resources.Load <Sprite>("NewLoginPanel/Realm_StatusRed"); } else { this.m_realmStatusIcon.sprite = Resources.Load <Sprite>("NewLoginPanel/Realm_StatusGreen"); } }
public void InitReward(MissionRewardDisplay.RewardType rewardType, int rewardID, int rewardQuantity, int itemContext, int iconFileDataID = 0) { if (rewardType == MissionRewardDisplay.RewardType.faction) { return; } this.ClearResults(); this.m_rewardType = rewardType; this.m_rewardID = rewardID; this.m_rewardQuantity = rewardQuantity; this.m_itemContext = itemContext; if (this.m_iconErrorText != null) { this.m_iconErrorText.gameObject.SetActive(false); } switch (this.m_rewardType) { case MissionRewardDisplay.RewardType.item: { Sprite sprite = null; ItemRec record = StaticDB.itemDB.GetRecord(this.m_rewardID); if (iconFileDataID > 0) { sprite = GeneralHelpers.LoadIconAsset(AssetBundleType.Icons, iconFileDataID); } else if (record != null) { sprite = GeneralHelpers.LoadIconAsset(AssetBundleType.Icons, record.IconFileDataID); } if (sprite != null) { this.m_rewardIcon.sprite = sprite; } else if (this.m_iconErrorText != null) { this.m_iconErrorText.gameObject.SetActive(true); this.m_iconErrorText.text = string.Concat(string.Empty, iconFileDataID); } if (this.m_rewardName != null) { if (record == null) { this.m_rewardName.text = string.Concat("Unknown Item ", this.m_rewardID); } else { this.m_rewardName.text = record.Display; this.m_rewardName.color = GeneralHelpers.GetQualityColor(record.OverallQualityID); } } if (this.m_isExpandedDisplay) { this.m_rewardQuantityText.text = (this.m_rewardQuantity <= 1 ? string.Empty : this.m_rewardQuantity.ToString("N0")); } break; } case MissionRewardDisplay.RewardType.gold: { this.m_rewardIcon.sprite = Resources.Load <Sprite>("MiscIcons/INV_Misc_Coin_01"); if (this.m_isExpandedDisplay) { this.m_rewardQuantityText.text = string.Empty; this.m_rewardName.text = (this.m_rewardQuantity <= 1 ? string.Empty : this.m_rewardQuantity.ToString("N0")); } break; } case MissionRewardDisplay.RewardType.followerXP: { this.m_rewardIcon.sprite = GeneralHelpers.GetLocalizedFollowerXpIcon(); this.m_rewardQuantityText.text = string.Empty; if (this.m_rewardName != null && this.m_isExpandedDisplay) { this.m_rewardName.text = (this.m_rewardQuantity <= 1 ? string.Empty : string.Concat(this.m_rewardQuantity.ToString("N0"), " ", StaticDB.GetString("XP2", "XP"))); } break; } case MissionRewardDisplay.RewardType.currency: { Sprite sprite1 = CurrencyContainerDB.LoadCurrencyContainerIcon(this.m_rewardID, this.m_rewardQuantity); if (sprite1 == null) { this.m_iconErrorText.gameObject.SetActive(true); this.m_iconErrorText.text = string.Concat("c ", this.m_rewardID); } else { this.m_rewardIcon.sprite = sprite1; } if (this.m_isExpandedDisplay) { CurrencyTypesRec currencyTypesRec = StaticDB.currencyTypesDB.GetRecord(rewardID); if (currencyTypesRec == null) { this.m_rewardName.text = string.Empty; this.m_rewardQuantityText.text = (this.m_rewardQuantity <= 1 ? string.Empty : this.m_rewardQuantity.ToString("N0")); } else { CurrencyContainerRec currencyContainerRec = CurrencyContainerDB.CheckAndGetValidCurrencyContainer(this.m_rewardID, this.m_rewardQuantity); if (currencyContainerRec == null) { this.m_rewardName.text = currencyTypesRec.Name; this.m_rewardQuantityText.text = (this.m_rewardQuantity <= 1 ? string.Empty : this.m_rewardQuantity.ToString("N0")); } else { this.m_rewardName.text = currencyContainerRec.ContainerName; this.m_rewardName.color = GeneralHelpers.GetQualityColor(currencyContainerRec.ContainerQuality); this.m_rewardQuantityText.text = string.Empty; } } } else if (StaticDB.currencyTypesDB.GetRecord(rewardID) != null) { CurrencyContainerRec currencyContainerRec1 = CurrencyContainerDB.CheckAndGetValidCurrencyContainer(this.m_rewardID, this.m_rewardQuantity); if (currencyContainerRec1 != null && currencyContainerRec1.ContainerQuality > 0 && this.m_qualityBorder != null) { this.m_qualityBorder.color = GeneralHelpers.GetQualityColor(currencyContainerRec1.ContainerQuality); } } break; } } if (!this.m_isExpandedDisplay) { if (CurrencyContainerDB.CheckAndGetValidCurrencyContainer(this.m_rewardID, rewardQuantity) == null) { this.m_rewardQuantityText.text = (this.m_rewardQuantity <= 1 ? string.Empty : this.m_rewardQuantity.ToString("N0")); } else { this.m_rewardQuantityText.text = string.Empty; } } }
public void SetBounty(WrapperWorldQuestBounty bounty) { Sprite sprite; this.m_bounty = bounty; Sprite sprite1 = GeneralHelpers.LoadIconAsset(AssetBundleType.Icons, bounty.IconFileDataID); if (sprite1 == null) { this.m_bountyIconInvalidFileDataID.gameObject.SetActive(true); this.m_bountyIconInvalidFileDataID.text = string.Concat(string.Empty, bounty.IconFileDataID); } else { this.m_bountyIconInvalidFileDataID.gameObject.SetActive(false); this.m_bountyIcon.sprite = sprite1; } QuestV2Rec record = StaticDB.questDB.GetRecord(bounty.QuestID); if (record == null) { this.m_bountyName.text = string.Concat("Unknown Quest ID ", bounty.QuestID); this.m_bountyDescription.text = string.Concat("Unknown Quest ID ", bounty.QuestID); } else { this.m_bountyName.text = record.QuestTitle; this.m_bountyDescription.text = string.Concat(new object[] { string.Empty, bounty.NumCompleted, "/", bounty.NumNeeded, " ", record.LogDescription }); } this.m_timeLeft.text = StaticDB.GetString("TIME_LEFT", "Time Left: PH"); RectTransform[] componentsInChildren = this.m_bountyQuestIconArea.GetComponentsInChildren <RectTransform>(true); for (int i = 0; i < (int)componentsInChildren.Length; i++) { RectTransform rectTransform = componentsInChildren[i]; if (rectTransform != null && rectTransform.gameObject != this.m_bountyQuestIconArea.gameObject) { rectTransform.SetParent(null); UnityEngine.Object.Destroy(rectTransform.gameObject); } } for (int j = 0; j < bounty.NumCompleted; j++) { GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(this.m_bountyQuestCompleteIconPrefab); gameObject.transform.SetParent(this.m_bountyQuestIconArea.transform, false); } for (int k = 0; k < bounty.NumNeeded - bounty.NumCompleted; k++) { GameObject gameObject1 = UnityEngine.Object.Instantiate <GameObject>(this.m_bountyQuestAvailableIconPrefab); gameObject1.transform.SetParent(this.m_bountyQuestIconArea.transform, false); } this.UpdateTimeRemaining(); bounty.Items.RemoveAll((WrapperWorldQuestReward item) => (item.RecordID == 157831 ? true : item.RecordID == 1500)); if (bounty.Items.Count > 0 && StaticDB.itemDB.GetRecord(bounty.Items[0].RecordID) != null) { WrapperWorldQuestReward wrapperWorldQuestReward = bounty.Items[0]; Sprite sprite2 = GeneralHelpers.LoadIconAsset(AssetBundleType.Icons, wrapperWorldQuestReward.FileDataID); this.m_rewardInfo.SetReward(MissionRewardDisplay.RewardType.item, wrapperWorldQuestReward.RecordID, wrapperWorldQuestReward.Quantity, sprite2, wrapperWorldQuestReward.ItemContext); } else if (bounty.Money > 1000000) { Sprite sprite3 = Resources.Load <Sprite>("MiscIcons/INV_Misc_Coin_01"); this.m_rewardInfo.SetGold(bounty.Money / 10000, sprite3); } else if (bounty.Currencies.Count > 1) { int num = 0; foreach (WrapperWorldQuestReward currency in bounty.Currencies) { CurrencyTypesRec currencyTypesRec = StaticDB.currencyTypesDB.GetRecord(currency.RecordID); if (currency.RecordID == 1553 && currencyTypesRec != null) { if (CurrencyContainerDB.CheckAndGetValidCurrencyContainer(currency.RecordID, currency.Quantity) == null) { sprite = GeneralHelpers.LoadCurrencyIcon(currency.RecordID); int quantity = currency.Quantity / ((currencyTypesRec.Flags & 8) == 0 ? 1 : 100); if (quantity <= num) { continue; } num = quantity; this.m_rewardInfo.SetCurrency(currency.RecordID, num, sprite); } else { sprite = CurrencyContainerDB.LoadCurrencyContainerIcon(currency.RecordID, currency.Quantity); int quantity1 = currency.Quantity / ((currencyTypesRec.Flags & 8) == 0 ? 1 : 100); if (quantity1 > num) { num = quantity1; this.m_rewardInfo.SetCurrency(currency.RecordID, num, sprite); } } } } } }