Exemplo n.º 1
0
        public void SetFollower(WrapperGarrisonFollower follower)
        {
            this.m_followerID        = follower.GarrFollowerID;
            this.followerIDText.text = string.Concat(new object[]
            {
                "ID:",
                follower.GarrFollowerID,
                " Q:",
                follower.Quality
            });
            this.m_inParty = false;
            this.SetAvailabilityStatus(follower);
            GarrFollowerRec record = StaticDB.garrFollowerDB.GetRecord(follower.GarrFollowerID);

            if (record == null)
            {
                return;
            }
            if ((GARR_FOLLOWER_TYPE)record.GarrFollowerTypeID != GarrisonStatus.GarrisonFollowerType)
            {
                return;
            }
            if (follower.Quality == 6 && record.TitleName != null && record.TitleName.Length > 0)
            {
                this.nameText.text = record.TitleName;
            }
            else if (record != null)
            {
                CreatureRec record2 = StaticDB.creatureDB.GetRecord((GarrisonStatus.Faction() != PVP_FACTION.HORDE) ? record.AllianceCreatureID : record.HordeCreatureID);
                this.nameText.text = record2.Name;
            }
            this.m_levelText.text = string.Empty + follower.FollowerLevel;
            int    num    = (GarrisonStatus.Faction() != PVP_FACTION.HORDE) ? record.AllianceIconFileDataID : record.HordeIconFileDataID;
            Sprite sprite = GeneralHelpers.LoadIconAsset(AssetBundleType.PortraitIcons, num);

            if (sprite != null)
            {
                this.followerPortrait.sprite = sprite;
                this.portraitErrorText.gameObject.SetActive(false);
            }
            else
            {
                this.portraitErrorText.text = string.Empty + num;
                this.portraitErrorText.gameObject.SetActive(true);
            }
            Transform[] componentsInChildren = this.m_troopHeartContainer.GetComponentsInChildren <Transform>(true);
            foreach (Transform transform in componentsInChildren)
            {
                if (transform != this.m_troopHeartContainer.transform)
                {
                    Object.Destroy(transform.gameObject);
                }
            }
            bool flag = (follower.Flags & 8) != 0;

            if (flag)
            {
                this.nameText.color = Color.white;
                int j;
                for (j = 0; j < follower.Durability; j++)
                {
                    GameObject gameObject = Object.Instantiate <GameObject>(this.m_troopHeartPrefab);
                    gameObject.transform.SetParent(this.m_troopHeartContainer.transform, false);
                }
                for (int k = j; k < (int)record.Vitality; k++)
                {
                    GameObject gameObject2 = Object.Instantiate <GameObject>(this.m_troopEmptyHeartPrefab);
                    gameObject2.transform.SetParent(this.m_troopHeartContainer.transform, false);
                }
                this.m_progressBarObj.SetActive(false);
                this.m_LevelBorderArea.gameObject.SetActive(false);
                this.m_followerBG.SetActive(false);
                this.m_troopBG.SetActive(true);
                this.m_listItem.targetGraphic = this.m_troopBG.GetComponent <Graphic>();
            }
            else
            {
                this.m_LevelBorderArea.gameObject.SetActive(true);
                this.m_followerBG.SetActive(true);
                this.m_troopBG.SetActive(false);
                this.m_listItem.targetGraphic = this.m_followerBG.GetComponent <Graphic>();
            }
            if (follower.Quality == 6)
            {
                this.m_portraitQualityRing.gameObject.SetActive(false);
            }
            else
            {
                this.m_portraitQualityRing.gameObject.SetActive(true);
            }
            if (follower.Quality >= 2)
            {
                Color qualityColor = GeneralHelpers.GetQualityColor(follower.Quality);
                this.m_portraitQualityRing.color = qualityColor;
            }
            this.m_portraitQualityRing.gameObject.SetActive(follower.Quality >= 2);
        }
Exemplo n.º 2
0
 public static int GetNumInactiveChampions()
 {
     return(PersistentFollowerData.followerDictionary.Count <KeyValuePair <int, WrapperGarrisonFollower> >((KeyValuePair <int, WrapperGarrisonFollower> pair) => (!GeneralHelpers.IsFollowerInactive(pair.Value) ? false : !GeneralHelpers.IsFollowerTroop(pair.Value))));
 }
Exemplo n.º 3
0
 public static int GetNumTroops()
 {
     return(PersistentFollowerData.followerDictionary.Count <KeyValuePair <int, WrapperGarrisonFollower> >((KeyValuePair <int, WrapperGarrisonFollower> pair) => (GeneralHelpers.IsFollowerInactive(pair.Value) || !GeneralHelpers.IsFollowerTroop(pair.Value) ? false : pair.Value.Durability > 0)));
 }
 private void Start()
 {
     this.m_areYouSureLabel.font   = GeneralHelpers.LoadStandardFont();
     this.m_cancelButtonLabel.font = GeneralHelpers.LoadStandardFont();
     this.m_okButtonLabel.font     = GeneralHelpers.LoadStandardFont();
 }
Exemplo n.º 5
0
 public static string GetItemQualityColorTag(int qualityID)
 {
     return(string.Concat("<color=#", GeneralHelpers.GetItemQualityColor(qualityID), ">"));
 }
Exemplo n.º 6
0
 private void Start()
 {
     this.m_loginButtonNameText.font = GeneralHelpers.LoadStandardFont();
     this.m_numCharactersText.font   = GeneralHelpers.LoadStandardFont();
 }
Exemplo n.º 7
0
 public static string GetItemQualityColorTag(int qualityID)
 {
     return("<color=#" + GeneralHelpers.GetItemQualityColor(qualityID) + ">");
 }
        public void SetMission(int garrMissionID)
        {
            base.gameObject.name = "AdvMapMissionSite " + garrMissionID;
            if (!PersistentMissionData.missionDictionary.ContainsKey(garrMissionID))
            {
                return;
            }
            this.m_garrMissionID = garrMissionID;
            GarrMissionRec record = StaticDB.garrMissionDB.GetRecord(garrMissionID);

            if (record == null || !PersistentMissionData.missionDictionary.ContainsKey(garrMissionID))
            {
                return;
            }
            this.m_areaID           = record.AreaID;
            this.m_isSupportMission = false;
            if ((record.Flags & 16u) != 0u)
            {
                this.m_isSupportMission = true;
                this.m_missionTimeRemainingText.text = "Fortified";
            }
            GarrMissionTypeRec record2 = StaticDB.garrMissionTypeDB.GetRecord((int)record.GarrMissionTypeID);

            if (record2.UiTextureAtlasMemberID > 0u)
            {
                Sprite atlasSprite = TextureAtlas.instance.GetAtlasSprite((int)record2.UiTextureAtlasMemberID);
                if (atlasSprite != null)
                {
                    this.m_availableMissionTypeIcon.sprite  = atlasSprite;
                    this.m_inProgressMissionTypeIcon.sprite = atlasSprite;
                }
            }
            WrapperGarrisonMission wrapperGarrisonMission = PersistentMissionData.missionDictionary[garrMissionID];

            if (wrapperGarrisonMission.MissionState == 1 || wrapperGarrisonMission.MissionState == 2)
            {
                this.m_missionDuration = wrapperGarrisonMission.MissionDuration;
            }
            else
            {
                this.m_missionDuration = TimeSpan.FromSeconds((double)record.MissionDuration);
            }
            this.m_missionStartedTime = wrapperGarrisonMission.StartTime;
            this.m_availableMissionGroup.gameObject.SetActive(wrapperGarrisonMission.MissionState == 0);
            this.m_inProgressMissionGroup.gameObject.SetActive(wrapperGarrisonMission.MissionState == 1);
            this.m_completeMissionGroup.gameObject.SetActive(wrapperGarrisonMission.MissionState == 2 || wrapperGarrisonMission.MissionState == 3);
            if (wrapperGarrisonMission.MissionState == 1)
            {
                foreach (KeyValuePair <int, WrapperGarrisonFollower> keyValuePair in PersistentFollowerData.followerDictionary)
                {
                    if (keyValuePair.Value.CurrentMissionID == garrMissionID)
                    {
                        GarrFollowerRec record3 = StaticDB.garrFollowerDB.GetRecord(keyValuePair.Value.GarrFollowerID);
                        if (record3 != null)
                        {
                            Sprite sprite = GeneralHelpers.LoadIconAsset(AssetBundleType.PortraitIcons, (GarrisonStatus.Faction() != PVP_FACTION.HORDE) ? record3.AllianceIconFileDataID : record3.HordeIconFileDataID);
                            if (sprite != null)
                            {
                                this.m_followerPortraitImage.sprite = sprite;
                            }
                            this.m_followerPortraitRingImage.GetComponent <Image>().enabled = true;
                            break;
                        }
                    }
                }
            }
            this.m_missionLevelText.text = string.Empty + record.TargetLevel + ((record.TargetLevel != 110) ? string.Empty : (" (" + record.TargetItemLevel + ")"));
            this.UpdateMissionRemainingTimeDisplay();
        }
Exemplo n.º 9
0
        public void SetQuestID(int questID)
        {
            this.m_questID       = questID;
            base.gameObject.name = "WorldQuest " + this.m_questID;
            if (!WorldQuestData.WorldQuestDictionary.ContainsKey(this.m_questID))
            {
                return;
            }
            WrapperWorldQuest wrapperWorldQuest = WorldQuestData.WorldQuestDictionary[this.m_questID];

            if (wrapperWorldQuest.Items == null)
            {
                return;
            }
            this.m_quantityArea.gameObject.SetActive(false);
            bool flag = false;

            foreach (WrapperWorldQuestReward wrapperWorldQuestReward in wrapperWorldQuest.Items)
            {
                ItemRec record = StaticDB.itemDB.GetRecord(wrapperWorldQuestReward.RecordID);
                if (record == null)
                {
                    Debug.LogWarning(string.Concat(new object[]
                    {
                        "Invalid Item ID ",
                        wrapperWorldQuestReward.RecordID,
                        " from Quest ID ",
                        this.m_questID,
                        ". Ignoring for loot quality check."
                    }));
                }
                else
                {
                    flag = true;
                    if (record.OverallQualityID > (int)this.m_lootQuality)
                    {
                        this.m_lootQuality = (ITEM_QUALITY)record.OverallQualityID;
                    }
                    if (this.m_showLootIconInsteadOfMain)
                    {
                        SpellEffectRec spellEffectRec2 = StaticDB.itemEffectDB.GetRecordsByParentID(wrapperWorldQuestReward.RecordID).SelectMany((ItemEffectRec itemEffectRec) => StaticDB.spellEffectDB.GetRecordsByParentID(itemEffectRec.SpellID)).FirstOrDefault((SpellEffectRec spellEffectRec) => spellEffectRec.Effect == 240);
                        this.m_main.sprite = GeneralHelpers.LoadIconAsset(AssetBundleType.Icons, wrapperWorldQuestReward.FileDataID);
                        this.m_itemID      = wrapperWorldQuestReward.RecordID;
                        this.m_itemContext = wrapperWorldQuestReward.ItemContext;
                        this.ShowILVL();
                    }
                }
            }
            if (!flag && this.m_showLootIconInsteadOfMain)
            {
                if (wrapperWorldQuest.Currencies.Count > 0)
                {
                    foreach (WrapperWorldQuestReward wrapperWorldQuestReward2 in wrapperWorldQuest.Currencies)
                    {
                        CurrencyTypesRec record2 = StaticDB.currencyTypesDB.GetRecord(wrapperWorldQuestReward2.RecordID);
                        if (record2 != null)
                        {
                            this.m_main.sprite = GeneralHelpers.LoadCurrencyIcon(wrapperWorldQuestReward2.RecordID);
                        }
                        if (AdventureMapPanel.instance.IsFilterEnabled(MapFilterType.OrderResources))
                        {
                            this.m_quantityArea.gameObject.SetActive(true);
                            this.m_quantity.text = wrapperWorldQuestReward2.Quantity.ToString();
                        }
                    }
                }
                else if (wrapperWorldQuest.Money > 0)
                {
                    this.m_main.sprite = Resources.Load <Sprite>("MiscIcons/INV_Misc_Coin_01");
                    if (AdventureMapPanel.instance.IsFilterEnabled(MapFilterType.Gold))
                    {
                        this.m_quantityArea.gameObject.SetActive(true);
                        this.m_quantity.text = string.Empty + wrapperWorldQuest.Money / 100 / 100;
                    }
                }
                else if (wrapperWorldQuest.Experience > 0)
                {
                    this.m_main.sprite = GeneralHelpers.GetLocalizedFollowerXpIcon();
                }
            }
            this.m_endTime = wrapperWorldQuest.EndTime;
            int             areaID  = 0;
            WorldMapAreaRec record3 = StaticDB.worldMapAreaDB.GetRecord(wrapperWorldQuest.WorldMapAreaID);

            if (record3 != null)
            {
                areaID = record3.AreaID;
            }
            this.m_areaID = areaID;
            QuestInfoRec record4 = StaticDB.questInfoDB.GetRecord(wrapperWorldQuest.QuestInfoID);

            if (record4 == null)
            {
                return;
            }
            bool active = (record4.Modifiers & 2) != 0;

            this.m_dragonFrame.gameObject.SetActive(active);
            bool flag2 = record4.Type == 7;

            this.m_normalGlow.gameObject.SetActive(!flag2);
            this.m_legionAssaultGlow.gameObject.SetActive(flag2);
            bool flag3 = (record4.Modifiers & 1) != 0;

            if (flag3 && record4.Type != 3)
            {
                this.m_background.sprite = Resources.Load <Sprite>("NewWorldQuest/Mobile-RareQuest");
            }
            bool flag4 = (record4.Modifiers & 4) != 0;

            if (flag4 && record4.Type != 3)
            {
                this.m_background.sprite = Resources.Load <Sprite>("NewWorldQuest/Mobile-EpicQuest");
            }
            int    uitextureAtlasMemberID;
            string text;

            switch (record4.Type)
            {
            case 1:
            {
                int profession = record4.Profession;
                switch (profession)
                {
                case 182:
                    uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-herbalism");
                    text = "Mobile-Herbalism";
                    break;

                default:
                    if (profession != 164)
                    {
                        if (profession != 165)
                        {
                            if (profession != 129)
                            {
                                if (profession != 171)
                                {
                                    if (profession != 197)
                                    {
                                        if (profession != 202)
                                        {
                                            if (profession != 333)
                                            {
                                                if (profession != 356)
                                                {
                                                    if (profession != 393)
                                                    {
                                                        if (profession != 755)
                                                        {
                                                            if (profession != 773)
                                                            {
                                                                if (profession != 794)
                                                                {
                                                                    uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-questmarker-questbang");
                                                                    text = "Mobile-QuestExclamationIcon";
                                                                }
                                                                else
                                                                {
                                                                    uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-archaeology");
                                                                    text = "Mobile-Archaeology";
                                                                }
                                                            }
                                                            else
                                                            {
                                                                uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-inscription");
                                                                text = "Mobile-Inscription";
                                                            }
                                                        }
                                                        else
                                                        {
                                                            uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-jewelcrafting");
                                                            text = "Mobile-Jewelcrafting";
                                                        }
                                                    }
                                                    else
                                                    {
                                                        uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-skinning");
                                                        text = "Mobile-Skinning";
                                                    }
                                                }
                                                else
                                                {
                                                    uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-fishing");
                                                    text = "Mobile-Fishing";
                                                }
                                            }
                                            else
                                            {
                                                uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-enchanting");
                                                text = "Mobile-Enchanting";
                                            }
                                        }
                                        else
                                        {
                                            uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-engineering");
                                            text = "Mobile-Engineering";
                                        }
                                    }
                                    else
                                    {
                                        uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-tailoring");
                                        text = "Mobile-Tailoring";
                                    }
                                }
                                else
                                {
                                    uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-alchemy");
                                    text = "Mobile-Alchemy";
                                }
                            }
                            else
                            {
                                uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-firstaid");
                                text = "Mobile-FirstAid";
                            }
                        }
                        else
                        {
                            uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-leatherworking");
                            text = "Mobile-Leatherworking";
                        }
                    }
                    else
                    {
                        uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-blacksmithing");
                        text = "Mobile-Blacksmithing";
                    }
                    break;

                case 185:
                    uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-cooking");
                    text = "Mobile-Cooking";
                    break;

                case 186:
                    uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-mining");
                    text = "Mobile-Mining";
                    break;
                }
                goto IL_6FD;
            }

            case 3:
                uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-pvp-ffa");
                text = "Mobile-PVP";
                goto IL_6FD;

            case 4:
                uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-petbattle");
                text = "Mobile-Pets";
                goto IL_6FD;
            }
            uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-questmarker-questbang");
            text = "Mobile-QuestExclamationIcon";
IL_6FD:
            if (!this.m_showLootIconInsteadOfMain)
            {
                if (text != null)
                {
                    this.m_main.sprite = Resources.Load <Sprite>("NewWorldQuest/" + text);
                }
                else if (uitextureAtlasMemberID > 0)
                {
                    this.m_main.sprite = TextureAtlas.instance.GetAtlasSprite(uitextureAtlasMemberID);
                    this.m_main.SetNativeSize();
                }
            }
        }
Exemplo n.º 10
0
        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);
                }
            }
        }
Exemplo n.º 11
0
 private void Start()
 {
     this.m_characterName.font  = GeneralHelpers.LoadStandardFont();
     this.m_characterLevel.font = GeneralHelpers.LoadStandardFont();
     this.m_subtext.font        = GeneralHelpers.LoadStandardFont();
 }
        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 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);
            }
        }
Exemplo n.º 14
0
        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);
                            }
                        }
                    }
                }
            }
        }