public void SetQuestID(int questID) { Color color; this.m_questID = questID; base.gameObject.name = string.Concat("WorldQuest ", this.m_questID); if (!WorldQuestData.WorldQuestDictionary.ContainsKey(this.m_questID)) { return; } WrapperWorldQuest item = WorldQuestData.WorldQuestDictionary[this.m_questID]; if (item.Items == null) { return; } this.m_quantityArea.gameObject.SetActive(false); bool flag = false; foreach (WrapperWorldQuestReward wrapperWorldQuestReward in item.Items) { ItemRec record = StaticDB.itemDB.GetRecord(wrapperWorldQuestReward.RecordID); if (record != null) { flag = true; if (record.OverallQualityID > (int)this.m_lootQuality) { this.m_lootQuality = (ITEM_QUALITY)record.OverallQualityID; } if (!this.m_showLootIconInsteadOfMain) { continue; } StaticDB.itemEffectDB.GetRecordsByParentID(wrapperWorldQuestReward.RecordID).SelectMany <ItemEffectRec, SpellEffectRec>((ItemEffectRec itemEffectRec) => StaticDB.spellEffectDB.GetRecordsByParentID(itemEffectRec.SpellID)).FirstOrDefault <SpellEffectRec>((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(); } else { Debug.LogWarning(string.Concat(new object[] { "Invalid Item ID ", wrapperWorldQuestReward.RecordID, " from Quest ID ", this.m_questID, ". Ignoring for loot quality check." })); } } if (!flag && this.m_showLootIconInsteadOfMain) { if (item.Currencies.Count > 0) { foreach (WrapperWorldQuestReward currency in item.Currencies) { if (StaticDB.currencyTypesDB.GetRecord(currency.RecordID) != null) { this.m_main.sprite = CurrencyContainerDB.LoadCurrencyContainerIcon(currency.RecordID, currency.Quantity); CurrencyContainerRec currencyContainerRec = CurrencyContainerDB.CheckAndGetValidCurrencyContainer(currency.RecordID, currency.Quantity); if (currencyContainerRec != null) { this.m_lootQuality = (ITEM_QUALITY)currencyContainerRec.ContainerQuality; } } if (!AdventureMapPanel.instance.IsFilterEnabled(MapFilterType.OrderResources)) { continue; } this.m_quantityArea.gameObject.SetActive(true); this.m_quantity.text = currency.Quantity.ToString(); } } else if (item.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.Concat(string.Empty, item.Money / 100 / 100); } } else if (item.Experience > 0) { this.m_main.sprite = GeneralHelpers.GetLocalizedFollowerXpIcon(); } } this.m_endTime = item.EndTime; int areaID = 0; WorldMapAreaRec worldMapAreaRec = StaticDB.worldMapAreaDB.GetRecord(item.WorldMapAreaID); if (worldMapAreaRec != null) { areaID = worldMapAreaRec.AreaID; } this.m_areaID = areaID; QuestInfoRec questInfoRec = StaticDB.questInfoDB.GetRecord(item.QuestInfoID); if (questInfoRec == null) { return; } bool modifiers = (questInfoRec.Modifiers & 2) != 0; this.m_dragonFrame.gameObject.SetActive(modifiers); bool type = questInfoRec.Type == 7; this.m_normalGlow.gameObject.SetActive(!type); if (this.m_lootQuality < ITEM_QUALITY.STANDARD) { this.m_normalGlow.color = this.WORLD_QUEST_GLOW_COLOR_DEFAULT; } if (this.m_lootQuality > ITEM_QUALITY.STANDARD && ColorUtility.TryParseHtmlString(string.Concat("#", GeneralHelpers.GetItemQualityColor((int)this.m_lootQuality)), out color)) { this.m_normalGlow.color = color; } this.m_legionAssaultGlow.gameObject.SetActive(type); if ((questInfoRec.Modifiers & 1) != 0 && questInfoRec.Type != 3) { this.m_background.sprite = Resources.Load <Sprite>("NewWorldQuest/Mobile-RareQuest"); } if ((questInfoRec.Modifiers & 4) != 0 && questInfoRec.Type != 3) { this.m_background.sprite = Resources.Load <Sprite>("NewWorldQuest/Mobile-EpicQuest"); } int uITextureAtlasMemberID = 0; string str = null; switch (questInfoRec.Type) { case 1: { int profession = questInfoRec.Profession; switch (profession) { case 182: { uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-herbalism"); str = "Mobile-Herbalism"; break; } case 185: { uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-cooking"); str = "Mobile-Cooking"; break; } case 186: { uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-mining"); str = "Mobile-Mining"; break; } default: { if (profession == 164) { uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-blacksmithing"); str = "Mobile-Blacksmithing"; break; } else if (profession == 165) { uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-leatherworking"); str = "Mobile-Leatherworking"; break; } else if (profession == 129) { uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-firstaid"); str = "Mobile-FirstAid"; break; } else if (profession == 171) { uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-alchemy"); str = "Mobile-Alchemy"; break; } else if (profession == 197) { uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-tailoring"); str = "Mobile-Tailoring"; break; } else if (profession == 202) { uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-engineering"); str = "Mobile-Engineering"; break; } else if (profession == 333) { uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-enchanting"); str = "Mobile-Enchanting"; break; } else if (profession == 356) { uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-fishing"); str = "Mobile-Fishing"; break; } else if (profession == 393) { uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-skinning"); str = "Mobile-Skinning"; break; } else if (profession == 755) { uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-jewelcrafting"); str = "Mobile-Jewelcrafting"; break; } else if (profession == 773) { uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-inscription"); str = "Mobile-Inscription"; break; } else if (profession == 794) { uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-archaeology"); str = "Mobile-Archaeology"; break; } else { uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-questmarker-questbang"); str = "Mobile-QuestExclamationIcon"; break; } } } break; } case 2: { uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-questmarker-questbang"); str = "Mobile-QuestExclamationIcon"; break; } case 3: { uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-pvp-ffa"); str = "Mobile-PVP"; break; } case 4: { uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-petbattle"); str = "Mobile-Pets"; break; } default: { goto case 2; } } if (!this.m_showLootIconInsteadOfMain) { if (str != null) { this.m_main.sprite = Resources.Load <Sprite>(string.Concat("NewWorldQuest/", str)); } else if (uITextureAtlasMemberID > 0) { this.m_main.sprite = TextureAtlas.instance.GetAtlasSprite(uITextureAtlasMemberID); this.m_main.SetNativeSize(); } } }
public void ShowMissionResults(int garrMissionID, int missionResultType, bool awardOvermax) { int num; GarrMissionRec record = StaticDB.garrMissionDB.GetRecord(garrMissionID); if (record == null) { return; } this.RegisterMainScriptObjEvents(); this.m_missionResultsDisplayCanvasGroupAutoFadeOut.Reset(); this.m_currentResultType = (MissionResultType)missionResultType; this.m_followerExperienceDisplayArea.SetActive(false); this.m_attemptedAutoComplete = false; this.m_garrMissionID = garrMissionID; this.m_darknessBG.SetActive(true); this.m_popupView.SetActive(true); this.m_bonusLootDisplay.SetActive(false); if (this.missionFollowerSlotGroup != null) { MissionFollowerSlot[] componentsInChildren = this.missionFollowerSlotGroup.GetComponentsInChildren <MissionFollowerSlot>(true); for (int i = 0; i < (int)componentsInChildren.Length; i++) { if (componentsInChildren[i] != null && componentsInChildren[i] != this.missionFollowerSlotGroup.transform) { componentsInChildren[i].gameObject.transform.SetParent(null); UnityEngine.Object.Destroy(componentsInChildren[i].gameObject); } } } MissionEncounter[] missionEncounterArray = this.enemyPortraitsGroup.GetComponentsInChildren <MissionEncounter>(true); for (int j = 0; j < (int)missionEncounterArray.Length; j++) { if (missionEncounterArray[j] != null && missionEncounterArray[j] != this.enemyPortraitsGroup.transform) { missionEncounterArray[j].gameObject.transform.SetParent(null); UnityEngine.Object.Destroy(missionEncounterArray[j].gameObject); } } if (this.treasureChestHorde != null && this.treasureChestAlliance != null) { if (GarrisonStatus.Faction() != PVP_FACTION.HORDE) { this.treasureChestHorde.SetActive(false); this.treasureChestAlliance.SetActive(true); } else { this.treasureChestHorde.SetActive(true); this.treasureChestAlliance.SetActive(false); } } WrapperGarrisonMission item = PersistentMissionData.missionDictionary[garrMissionID]; this.m_missionStartedTime = item.StartTime; this.m_missionDurationInSeconds = item.MissionDuration; for (int k = 0; k < item.Encounters.Count; k++) { GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(this.missionEncounterPrefab); gameObject.transform.SetParent(this.enemyPortraitsGroup.transform, false); MissionEncounter component = gameObject.GetComponent <MissionEncounter>(); num = (item.Encounters[k].MechanicIDs.Count <= 0 ? 0 : item.Encounters[k].MechanicIDs[0]); component.SetEncounter(item.Encounters[k].EncounterID, num); } this.missionNameText.text = record.Name; this.missionLocationText.text = record.Location; GarrMissionTypeRec garrMissionTypeRec = StaticDB.garrMissionTypeDB.GetRecord((int)record.GarrMissionTypeID); this.missionTypeImage.overrideSprite = TextureAtlas.instance.GetAtlasSprite((int)garrMissionTypeRec.UiTextureAtlasMemberID); if (this.missionFollowerSlotGroup != null) { for (int l = 0; (long)l < (ulong)record.MaxFollowers; l++) { GameObject gameObject1 = UnityEngine.Object.Instantiate <GameObject>(this.missionFollowerSlotPrefab); gameObject1.transform.SetParent(this.missionFollowerSlotGroup.transform, false); gameObject1.GetComponent <MissionFollowerSlot>().m_enemyPortraitsGroup = this.enemyPortraitsGroup; } } if (record.UiTextureKitID <= 0) { Debug.LogWarning(string.Concat(new object[] { "DATA ERROR: Mission UITextureKit Not Set for mission ID:", record.ID, " - ", record.Name })); Debug.LogWarning("This means the scrolling background images will show the wrong location"); } else { UiTextureKitRec uiTextureKitRec = StaticDB.uiTextureKitDB.GetRecord((int)record.UiTextureKitID); this.m_scrollingEnvironment_Back.enabled = false; this.m_scrollingEnvironment_Mid.enabled = false; this.m_scrollingEnvironment_Fore.enabled = false; int uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID(string.Concat("_", uiTextureKitRec.KitPrefix, "-Back")); if (uITextureAtlasMemberID > 0) { Sprite atlasSprite = TextureAtlas.instance.GetAtlasSprite(uITextureAtlasMemberID); if (atlasSprite == null) { uint uiTextureKitID = record.UiTextureKitID; Debug.Log(string.Concat("Missing expected Back sprite from UiTextureKitID: [", uiTextureKitID.ToString(), "]")); } else { this.m_scrollingEnvironment_Back.enabled = true; this.m_scrollingEnvironment_Back.sprite = atlasSprite; } } int uITextureAtlasMemberID1 = TextureAtlas.GetUITextureAtlasMemberID(string.Concat("_", uiTextureKitRec.KitPrefix, "-Mid")); if (uITextureAtlasMemberID1 > 0) { Sprite sprite = TextureAtlas.instance.GetAtlasSprite(uITextureAtlasMemberID1); if (sprite == null) { uint uiTextureKitID1 = record.UiTextureKitID; Debug.Log(string.Concat("Missing expected Mid sprite from UiTextureKitID: [", uiTextureKitID1.ToString(), "]")); } else { this.m_scrollingEnvironment_Mid.enabled = true; this.m_scrollingEnvironment_Mid.sprite = sprite; } } int num1 = TextureAtlas.GetUITextureAtlasMemberID(string.Concat("_", uiTextureKitRec.KitPrefix, "-Fore")); if (num1 > 0) { Sprite atlasSprite1 = TextureAtlas.instance.GetAtlasSprite(num1); if (atlasSprite1 == null) { uint uiTextureKitID2 = record.UiTextureKitID; Debug.Log(string.Concat("Missing expected Fore sprite from UiTextureKitID: [", uiTextureKitID2.ToString(), "]")); } else { this.m_scrollingEnvironment_Fore.enabled = true; this.m_scrollingEnvironment_Fore.sprite = atlasSprite1; } } } if (this.m_lootGroupObj == null || this.m_missionRewardDisplayPrefab == null) { return; } MissionRewardDisplay[] missionRewardDisplayArray = this.m_lootGroupObj.GetComponentsInChildren <MissionRewardDisplay>(true); for (int m = 0; m < (int)missionRewardDisplayArray.Length; m++) { if (missionRewardDisplayArray[m] != null) { UnityEngine.Object.Destroy(missionRewardDisplayArray[m].gameObject); } } if (missionResultType == 1) { PersistentFollowerData.ClearPreMissionFollowerData(); } List <WrapperGarrisonFollower> wrapperGarrisonFollowers = new List <WrapperGarrisonFollower>(); MissionFollowerSlot[] missionFollowerSlotArray = this.missionFollowerSlotGroup.GetComponentsInChildren <MissionFollowerSlot>(true); int num2 = 0; foreach (WrapperGarrisonFollower value in PersistentFollowerData.followerDictionary.Values) { if (value.CurrentMissionID != garrMissionID) { continue; } int num3 = num2; num2 = num3 + 1; missionFollowerSlotArray[num3].SetFollower(value.GarrFollowerID); if (missionResultType == 1) { PersistentFollowerData.CachePreMissionFollower(value); } wrapperGarrisonFollowers.Add(value); } this.UpdateMissionStatus(garrMissionID); MissionFollowerSlot[] missionFollowerSlotArray1 = missionFollowerSlotArray; for (int n = 0; n < (int)missionFollowerSlotArray1.Length; n++) { missionFollowerSlotArray1[n].InitHeartPanel(); } MissionRewardDisplay.InitMissionRewards(this.m_missionRewardDisplayPrefab.gameObject, this.m_lootGroupObj.transform, item.Rewards); if (record.OvermaxRewardPackID > 0 && item.OvermaxRewards.Count > 0) { this.m_bonusLootDisplay.SetActive(true); WrapperGarrisonMissionReward wrapperGarrisonMissionReward = item.OvermaxRewards[0]; if (wrapperGarrisonMissionReward.ItemID > 0) { this.m_bonusMissionRewardDisplay.InitReward(MissionRewardDisplay.RewardType.item, wrapperGarrisonMissionReward.ItemID, (int)wrapperGarrisonMissionReward.ItemQuantity, 0, wrapperGarrisonMissionReward.ItemFileDataID); } else if (wrapperGarrisonMissionReward.FollowerXP > 0) { this.m_bonusMissionRewardDisplay.InitReward(MissionRewardDisplay.RewardType.followerXP, 0, (int)wrapperGarrisonMissionReward.FollowerXP, 0, 0); } else if (wrapperGarrisonMissionReward.CurrencyQuantity > 0) { if (wrapperGarrisonMissionReward.CurrencyType != 0) { CurrencyTypesRec currencyTypesRec = StaticDB.currencyTypesDB.GetRecord(wrapperGarrisonMissionReward.CurrencyType); int currencyQuantity = (int)((ulong)wrapperGarrisonMissionReward.CurrencyQuantity / (long)(((currencyTypesRec.Flags & 8) == 0 ? 1 : 100))); this.m_bonusMissionRewardDisplay.InitReward(MissionRewardDisplay.RewardType.currency, wrapperGarrisonMissionReward.CurrencyType, currencyQuantity, 0, 0); } else { this.m_bonusMissionRewardDisplay.InitReward(MissionRewardDisplay.RewardType.gold, 0, (int)(wrapperGarrisonMissionReward.CurrencyQuantity / 10000), 0, 0); } } } this.m_timeUntilFadeOutMissionDetailsDisplay = this.m_missionDetailsFadeOutDelay; this.m_timeUntilShowFollowerExperienceDisplays = this.m_experienceDisplayInitialEntranceDelay; if (missionResultType == 2) { this.InitFollowerExperienceDisplays(); this.m_missionInProgressMessage.SetActive(false); this.m_missionSuccessMessage.SetActive(true); this.m_missionFailMessage.SetActive(false); if (this.m_fancyEntrance != null) { UnityEngine.Object.Destroy(this.m_fancyEntrance); iTween.Stop(this.m_missionSuccessMessage); this.m_missionSuccessMessage.transform.localScale = Vector3.one; iTween.Stop(this.m_missionFailMessage); this.m_missionFailMessage.transform.localScale = Vector3.one; } this.m_missionSuccessMessage.SetActive(false); this.m_fancyEntrance = this.m_missionSuccessMessage.AddComponent <FancyEntrance>(); this.m_fancyEntrance.m_fadeInCanvasGroup = this.m_missionSuccessMessage.GetComponent <CanvasGroup>(); this.m_fancyEntrance.m_fadeInTime = this.m_messageFadeInTime; this.m_fancyEntrance.m_punchScale = this.m_messagePunchScale; this.m_fancyEntrance.m_punchScaleAmount = this.m_messagePunchScaleAmount; this.m_fancyEntrance.m_punchScaleDuration = this.m_messagePunchScaleDuration; this.m_fancyEntrance.m_timeToDelayEntrance = this.m_messageTimeToDelayEntrance; this.m_fancyEntrance.m_activateOnEnable = true; this.m_fancyEntrance.m_objectToNotifyOnBegin = base.gameObject; this.m_fancyEntrance.m_notifyOnBeginCallbackName = "OnShowSuccessMessage"; this.m_missionSuccessMessage.SetActive(true); MissionRewardDisplay[] componentsInChildren1 = this.m_lootGroupObj.GetComponentsInChildren <MissionRewardDisplay>(true); for (int o = 0; o < (int)componentsInChildren1.Length; o++) { componentsInChildren1[o].ShowResultSuccess(this.m_lootEffectInitialDelay + this.m_lootEffectDelay * (float)o); } if (this.m_bonusLootChance > 0) { iTween.ValueTo(base.gameObject, iTween.Hash(new object[] { "name", "ShakeIt", "from", 0.3f, "to", 1f, "delay", this.m_bonusLootShakeInitialDelay, "time", this.m_bonusLootShakeDuration, "onupdate", "OnBonusLootShakeUpdate", "oncomplete", "OnBonusLootShakeComplete" })); } if (!awardOvermax) { this.m_bonusMissionRewardDisplay.ShowResultFail(this.m_lootEffectInitialDelay + this.m_lootEffectDelay * (float)((int)componentsInChildren1.Length)); } else { this.m_bonusMissionRewardDisplay.ShowResultSuccess(this.m_lootEffectInitialDelay + this.m_lootEffectDelay * (float)((int)componentsInChildren1.Length)); } } if (missionResultType == 3) { this.InitFollowerExperienceDisplays(); this.m_missionInProgressMessage.SetActive(false); this.m_missionSuccessMessage.SetActive(false); this.m_missionFailMessage.SetActive(true); if (this.m_fancyEntrance != null) { UnityEngine.Object.Destroy(this.m_fancyEntrance); iTween.Stop(this.m_missionSuccessMessage); this.m_missionSuccessMessage.transform.localScale = Vector3.one; iTween.Stop(this.m_missionFailMessage); this.m_missionFailMessage.transform.localScale = Vector3.one; } this.m_missionFailMessage.SetActive(false); this.m_fancyEntrance = this.m_missionFailMessage.AddComponent <FancyEntrance>(); this.m_fancyEntrance.m_fadeInCanvasGroup = this.m_missionFailMessage.GetComponent <CanvasGroup>(); this.m_fancyEntrance.m_fadeInTime = this.m_messageFadeInTime; this.m_fancyEntrance.m_punchScale = this.m_messagePunchScale; this.m_fancyEntrance.m_punchScaleAmount = this.m_messagePunchScaleAmount; this.m_fancyEntrance.m_punchScaleDuration = this.m_messagePunchScaleDuration; this.m_fancyEntrance.m_timeToDelayEntrance = this.m_messageTimeToDelayEntrance; this.m_fancyEntrance.m_activateOnEnable = true; this.m_fancyEntrance.m_objectToNotifyOnBegin = base.gameObject; this.m_fancyEntrance.m_notifyOnBeginCallbackName = "OnShowFailMessage"; this.m_missionFailMessage.SetActive(true); MissionRewardDisplay[] missionRewardDisplayArray1 = this.m_lootGroupObj.GetComponentsInChildren <MissionRewardDisplay>(true); for (int p = 0; p < (int)missionRewardDisplayArray1.Length; p++) { missionRewardDisplayArray1[p].ShowResultFail(this.m_lootEffectInitialDelay); } this.m_bonusMissionRewardDisplay.ShowResultFail(this.m_lootEffectInitialDelay); } if (missionResultType == 0) { this.m_missionInProgressMessage.SetActive(true); this.m_missionSuccessMessage.SetActive(false); this.m_missionFailMessage.SetActive(false); this.m_bonusMissionRewardDisplay.ClearResults(); } if (missionResultType == 1) { this.m_missionInProgressMessage.SetActive(false); this.m_missionSuccessMessage.SetActive(false); this.m_missionFailMessage.SetActive(false); FollowerExperienceDisplay[] followerExperienceDisplayArray = this.m_followerExperienceDisplayArea.GetComponentsInChildren <FollowerExperienceDisplay>(true); for (int q = 0; q < (int)followerExperienceDisplayArray.Length; q++) { UnityEngine.Object.Destroy(followerExperienceDisplayArray[q].gameObject); } } if (this.m_partyBuffGroup == null) { return; } AbilityDisplay[] abilityDisplayArray = this.m_partyBuffGroup.GetComponentsInChildren <AbilityDisplay>(true); for (int r = 0; r < (int)abilityDisplayArray.Length; r++) { UnityEngine.Object.Destroy(abilityDisplayArray[r].gameObject); } int adjustedMissionDuration = GeneralHelpers.GetAdjustedMissionDuration(record, wrapperGarrisonFollowers, this.enemyPortraitsGroup); int length = 0; foreach (WrapperGarrisonFollower wrapperGarrisonFollower in PersistentFollowerData.followerDictionary.Values) { if (wrapperGarrisonFollower.CurrentMissionID == garrMissionID) { int[] buffsForCurrentMission = GeneralHelpers.GetBuffsForCurrentMission(wrapperGarrisonFollower.GarrFollowerID, garrMissionID, this.missionFollowerSlotGroup, adjustedMissionDuration); length += (int)buffsForCurrentMission.Length; int[] numArray = buffsForCurrentMission; for (int s = 0; s < (int)numArray.Length; s++) { int num4 = numArray[s]; GameObject gameObject2 = UnityEngine.Object.Instantiate <GameObject>(this.m_mechanicEffectDisplayPrefab); gameObject2.transform.SetParent(this.m_partyBuffGroup.transform, false); gameObject2.GetComponent <AbilityDisplay>().SetAbility(num4, false, false, null); } } } if (length <= 8) { this.m_partyBuffsText.text = StaticDB.GetString("PARTY_BUFFS", null); } else { this.m_partyBuffsText.text = string.Empty; } HorizontalLayoutGroup horizontalLayoutGroup = this.m_partyBuffGroup.GetComponent <HorizontalLayoutGroup>(); if (horizontalLayoutGroup != null) { if (length <= 10 || !Main.instance.IsNarrowScreen()) { horizontalLayoutGroup.spacing = 6f; } else { horizontalLayoutGroup.spacing = 3f; } } this.m_partyBuffGroup.SetActive(length > 0); }
public void SetMission(WrapperGarrisonMission mission) { this.m_statusDarkener.gameObject.SetActive(false); this.m_statusText.gameObject.SetActive(false); this.m_mission = mission; GarrMissionRec record = StaticDB.garrMissionDB.GetRecord(mission.MissionRecID); if (record == null) { return; } if (this.m_missionTypeIcon != null) { GarrMissionTypeRec record2 = StaticDB.garrMissionTypeDB.GetRecord((int)record.GarrMissionTypeID); this.m_missionTypeIcon.sprite = TextureAtlas.instance.GetAtlasSprite((int)record2.UiTextureAtlasMemberID); } bool flag = false; if (mission.MissionState == 1) { flag = true; this.m_statusDarkener.gameObject.SetActive(true); this.m_statusDarkener.color = new Color(0f, 0f, 0f, 0.3529412f); this.m_statusText.gameObject.SetActive(true); this.m_missionTime.gameObject.SetActive(false); } this.m_previewMechanicsGroup.SetActive(!flag); int uncounteredMissionDuration = this.GetUncounteredMissionDuration(mission); Duration duration = new Duration(uncounteredMissionDuration, false); string str; if (duration.DurationValue >= 28800) { str = "<color=#ff8600ff>" + duration.DurationString + "</color>"; } else { str = "<color=#BEBEBEFF>" + duration.DurationString + "</color>"; } this.m_missionTime.text = "(" + str + ")"; this.m_missionName.text = record.Name; if (this.m_missionLevel != null) { if (record.TargetLevel < 110) { this.m_missionLevel.text = string.Empty + record.TargetLevel; } else { this.m_missionLevel.text = string.Concat(new object[] { string.Empty, record.TargetLevel, "\n(", record.TargetItemLevel, ")" }); } } bool flag2 = (record.Flags & 1u) != 0u; this.m_expirationText.gameObject.SetActive(flag2); this.m_rareMissionLabel.gameObject.SetActive(flag2); this.m_rareMissionHighlight.gameObject.SetActive(flag2); if (flag2) { this.m_missionTypeBG.color = new Color(0f, 0f, 1f, 0.24f); } else { this.m_missionTypeBG.color = new Color(0f, 0f, 0f, 0.478f); } this.m_missionLocation.enabled = false; UiTextureKitRec record3 = StaticDB.uiTextureKitDB.GetRecord((int)record.UiTextureKitID); if (record3 != null) { int uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID(record3.KitPrefix + "-List"); if (uitextureAtlasMemberID > 0) { Sprite atlasSprite = TextureAtlas.instance.GetAtlasSprite(uitextureAtlasMemberID); if (atlasSprite != null) { this.m_missionLocation.enabled = true; this.m_missionLocation.sprite = atlasSprite; } } } this.UpdateMechanicPreview(flag, mission); MissionRewardDisplay[] componentsInChildren = this.m_previewLootGroup.GetComponentsInChildren <MissionRewardDisplay>(true); for (int i = 0; i < componentsInChildren.Length; i++) { if (componentsInChildren[i] != null) { componentsInChildren[i].gameObject.transform.SetParent(null); Object.Destroy(componentsInChildren[i].gameObject); } } MissionRewardDisplay.InitMissionRewards(this.m_missionRewardDisplayPrefab.gameObject, this.m_previewLootGroup.transform, mission.Rewards); }
public void ShowMissionResults(int garrMissionID, int missionResultType, bool awardOvermax) { GarrMissionRec record = StaticDB.garrMissionDB.GetRecord(garrMissionID); if (record == null) { return; } this.m_missionResultsDisplayCanvasGroupAutoFadeOut.Reset(); this.m_currentResultType = (MissionResultType)missionResultType; this.m_followerExperienceDisplayArea.SetActive(false); this.m_attemptedAutoComplete = false; this.m_garrMissionID = garrMissionID; this.m_darknessBG.SetActive(true); this.m_popupView.SetActive(true); this.m_bonusLootDisplay.SetActive(false); if (this.missionFollowerSlotGroup != null) { MissionFollowerSlot[] componentsInChildren = this.missionFollowerSlotGroup.GetComponentsInChildren <MissionFollowerSlot>(true); for (int i = 0; i < componentsInChildren.Length; i++) { if (componentsInChildren[i] != null && componentsInChildren[i] != this.missionFollowerSlotGroup.transform) { componentsInChildren[i].gameObject.transform.SetParent(null); Object.Destroy(componentsInChildren[i].gameObject); } } } MissionEncounter[] componentsInChildren2 = this.enemyPortraitsGroup.GetComponentsInChildren <MissionEncounter>(true); for (int j = 0; j < componentsInChildren2.Length; j++) { if (componentsInChildren2[j] != null && componentsInChildren2[j] != this.enemyPortraitsGroup.transform) { componentsInChildren2[j].gameObject.transform.SetParent(null); Object.Destroy(componentsInChildren2[j].gameObject); } } if (this.treasureChestHorde != null && this.treasureChestAlliance != null) { if (GarrisonStatus.Faction() == PVP_FACTION.HORDE) { this.treasureChestHorde.SetActive(true); this.treasureChestAlliance.SetActive(false); } else { this.treasureChestHorde.SetActive(false); this.treasureChestAlliance.SetActive(true); } } WrapperGarrisonMission wrapperGarrisonMission = PersistentMissionData.missionDictionary[garrMissionID]; this.m_missionStartedTime = wrapperGarrisonMission.StartTime; this.m_missionDurationInSeconds = wrapperGarrisonMission.MissionDuration; for (int k = 0; k < wrapperGarrisonMission.Encounters.Count; k++) { GameObject gameObject = Object.Instantiate <GameObject>(this.missionEncounterPrefab); gameObject.transform.SetParent(this.enemyPortraitsGroup.transform, false); MissionEncounter component = gameObject.GetComponent <MissionEncounter>(); int garrMechanicID = (wrapperGarrisonMission.Encounters[k].MechanicIDs.Count <= 0) ? 0 : wrapperGarrisonMission.Encounters[k].MechanicIDs[0]; component.SetEncounter(wrapperGarrisonMission.Encounters[k].EncounterID, garrMechanicID); } this.missionNameText.text = record.Name; this.missionLocationText.text = record.Location; GarrMissionTypeRec record2 = StaticDB.garrMissionTypeDB.GetRecord((int)record.GarrMissionTypeID); this.missionTypeImage.overrideSprite = TextureAtlas.instance.GetAtlasSprite((int)record2.UiTextureAtlasMemberID); if (this.missionFollowerSlotGroup != null) { for (int l = 0; l < (int)record.MaxFollowers; l++) { GameObject gameObject2 = Object.Instantiate <GameObject>(this.missionFollowerSlotPrefab); gameObject2.transform.SetParent(this.missionFollowerSlotGroup.transform, false); MissionFollowerSlot component2 = gameObject2.GetComponent <MissionFollowerSlot>(); component2.m_enemyPortraitsGroup = this.enemyPortraitsGroup; } } if (record.UiTextureKitID > 0) { UiTextureKitRec record3 = StaticDB.uiTextureKitDB.GetRecord((int)record.UiTextureKitID); this.m_scrollingEnvironment_Back.enabled = false; this.m_scrollingEnvironment_Mid.enabled = false; this.m_scrollingEnvironment_Fore.enabled = false; int uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("_" + record3.KitPrefix + "-Back"); if (uitextureAtlasMemberID > 0) { Sprite atlasSprite = TextureAtlas.instance.GetAtlasSprite(uitextureAtlasMemberID); if (atlasSprite != null) { this.m_scrollingEnvironment_Back.enabled = true; this.m_scrollingEnvironment_Back.sprite = atlasSprite; } else { Debug.Log("Missing expected Back sprite from UiTextureKitID: [" + record.UiTextureKitID.ToString() + "]"); } } int uitextureAtlasMemberID2 = TextureAtlas.GetUITextureAtlasMemberID("_" + record3.KitPrefix + "-Mid"); if (uitextureAtlasMemberID2 > 0) { Sprite atlasSprite2 = TextureAtlas.instance.GetAtlasSprite(uitextureAtlasMemberID2); if (atlasSprite2 != null) { this.m_scrollingEnvironment_Mid.enabled = true; this.m_scrollingEnvironment_Mid.sprite = atlasSprite2; } else { Debug.Log("Missing expected Mid sprite from UiTextureKitID: [" + record.UiTextureKitID.ToString() + "]"); } } int uitextureAtlasMemberID3 = TextureAtlas.GetUITextureAtlasMemberID("_" + record3.KitPrefix + "-Fore"); if (uitextureAtlasMemberID3 > 0) { Sprite atlasSprite3 = TextureAtlas.instance.GetAtlasSprite(uitextureAtlasMemberID3); if (atlasSprite3 != null) { this.m_scrollingEnvironment_Fore.enabled = true; this.m_scrollingEnvironment_Fore.sprite = atlasSprite3; } else { Debug.Log("Missing expected Fore sprite from UiTextureKitID: [" + record.UiTextureKitID.ToString() + "]"); } } } else { Debug.LogWarning(string.Concat(new object[] { "DATA ERROR: Mission UITextureKit Not Set for mission ID:", record.ID, " - ", record.Name })); Debug.LogWarning("This means the scrolling background images will show the wrong location"); } if (this.m_lootGroupObj == null || this.m_missionRewardDisplayPrefab == null) { return; } MissionRewardDisplay[] componentsInChildren3 = this.m_lootGroupObj.GetComponentsInChildren <MissionRewardDisplay>(true); for (int m = 0; m < componentsInChildren3.Length; m++) { if (componentsInChildren3[m] != null) { Object.Destroy(componentsInChildren3[m].gameObject); } } if (missionResultType == 1) { PersistentFollowerData.ClearPreMissionFollowerData(); } List <WrapperGarrisonFollower> list = new List <WrapperGarrisonFollower>(); MissionFollowerSlot[] componentsInChildren4 = this.missionFollowerSlotGroup.GetComponentsInChildren <MissionFollowerSlot>(true); int num = 0; foreach (WrapperGarrisonFollower wrapperGarrisonFollower in PersistentFollowerData.followerDictionary.Values) { if (wrapperGarrisonFollower.CurrentMissionID == garrMissionID) { componentsInChildren4[num++].SetFollower(wrapperGarrisonFollower.GarrFollowerID); if (missionResultType == 1) { PersistentFollowerData.CachePreMissionFollower(wrapperGarrisonFollower); } list.Add(wrapperGarrisonFollower); } } this.UpdateMissionStatus(garrMissionID); foreach (MissionFollowerSlot missionFollowerSlot in componentsInChildren4) { missionFollowerSlot.InitHeartPanel(); } MissionRewardDisplay.InitMissionRewards(this.m_missionRewardDisplayPrefab.gameObject, this.m_lootGroupObj.transform, wrapperGarrisonMission.Rewards); if (record.OvermaxRewardPackID > 0 && wrapperGarrisonMission.OvermaxRewards.Count > 0) { this.m_bonusLootDisplay.SetActive(true); WrapperGarrisonMissionReward wrapperGarrisonMissionReward = wrapperGarrisonMission.OvermaxRewards[0]; if (wrapperGarrisonMissionReward.ItemID > 0) { this.m_bonusMissionRewardDisplay.InitReward(MissionRewardDisplay.RewardType.item, wrapperGarrisonMissionReward.ItemID, (int)wrapperGarrisonMissionReward.ItemQuantity, 0, wrapperGarrisonMissionReward.ItemFileDataID); } else if (wrapperGarrisonMissionReward.FollowerXP > 0u) { this.m_bonusMissionRewardDisplay.InitReward(MissionRewardDisplay.RewardType.followerXP, 0, (int)wrapperGarrisonMissionReward.FollowerXP, 0, 0); } else if (wrapperGarrisonMissionReward.CurrencyQuantity > 0u) { if (wrapperGarrisonMissionReward.CurrencyType == 0) { this.m_bonusMissionRewardDisplay.InitReward(MissionRewardDisplay.RewardType.gold, 0, (int)(wrapperGarrisonMissionReward.CurrencyQuantity / 10000u), 0, 0); } else { CurrencyTypesRec record4 = StaticDB.currencyTypesDB.GetRecord(wrapperGarrisonMissionReward.CurrencyType); int rewardQuantity = (int)((ulong)wrapperGarrisonMissionReward.CurrencyQuantity / (ulong)(((record4.Flags & 8u) == 0u) ? 1L : 100L)); this.m_bonusMissionRewardDisplay.InitReward(MissionRewardDisplay.RewardType.currency, wrapperGarrisonMissionReward.CurrencyType, rewardQuantity, 0, 0); } } } this.m_timeUntilFadeOutMissionDetailsDisplay = this.m_missionDetailsFadeOutDelay; this.m_timeUntilShowFollowerExperienceDisplays = this.m_experienceDisplayInitialEntranceDelay; if (missionResultType == 2) { this.InitFollowerExperienceDisplays(); this.m_missionInProgressMessage.SetActive(false); this.m_missionSuccessMessage.SetActive(true); this.m_missionFailMessage.SetActive(false); if (this.m_fancyEntrance != null) { Object.Destroy(this.m_fancyEntrance); iTween.Stop(this.m_missionSuccessMessage); this.m_missionSuccessMessage.transform.localScale = Vector3.one; iTween.Stop(this.m_missionFailMessage); this.m_missionFailMessage.transform.localScale = Vector3.one; } this.m_missionSuccessMessage.SetActive(false); this.m_fancyEntrance = this.m_missionSuccessMessage.AddComponent <FancyEntrance>(); this.m_fancyEntrance.m_fadeInCanvasGroup = this.m_missionSuccessMessage.GetComponent <CanvasGroup>(); this.m_fancyEntrance.m_fadeInTime = this.m_messageFadeInTime; this.m_fancyEntrance.m_punchScale = this.m_messagePunchScale; this.m_fancyEntrance.m_punchScaleAmount = this.m_messagePunchScaleAmount; this.m_fancyEntrance.m_punchScaleDuration = this.m_messagePunchScaleDuration; this.m_fancyEntrance.m_timeToDelayEntrance = this.m_messageTimeToDelayEntrance; this.m_fancyEntrance.m_activateOnEnable = true; this.m_fancyEntrance.m_objectToNotifyOnBegin = base.gameObject; this.m_fancyEntrance.m_notifyOnBeginCallbackName = "OnShowSuccessMessage"; this.m_missionSuccessMessage.SetActive(true); MissionRewardDisplay[] componentsInChildren5 = this.m_lootGroupObj.GetComponentsInChildren <MissionRewardDisplay>(true); for (int num2 = 0; num2 < componentsInChildren5.Length; num2++) { componentsInChildren5[num2].ShowResultSuccess(this.m_lootEffectInitialDelay + this.m_lootEffectDelay * (float)num2); } if (this.m_bonusLootChance > 0) { iTween.ValueTo(base.gameObject, iTween.Hash(new object[] { "name", "ShakeIt", "from", 0.3f, "to", 1f, "delay", this.m_bonusLootShakeInitialDelay, "time", this.m_bonusLootShakeDuration, "onupdate", "OnBonusLootShakeUpdate", "oncomplete", "OnBonusLootShakeComplete" })); } if (awardOvermax) { this.m_bonusMissionRewardDisplay.ShowResultSuccess(this.m_lootEffectInitialDelay + this.m_lootEffectDelay * (float)componentsInChildren5.Length); } else { this.m_bonusMissionRewardDisplay.ShowResultFail(this.m_lootEffectInitialDelay + this.m_lootEffectDelay * (float)componentsInChildren5.Length); } } if (missionResultType == 3) { this.InitFollowerExperienceDisplays(); this.m_missionInProgressMessage.SetActive(false); this.m_missionSuccessMessage.SetActive(false); this.m_missionFailMessage.SetActive(true); if (this.m_fancyEntrance != null) { Object.Destroy(this.m_fancyEntrance); iTween.Stop(this.m_missionSuccessMessage); this.m_missionSuccessMessage.transform.localScale = Vector3.one; iTween.Stop(this.m_missionFailMessage); this.m_missionFailMessage.transform.localScale = Vector3.one; } this.m_missionFailMessage.SetActive(false); this.m_fancyEntrance = this.m_missionFailMessage.AddComponent <FancyEntrance>(); this.m_fancyEntrance.m_fadeInCanvasGroup = this.m_missionFailMessage.GetComponent <CanvasGroup>(); this.m_fancyEntrance.m_fadeInTime = this.m_messageFadeInTime; this.m_fancyEntrance.m_punchScale = this.m_messagePunchScale; this.m_fancyEntrance.m_punchScaleAmount = this.m_messagePunchScaleAmount; this.m_fancyEntrance.m_punchScaleDuration = this.m_messagePunchScaleDuration; this.m_fancyEntrance.m_timeToDelayEntrance = this.m_messageTimeToDelayEntrance; this.m_fancyEntrance.m_activateOnEnable = true; this.m_fancyEntrance.m_objectToNotifyOnBegin = base.gameObject; this.m_fancyEntrance.m_notifyOnBeginCallbackName = "OnShowFailMessage"; this.m_missionFailMessage.SetActive(true); MissionRewardDisplay[] componentsInChildren6 = this.m_lootGroupObj.GetComponentsInChildren <MissionRewardDisplay>(true); for (int num3 = 0; num3 < componentsInChildren6.Length; num3++) { componentsInChildren6[num3].ShowResultFail(this.m_lootEffectInitialDelay); } this.m_bonusMissionRewardDisplay.ShowResultFail(this.m_lootEffectInitialDelay); } if (missionResultType == 0) { this.m_missionInProgressMessage.SetActive(true); this.m_missionSuccessMessage.SetActive(false); this.m_missionFailMessage.SetActive(false); this.m_bonusMissionRewardDisplay.ClearResults(); } if (missionResultType == 1) { this.m_missionInProgressMessage.SetActive(false); this.m_missionSuccessMessage.SetActive(false); this.m_missionFailMessage.SetActive(false); FollowerExperienceDisplay[] componentsInChildren7 = this.m_followerExperienceDisplayArea.GetComponentsInChildren <FollowerExperienceDisplay>(true); foreach (FollowerExperienceDisplay followerExperienceDisplay in componentsInChildren7) { Object.Destroy(followerExperienceDisplay.gameObject); } } if (this.m_partyBuffGroup == null) { return; } AbilityDisplay[] componentsInChildren8 = this.m_partyBuffGroup.GetComponentsInChildren <AbilityDisplay>(true); foreach (AbilityDisplay abilityDisplay in componentsInChildren8) { Object.Destroy(abilityDisplay.gameObject); } int adjustedMissionDuration = GeneralHelpers.GetAdjustedMissionDuration(record, list, this.enemyPortraitsGroup); int num6 = 0; foreach (WrapperGarrisonFollower wrapperGarrisonFollower2 in PersistentFollowerData.followerDictionary.Values) { if (wrapperGarrisonFollower2.CurrentMissionID == garrMissionID) { int[] buffsForCurrentMission = GeneralHelpers.GetBuffsForCurrentMission(wrapperGarrisonFollower2.GarrFollowerID, garrMissionID, this.missionFollowerSlotGroup, adjustedMissionDuration); num6 += buffsForCurrentMission.Length; foreach (int garrAbilityID in buffsForCurrentMission) { GameObject gameObject3 = Object.Instantiate <GameObject>(this.m_mechanicEffectDisplayPrefab); gameObject3.transform.SetParent(this.m_partyBuffGroup.transform, false); AbilityDisplay component3 = gameObject3.GetComponent <AbilityDisplay>(); component3.SetAbility(garrAbilityID, false, false, null); } } } if (num6 > 8) { this.m_partyBuffsText.text = string.Empty; } else { this.m_partyBuffsText.text = StaticDB.GetString("PARTY_BUFFS", null); } HorizontalLayoutGroup component4 = this.m_partyBuffGroup.GetComponent <HorizontalLayoutGroup>(); if (component4 != null) { if (num6 > 10 && Main.instance.IsNarrowScreen()) { component4.spacing = 3f; } else { component4.spacing = 6f; } } this.m_partyBuffGroup.SetActive(num6 > 0); }
public void Deserialize(string animName) { UiAnimation.UiTexture uiTexture; UiAnimation.UiAnchor array; XmlSerializer xmlSerializer = new XmlSerializer(typeof(UiAnimation.UiSourceAnimation)); xmlSerializer.UnknownNode += new XmlNodeEventHandler(this.serializer_UnknownNode); xmlSerializer.UnknownAttribute += new XmlAttributeEventHandler(this.serializer_UnknownAttribute); TextAsset sourceData = UiAnimMgr.instance.GetSourceData(animName); if (sourceData == null) { Debug.Log(string.Concat("Could not find asset ", animName)); return; } MemoryStream memoryStream = new MemoryStream(sourceData.bytes); UiAnimation.UiSourceAnimation uiSourceAnimation = xmlSerializer.Deserialize(memoryStream) as UiAnimation.UiSourceAnimation; memoryStream.Close(); if (uiSourceAnimation == null) { Debug.Log("No ui animation."); return; } this.m_frame = uiSourceAnimation.frame; foreach (UiAnimation.UiSourceAnimGroup group in uiSourceAnimation.frame.animation.groups) { UiAnimation.UiAnimGroup uiAnimGroup = new UiAnimation.UiAnimGroup() { m_parentKey = group.parentKey, m_bounceBack = false }; if (group.looping == null) { uiAnimGroup.m_looping = false; uiAnimGroup.m_bounce = false; } else if (group.looping == "REPEAT") { uiAnimGroup.m_looping = true; uiAnimGroup.m_bounce = false; } else if (group.looping == "BOUNCE") { uiAnimGroup.m_looping = true; uiAnimGroup.m_bounce = true; } foreach (UiAnimation.UiScale mScale in group.m_scales) { if (mScale.m_childKey == null) { continue; } mScale.SetSmoothing(); uiAnimGroup.m_elements.Add(mScale); } foreach (UiAnimation.UiAlpha mAlpha in group.m_alphas) { if (mAlpha.m_childKey == null) { continue; } mAlpha.SetSmoothing(); uiAnimGroup.m_elements.Add(mAlpha); } foreach (UiAnimation.UiRotation mRotation in group.m_rotations) { if (mRotation.m_childKey == null) { continue; } mRotation.SetSmoothing(); uiAnimGroup.m_elements.Add(mRotation); } foreach (UiAnimation.UiTranslation mTranslation in group.m_translations) { if (mTranslation.m_childKey == null) { continue; } mTranslation.SetSmoothing(); uiAnimGroup.m_elements.Add(mTranslation); } this.m_groups.Add(uiAnimGroup); } foreach (UiAnimation.UiLayer layer in uiSourceAnimation.frame.layers) { foreach (UiAnimation.UiSourceTexture texture in layer.textures) { if (texture.m_parentKey != null) { this.m_textures.TryGetValue(texture.m_parentKey, out uiTexture); if (uiTexture == null) { int d = 0; UiTextureAtlasMemberRec recordFirstOrDefault = StaticDB.uiTextureAtlasMemberDB.GetRecordFirstOrDefault((UiTextureAtlasMemberRec memberRec) => (memberRec.CommittedName == null || texture.m_atlas == null ? false : memberRec.CommittedName.Equals(texture.m_atlas, StringComparison.OrdinalIgnoreCase))); if (recordFirstOrDefault != null) { d = recordFirstOrDefault.ID; } Sprite sprite = null; if (d > 0) { sprite = TextureAtlas.GetSprite(d); } else if (texture.m_resourceImage != null) { sprite = Resources.Load <Sprite>(texture.m_resourceImage); } if (sprite == null) { Debug.Log(string.Concat(new object[] { "Could not find sprite for textureAtlasMemberID ", d, " resourceImage ", texture.m_resourceImage, " in Ui Animation ", animName })); } else { UiAnimation.UiTexture mAtlas = new UiAnimation.UiTexture() { m_alpha = texture.m_alpha, m_alphaMode = texture.m_alphaMode }; UiAnimation.UiTexture uiTexture1 = mAtlas; if (texture.m_anchors.Count <= 0) { array = null; } else { array = texture.m_anchors.ToArray()[0]; } uiTexture1.m_anchor = array; mAtlas.m_atlas = texture.m_atlas; mAtlas.m_resourceImage = texture.m_resourceImage; mAtlas.m_width = texture.m_width; mAtlas.m_height = texture.m_height; mAtlas.m_hidden = texture.m_hidden; mAtlas.m_parentKey = texture.m_parentKey; mAtlas.m_sprite = sprite; this.m_textures.Add(texture.m_parentKey, mAtlas); } } else { Debug.Log(string.Concat("Found duplicate texture ", texture.m_parentKey)); } } } } List <UiAnimation.UiAnimElement> uiAnimElements = new List <UiAnimation.UiAnimElement>(); foreach (UiAnimation.UiAnimGroup mGroup in this.m_groups) { mGroup.m_maxTime = 0f; foreach (UiAnimation.UiAnimElement mElement in mGroup.m_elements) { UiAnimation.UiTexture uiTexture2 = null; this.m_textures.TryGetValue(mElement.m_childKey, out uiTexture2); if (uiTexture2 == null) { uiAnimElements.Add(mElement); Debug.Log(string.Concat("Removing element with childKey ", mElement.m_childKey, ", no associated texture was found.")); } else { mElement.m_texture = uiTexture2; float totalTime = mElement.GetTotalTime(); if (totalTime > mGroup.m_maxTime) { mGroup.m_maxTime = totalTime; } } } foreach (UiAnimation.UiAnimElement uiAnimElement in uiAnimElements) { mGroup.m_elements.Remove(uiAnimElement); } } }
public void SetMission(WrapperGarrisonMission mission) { this.m_statusText.gameObject.SetActive(false); this.m_mission = mission; GarrMissionRec record = StaticDB.garrMissionDB.GetRecord(mission.MissionRecID); if (record == null) { return; } if (this.m_missionTypeIcon != null) { GarrMissionTypeRec garrMissionTypeRec = StaticDB.garrMissionTypeDB.GetRecord((int)record.GarrMissionTypeID); if ((ulong)garrMissionTypeRec.UiTextureAtlasMemberID == (long)this.m_starIconId) { this.m_missionTypeIcon.sprite = this.m_starSprite; } if ((ulong)garrMissionTypeRec.UiTextureAtlasMemberID == (long)this.m_swordIconID) { this.m_missionTypeIcon.sprite = this.m_swordSprite; } if ((ulong)garrMissionTypeRec.UiTextureAtlasMemberID == (long)this.m_bootIconId) { this.m_missionTypeIcon.sprite = this.m_bootSprite; } if ((ulong)garrMissionTypeRec.UiTextureAtlasMemberID == (long)this.m_stealthIconId) { this.m_missionTypeIcon.sprite = this.m_stealthSprite; } if ((ulong)garrMissionTypeRec.UiTextureAtlasMemberID == (long)this.m_scrollIconId) { this.m_missionTypeIcon.sprite = this.m_scrollSprite; } } bool flag = false; if (mission.MissionState == 1) { flag = true; this.m_statusText.gameObject.SetActive(true); this.m_missionTime.gameObject.SetActive(false); } this.m_previewMechanicsGroup.SetActive(!flag); Duration duration = new Duration(this.GetUncounteredMissionDuration(mission), false); string str = "123 Min"; str = (duration.DurationValue < 28800 ? string.Concat("<color=#BEBEBEFF>", duration.DurationString, "</color>") : string.Concat("<color=#ff8600ff>", duration.DurationString, "</color>")); this.m_missionTime.text = string.Concat("(", str, ")"); this.m_missionName.text = record.Name; if (this.m_missionLevel != null) { if (record.TargetLevel >= 110) { this.m_missionLevel.text = string.Concat(new object[] { string.Empty, record.TargetLevel, "\n(", record.TargetItemLevel, ")" }); } else { this.m_missionLevel.text = string.Concat(string.Empty, record.TargetLevel); } } bool flags = (record.Flags & 1) != 0; this.m_rareMissionLabel.gameObject.SetActive(flags); if (!flags) { this.m_missionTypeBG.color = new Color(0f, 0f, 0f, 0.478f); } else { this.m_missionTypeBG.color = new Color(0f, 0f, 1f, 0.24f); } this.m_missionLocation.enabled = false; UiTextureKitRec uiTextureKitRec = StaticDB.uiTextureKitDB.GetRecord((int)record.UiTextureKitID); if (uiTextureKitRec != null) { int uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID(string.Concat(uiTextureKitRec.KitPrefix, "-List")); if (uITextureAtlasMemberID > 0) { Sprite atlasSprite = TextureAtlas.instance.GetAtlasSprite(uITextureAtlasMemberID); if (atlasSprite != null) { this.m_missionLocation.enabled = true; this.m_missionLocation.sprite = atlasSprite; } } } this.UpdateMechanicPreview(flag, mission); MissionRewardDisplay[] componentsInChildren = this.m_previewLootGroup.GetComponentsInChildren <MissionRewardDisplay>(true); for (int i = 0; i < (int)componentsInChildren.Length; i++) { if (componentsInChildren[i] != null) { UnityEngine.Object.Destroy(componentsInChildren[i].gameObject); } } MissionRewardDisplay.InitMissionRewards(this.m_missionRewardDisplayPrefab.gameObject, this.m_previewLootGroup.transform, mission.Rewards); }
public void SetQuest(int questID) { this.m_expiringSoon.gameObject.SetActive(false); this.m_questID = questID; Transform[] componentsInChildren = this.m_worldQuestObjectiveRoot.GetComponentsInChildren <Transform>(true); foreach (Transform transform in componentsInChildren) { if (transform != null && transform != this.m_worldQuestObjectiveRoot.transform) { Object.Destroy(transform.gameObject); } } WrapperWorldQuest worldQuest = WorldQuestData.WorldQuestDictionary[this.m_questID]; GameObject gameObject = Object.Instantiate <GameObject>(this.m_worldQuestObjectiveDisplayPrefab); gameObject.transform.SetParent(this.m_worldQuestObjectiveRoot.transform, false); Text component = gameObject.GetComponent <Text>(); component.text = worldQuest.QuestTitle; component.resizeTextMaxSize = 26; BountySite[] componentsInChildren2 = this.m_bountyLogoRoot.transform.GetComponentsInChildren <BountySite>(true); foreach (BountySite bountySite in componentsInChildren2) { Object.Destroy(bountySite.gameObject); } if (PersistentBountyData.bountiesByWorldQuestDictionary.ContainsKey(worldQuest.QuestID)) { WrapperBountiesByWorldQuest wrapperBountiesByWorldQuest = PersistentBountyData.bountiesByWorldQuestDictionary[worldQuest.QuestID]; for (int k = 0; k < wrapperBountiesByWorldQuest.BountyQuestIDs.Count; k++) { foreach (WrapperWorldQuestBounty bounty in PersistentBountyData.bountyDictionary.Values) { if (wrapperBountiesByWorldQuest.BountyQuestIDs[k] == bounty.QuestID) { QuestV2Rec record = StaticDB.questDB.GetRecord(bounty.QuestID); if (record != null) { GameObject gameObject2 = Object.Instantiate <GameObject>(this.m_worldQuestObjectiveDisplayPrefab); gameObject2.transform.SetParent(this.m_worldQuestObjectiveRoot.transform, false); Text component2 = gameObject2.GetComponent <Text>(); component2.text = record.QuestTitle; component2.color = new Color(1f, 0.773f, 0f, 1f); BountySite bountySite2 = Object.Instantiate <BountySite>(this.m_bountyLogoPrefab); bountySite2.SetBounty(bounty); bountySite2.transform.SetParent(this.m_bountyLogoRoot.transform, false); } } } } } GameObject gameObject3 = Object.Instantiate <GameObject>(this.m_worldQuestObjectiveDisplayPrefab); gameObject3.transform.SetParent(this.m_worldQuestObjectiveRoot.transform, false); this.m_worldQuestTimeText = gameObject3.GetComponent <Text>(); this.m_worldQuestTimeText.text = worldQuest.QuestTitle; this.m_worldQuestTimeText.color = new Color(1f, 0.773f, 0f, 1f); foreach (WrapperWorldQuestObjective wrapperWorldQuestObjective in worldQuest.Objectives) { GameObject gameObject4 = Object.Instantiate <GameObject>(this.m_worldQuestObjectiveDisplayPrefab); gameObject4.transform.SetParent(this.m_worldQuestObjectiveRoot.transform, false); Text component3 = gameObject4.GetComponent <Text>(); component3.text = "- " + wrapperWorldQuestObjective.Text; } this.InitRewardInfoDisplay(worldQuest); this.m_endTime = worldQuest.EndTime; QuestInfoRec record2 = StaticDB.questInfoDB.GetRecord(worldQuest.QuestInfoID); if (record2 == null) { return; } bool active = (record2.Modifiers & 2) != 0; this.m_dragonFrame.gameObject.SetActive(active); if (record2.Type == 7) { this.m_background.sprite = Resources.Load <Sprite>("NewWorldQuest/Mobile-NormalQuest"); this.m_main.sprite = Resources.Load <Sprite>("NewWorldQuest/Map-LegionInvasion-SargerasCrest"); return; } this.m_background.sprite = Resources.Load <Sprite>("NewWorldQuest/Mobile-NormalQuest"); bool flag = (record2.Modifiers & 1) != 0; if (flag && record2.Type != 3) { this.m_background.sprite = Resources.Load <Sprite>("NewWorldQuest/Mobile-RareQuest"); } bool flag2 = (record2.Modifiers & 4) != 0; if (flag2 && record2.Type != 3) { this.m_background.sprite = Resources.Load <Sprite>("NewWorldQuest/Mobile-EpicQuest"); } int uitextureAtlasMemberID; string text; switch (record2.Type) { case 1: { int profession = record2.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_703; } case 3: uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-pvp-ffa"); text = "Mobile-PVP"; goto IL_703; case 4: uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-petbattle"); text = "Mobile-Pets"; goto IL_703; } uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-questmarker-questbang"); text = "Mobile-QuestExclamationIcon"; IL_703: 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(); } this.UpdateTimeRemaining(); }
public void SetQuest(int questID) { this.m_expiringSoon.gameObject.SetActive(false); this.m_questID = questID; Transform[] componentsInChildren = this.m_worldQuestObjectiveRoot.GetComponentsInChildren <Transform>(true); for (int i = 0; i < (int)componentsInChildren.Length; i++) { Transform transforms = componentsInChildren[i]; if (transforms != null && transforms != this.m_worldQuestObjectiveRoot.transform) { transforms.SetParent(null); UnityEngine.Object.Destroy(transforms.gameObject); } } WrapperWorldQuest item = WorldQuestData.WorldQuestDictionary[this.m_questID]; this.m_worldQuestNameText.text = item.QuestTitle; BountySite[] bountySiteArray = this.m_bountyLogoRoot.transform.GetComponentsInChildren <BountySite>(true); for (int j = 0; j < (int)bountySiteArray.Length; j++) { BountySite bountySite = bountySiteArray[j]; bountySite.transform.SetParent(null); UnityEngine.Object.Destroy(bountySite.gameObject); } int num = 0; if (PersistentBountyData.bountiesByWorldQuestDictionary.ContainsKey(item.QuestID)) { WrapperBountiesByWorldQuest wrapperBountiesByWorldQuest = PersistentBountyData.bountiesByWorldQuestDictionary[item.QuestID]; for (int k = 0; k < wrapperBountiesByWorldQuest.BountyQuestIDs.Count; k++) { foreach (WrapperWorldQuestBounty value in PersistentBountyData.bountyDictionary.Values) { if (wrapperBountiesByWorldQuest.BountyQuestIDs[k] != value.QuestID) { continue; } QuestV2Rec record = StaticDB.questDB.GetRecord(value.QuestID); if (record == null) { continue; } GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(this.m_worldQuestObjectiveDisplayPrefab); gameObject.transform.SetParent(this.m_worldQuestObjectiveRoot.transform, false); Text component = gameObject.GetComponent <Text>(); component.text = record.QuestTitle; component.color = new Color(1f, 0.773f, 0f, 1f); BountySite bountySite1 = UnityEngine.Object.Instantiate <BountySite>(this.m_bountyLogoPrefab); bountySite1.SetBounty(value); bountySite1.transform.SetParent(this.m_bountyLogoRoot.transform, false); num++; } } } this.EnableBountyFiligree(num); GameObject gameObject1 = UnityEngine.Object.Instantiate <GameObject>(this.m_worldQuestObjectiveDisplayPrefab); gameObject1.transform.SetParent(this.m_worldQuestObjectiveRoot.transform, false); this.m_worldQuestTimeText = gameObject1.GetComponent <Text>(); this.m_worldQuestTimeText.text = item.QuestTitle; this.m_worldQuestTimeText.color = new Color(1f, 0.773f, 0f, 1f); foreach (WrapperWorldQuestObjective objective in item.Objectives) { GameObject gameObject2 = UnityEngine.Object.Instantiate <GameObject>(this.m_worldQuestObjectiveDisplayPrefab); gameObject2.transform.SetParent(this.m_worldQuestObjectiveRoot.transform, false); Text text = gameObject2.GetComponent <Text>(); text.text = string.Concat("- ", objective.Text); } this.InitRewardInfoDisplay(item); this.m_endTime = item.EndTime; QuestInfoRec questInfoRec = StaticDB.questInfoDB.GetRecord(item.QuestInfoID); if (questInfoRec == null) { return; } bool modifiers = (questInfoRec.Modifiers & 2) != 0; this.m_dragonFrame.gameObject.SetActive(modifiers); if (questInfoRec.Type == 7) { this.m_background.sprite = Resources.Load <Sprite>("NewWorldQuest/Mobile-NormalQuest"); this.m_main.sprite = Resources.Load <Sprite>("NewWorldQuest/Map-LegionInvasion-SargerasCrest"); return; } this.m_background.sprite = Resources.Load <Sprite>("NewWorldQuest/Mobile-NormalQuest"); if ((questInfoRec.Modifiers & 1) != 0 && questInfoRec.Type != 3) { this.m_background.sprite = Resources.Load <Sprite>("NewWorldQuest/Mobile-RareQuest"); } if ((questInfoRec.Modifiers & 4) != 0 && questInfoRec.Type != 3) { this.m_background.sprite = Resources.Load <Sprite>("NewWorldQuest/Mobile-EpicQuest"); } int uITextureAtlasMemberID = 0; string str = null; switch (questInfoRec.Type) { case 1: { int profession = questInfoRec.Profession; switch (profession) { case 182: { uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-herbalism"); str = "Mobile-Herbalism"; break; } case 185: { uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-cooking"); str = "Mobile-Cooking"; break; } case 186: { uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-mining"); str = "Mobile-Mining"; break; } default: { if (profession == 164) { uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-blacksmithing"); str = "Mobile-Blacksmithing"; break; } else if (profession == 165) { uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-leatherworking"); str = "Mobile-Leatherworking"; break; } else if (profession == 129) { uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-firstaid"); str = "Mobile-FirstAid"; break; } else if (profession == 171) { uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-alchemy"); str = "Mobile-Alchemy"; break; } else if (profession == 197) { uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-tailoring"); str = "Mobile-Tailoring"; break; } else if (profession == 202) { uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-engineering"); str = "Mobile-Engineering"; break; } else if (profession == 333) { uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-enchanting"); str = "Mobile-Enchanting"; break; } else if (profession == 356) { uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-fishing"); str = "Mobile-Fishing"; break; } else if (profession == 393) { uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-skinning"); str = "Mobile-Skinning"; break; } else if (profession == 755) { uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-jewelcrafting"); str = "Mobile-Jewelcrafting"; break; } else if (profession == 773) { uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-inscription"); str = "Mobile-Inscription"; break; } else if (profession == 794) { uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-archaeology"); str = "Mobile-Archaeology"; break; } else { uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-questmarker-questbang"); str = "Mobile-QuestExclamationIcon"; break; } } } break; } case 2: { uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-questmarker-questbang"); str = "Mobile-QuestExclamationIcon"; break; } case 3: { uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-pvp-ffa"); str = "Mobile-PVP"; break; } case 4: { uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-petbattle"); str = "Mobile-Pets"; break; } default: { goto case 2; } } if (str != null) { this.m_main.sprite = Resources.Load <Sprite>(string.Concat("NewWorldQuest/", str)); } else if (uITextureAtlasMemberID > 0) { this.m_main.sprite = TextureAtlas.instance.GetAtlasSprite(uITextureAtlasMemberID); this.m_main.SetNativeSize(); } this.UpdateTimeRemaining(); }
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(); } } }
public void Deserialize(string animName) { XmlSerializer xmlSerializer = new XmlSerializer(typeof(UiAnimation.UiSourceAnimation)); xmlSerializer.UnknownNode += this.serializer_UnknownNode; xmlSerializer.UnknownAttribute += this.serializer_UnknownAttribute; TextAsset sourceData = UiAnimMgr.instance.GetSourceData(animName); if (sourceData == null) { Debug.Log("Could not find asset " + animName); return; } MemoryStream memoryStream = new MemoryStream(sourceData.bytes); UiAnimation.UiSourceAnimation uiSourceAnimation = xmlSerializer.Deserialize(memoryStream) as UiAnimation.UiSourceAnimation; memoryStream.Close(); if (uiSourceAnimation == null) { Debug.Log("No ui animation."); return; } this.m_frame = uiSourceAnimation.frame; foreach (UiAnimation.UiSourceAnimGroup uiSourceAnimGroup in uiSourceAnimation.frame.animation.groups) { UiAnimation.UiAnimGroup uiAnimGroup = new UiAnimation.UiAnimGroup(); uiAnimGroup.m_parentKey = uiSourceAnimGroup.parentKey; uiAnimGroup.m_bounceBack = false; if (uiSourceAnimGroup.looping == null) { uiAnimGroup.m_looping = false; uiAnimGroup.m_bounce = false; } else if (uiSourceAnimGroup.looping == "REPEAT") { uiAnimGroup.m_looping = true; uiAnimGroup.m_bounce = false; } else if (uiSourceAnimGroup.looping == "BOUNCE") { uiAnimGroup.m_looping = true; uiAnimGroup.m_bounce = true; } foreach (UiAnimation.UiScale uiScale in uiSourceAnimGroup.m_scales) { if (uiScale.m_childKey != null) { uiScale.SetSmoothing(); uiAnimGroup.m_elements.Add(uiScale); } } foreach (UiAnimation.UiAlpha uiAlpha in uiSourceAnimGroup.m_alphas) { if (uiAlpha.m_childKey != null) { uiAlpha.SetSmoothing(); uiAnimGroup.m_elements.Add(uiAlpha); } } foreach (UiAnimation.UiRotation uiRotation in uiSourceAnimGroup.m_rotations) { if (uiRotation.m_childKey != null) { uiRotation.SetSmoothing(); uiAnimGroup.m_elements.Add(uiRotation); } } foreach (UiAnimation.UiTranslation uiTranslation in uiSourceAnimGroup.m_translations) { if (uiTranslation.m_childKey != null) { uiTranslation.SetSmoothing(); uiAnimGroup.m_elements.Add(uiTranslation); } } this.m_groups.Add(uiAnimGroup); } foreach (UiAnimation.UiLayer uiLayer in uiSourceAnimation.frame.layers) { using (List <UiAnimation.UiSourceTexture> .Enumerator enumerator7 = uiLayer.textures.GetEnumerator()) { while (enumerator7.MoveNext()) { UiAnimation.UiSourceTexture texture = enumerator7.Current; if (texture.m_parentKey != null) { UiAnimation.UiTexture uiTexture; this.m_textures.TryGetValue(texture.m_parentKey, out uiTexture); if (uiTexture != null) { Debug.Log("Found duplicate texture " + texture.m_parentKey); } else { int num = 0; UiTextureAtlasMemberRec recordFirstOrDefault = StaticDB.uiTextureAtlasMemberDB.GetRecordFirstOrDefault((UiTextureAtlasMemberRec memberRec) => memberRec.CommittedName != null && texture.m_atlas != null && memberRec.CommittedName.Equals(texture.m_atlas, StringComparison.OrdinalIgnoreCase)); if (recordFirstOrDefault != null) { num = recordFirstOrDefault.ID; } Sprite sprite = null; if (num > 0) { sprite = TextureAtlas.GetSprite(num); } else if (texture.m_resourceImage != null) { sprite = Resources.Load <Sprite>(texture.m_resourceImage); } if (sprite != null) { UiAnimation.UiTexture uiTexture2 = new UiAnimation.UiTexture(); uiTexture2.m_alpha = texture.m_alpha; uiTexture2.m_alphaMode = texture.m_alphaMode; uiTexture2.m_anchor = ((texture.m_anchors.Count <= 0) ? null : texture.m_anchors.ToArray()[0]); uiTexture2.m_atlas = texture.m_atlas; uiTexture2.m_resourceImage = texture.m_resourceImage; uiTexture2.m_width = texture.m_width; uiTexture2.m_height = texture.m_height; uiTexture2.m_hidden = texture.m_hidden; uiTexture2.m_parentKey = texture.m_parentKey; uiTexture2.m_sprite = sprite; this.m_textures.Add(texture.m_parentKey, uiTexture2); } else { Debug.Log(string.Concat(new object[] { "Could not find sprite for textureAtlasMemberID ", num, " resourceImage ", texture.m_resourceImage, " in Ui Animation ", animName })); } } } } } } List <UiAnimation.UiAnimElement> list = new List <UiAnimation.UiAnimElement>(); foreach (UiAnimation.UiAnimGroup uiAnimGroup2 in this.m_groups) { uiAnimGroup2.m_maxTime = 0f; foreach (UiAnimation.UiAnimElement uiAnimElement in uiAnimGroup2.m_elements) { UiAnimation.UiTexture uiTexture3 = null; this.m_textures.TryGetValue(uiAnimElement.m_childKey, out uiTexture3); if (uiTexture3 != null) { uiAnimElement.m_texture = uiTexture3; float totalTime = uiAnimElement.GetTotalTime(); if (totalTime > uiAnimGroup2.m_maxTime) { uiAnimGroup2.m_maxTime = totalTime; } } else { list.Add(uiAnimElement); Debug.Log("Removing element with childKey " + uiAnimElement.m_childKey + ", no associated texture was found."); } } foreach (UiAnimation.UiAnimElement item in list) { uiAnimGroup2.m_elements.Remove(item); } } }