public AvatarDataItem Clone() { AvatarDataItem item = new AvatarDataItem(this.avatarID, this.level, this.star) { UnLocked = this.UnLocked, Initialized = this.Initialized, exp = this.exp, fragment = this.fragment }; foreach (EquipmentSlot slot in EQUIP_SLOTS) { StorageDataItemBase base2 = (this.equipsMap[slot] != null) ? this.equipsMap[slot].Clone() : null; item.equipsMap[slot] = base2; } foreach (AvatarSkillDataItem item2 in this.skillDataList) { AvatarSkillDataItem avatarSkillBySkillID = item.GetAvatarSkillBySkillID(item2.skillID); avatarSkillBySkillID.UnLocked = item2.UnLocked; foreach (AvatarSubSkillDataItem item4 in item2.avatarSubSkillList) { avatarSkillBySkillID.GetAvatarSubSkillBySubSkillId(item4.subSkillID).level = item4.level; } } return(item); }
private void SetupSelectSkillSubSkillListView(Transform trans, AvatarSkillDataItem selectedSkillData) { trans.Find("ParentSkill/Icon/Image").GetComponent <Image>().sprite = Miscs.GetSpriteByPrefab(selectedSkillData.IconPath); trans.Find("ParentSkill/Icon").GetComponent <Image>().color = MiscData.GetColor("Blue"); HashSet <int> set = new HashSet <int> { 1, 2, 3 }; foreach (AvatarSubSkillDataItem item in selectedSkillData.avatarSubSkillList) { string name = "SubSkill_" + item.ShowOrder; Transform transform = trans.Find(name); if (transform != null) { transform.gameObject.SetActive(true); transform.GetComponent <MonoAvatarSubSkillIconButton>().SetupView(this._avatarData, selectedSkillData, item, this._isRemoteAvatar); set.Remove(item.ShowOrder); } } foreach (int num in set) { string str2 = "SubSkill_" + num; trans.Find(str2).gameObject.SetActive(false); } }
private bool OnSelectedSkillChanged(int newSkillId) { this._showingSkillId = newSkillId; AvatarSkillDataItem selectedSkillData = (this._showingSkillId != 0) ? this.userData.leaderAvatar.GetAvatarSkillBySkillID(this._showingSkillId) : null; base.view.transform.Find("SkillTab").GetComponent <MonoAvatarDetailSkillTab>().SetupView(this.userData, selectedSkillData); return(false); }
private bool OnAvatarSubSkillLevelUpRsp(AvatarSubSkillLevelUpRsp rsp) { if (rsp.get_retcode() == null) { AvatarSkillDataItem selectedSkillData = (this._showingSkillId != 0) ? this.avatarData.GetAvatarSkillBySkillID(this._showingSkillId) : null; base.view.transform.Find("SkillTab").GetComponent <MonoAvatarDetailSkillTab>().SetupView(this.avatarData, selectedSkillData); } return(false); }
private void SetupSkillTab() { GameObject gameObject = base.view.transform.Find("SkillTab").gameObject; Button component = base.view.transform.Find("TabBtns/SkillTabBtn").GetComponent <Button>(); this._tabManager.SetTab("SkillTab", component, gameObject); component.transform.Find("PopUp").gameObject.SetActive(false); AvatarSkillDataItem selectedSkillData = (this._showingSkillId != 0) ? this.userData.leaderAvatar.GetAvatarSkillBySkillID(this._showingSkillId) : null; gameObject.GetComponent <MonoAvatarDetailSkillTab>().SetupView(this.userData, selectedSkillData); }
private void SetupSkillIcon(AvatarSkillDataItem skillData, Transform skillTrans) { skillTrans.Find("Info/NameText").GetComponent <Text>().text = skillData.SkillName; skillTrans.Find("Info/Desc").GetComponent <Text>().text = skillData.SkillInfo; Sprite spriteByPrefab = Miscs.GetSpriteByPrefab(skillData.IconPath); skillTrans.Find("SkillIcon/Icon/Image").GetComponent <Image>().sprite = spriteByPrefab; string key = "SkillBtnBlue"; skillTrans.Find("SkillIcon/Icon/Image").GetComponent <Image>().material = null; skillTrans.Find("SkillIcon/Icon/BG").GetComponent <Image>().color = MiscData.GetColor(key); }
public AvatarSubSkillDialogContext(AvatarDataItem avatarData, AvatarSkillDataItem skillData, AvatarSubSkillDataItem subSkillData) { ContextPattern pattern = new ContextPattern { contextName = "AvatarSubSkillDialogContext", viewPrefabPath = "UI/Menus/Dialog/AvatarSubSkillDialog" }; base.config = pattern; this.avatarData = avatarData; this.skillData = skillData; this.subSkillData = subSkillData; }
private void SetupSelectSkillView(AvatarSkillDataItem selectedSkillData) { base.transform.Find("ListPanel/Info/Content/Skill").gameObject.SetActive(false); Transform trans = base.transform.Find("SelectedSkill"); trans.gameObject.SetActive(true); this.SetupSelectSkillDetailView(trans, selectedSkillData); Transform transform2 = base.transform.Find("ListPanel/Info/Content/SubSkill"); transform2.gameObject.SetActive(true); this.SetupSelectSkillSubSkillListView(transform2, selectedSkillData); base.transform.Find("ListPanel").GetComponent <Animation>().Play(); }
public void SetLeaderAvatar(AvatarDetailData avatarDetailData) { this.leaderAvatar = new AvatarDataItem((int)avatarDetailData.get_avatar_id(), (int)avatarDetailData.get_avatar_level(), (int)avatarDetailData.get_avatar_star()); WeaponDetailData data = avatarDetailData.get_weapon(); if ((data != null) && (WeaponMetaDataReader.GetWeaponMetaDataByKey((int)data.get_id()) != null)) { WeaponDataItem item = new WeaponDataItem(0, WeaponMetaDataReader.GetWeaponMetaDataByKey((int)data.get_id())) { level = (int)data.get_level() }; this.leaderAvatar.equipsMap[1] = item; } EquipmentSlot[] slotArray = new EquipmentSlot[] { 2, 3, 4 }; List <StigmataDetailData> list = new List <StigmataDetailData> { avatarDetailData.get_stigmata_1(), avatarDetailData.get_stigmata_2(), avatarDetailData.get_stigmata_3() }; for (int i = 0; i < list.Count; i++) { StigmataDetailData data2 = list[i]; if ((data2 != null) && (StigmataMetaDataReader.GetStigmataMetaDataByKey((int)data2.get_id()) != null)) { StigmataDataItem item2 = new StigmataDataItem(0, StigmataMetaDataReader.GetStigmataMetaDataByKey((int)data2.get_id())) { level = (int)data2.get_level() }; int num2 = !data2.get_pre_affix_idSpecified() ? 0 : ((int)data2.get_pre_affix_id()); int num3 = !data2.get_suf_affix_idSpecified() ? 0 : ((int)data2.get_suf_affix_id()); item2.SetAffixSkill(true, num2, num3); this.leaderAvatar.equipsMap[slotArray[i]] = item2; } } foreach (AvatarSkillDetailData data3 in avatarDetailData.get_skill_list()) { if (this.leaderAvatar.GetAvatarSkillBySkillID((int)data3.get_skill_id()) != null) { AvatarSkillDataItem avatarSkillBySkillID = this.leaderAvatar.GetAvatarSkillBySkillID((int)data3.get_skill_id()); foreach (AvatarSubSkillDetailData data4 in data3.get_sub_skill_list()) { if (avatarSkillBySkillID.GetAvatarSubSkillBySubSkillId((int)data4.get_sub_skill_id()) != null) { avatarSkillBySkillID.GetAvatarSubSkillBySubSkillId((int)data4.get_sub_skill_id()).level = (int)data4.get_level(); } } } } }
public void SetupView(AvatarDataItem avatarDataItem, AvatarSkillDataItem skillData, bool isRemoteAvatar) { this._avatarData = avatarDataItem; this._skillData = skillData; this._isRemoteAvatar = isRemoteAvatar; Text component = base.transform.Find("Info/NameText").GetComponent <Text>(); component.text = this._skillData.SkillName; component.color = !this._skillData.UnLocked ? MiscData.GetColor("TextGrey") : Color.white; Transform transform = base.transform.Find("SkillIcon/UnLockInfo"); transform.gameObject.SetActive(!this._skillData.UnLocked); Transform transform2 = transform.Find("UnLockStar"); Transform transform3 = transform.Find("UnLockLv"); transform2.gameObject.SetActive(false); transform3.gameObject.SetActive(false); if (transform.gameObject.activeSelf) { base.transform.Find("SkillIcon/Icon").GetComponent <Image>().color = MiscData.GetColor("SkillBtnGrey"); bool flag = this._avatarData.level < this._skillData.UnLockLv; if (this._avatarData.star < this._skillData.UnLockStar) { transform2.gameObject.SetActive(true); transform3.gameObject.SetActive(false); transform2.Find("Star").GetComponent <MonoAvatarStar>().SetupView(this._skillData.UnLockStar); } else if (flag) { transform2.gameObject.SetActive(false); transform3.gameObject.SetActive(true); transform3.Find("Lv").GetComponent <Text>().text = "Lv." + this._skillData.UnLockLv; } } int levelSum = this._skillData.GetLevelSum(); int maxLevelSum = this._skillData.GetMaxLevelSum(); Text text2 = base.transform.Find("Info/Row/AddPtText").GetComponent <Text>(); text2.gameObject.SetActive(this._skillData.UnLocked); if (levelSum == maxLevelSum) { text2.text = "MAX"; } else { text2.text = (levelSum <= 0) ? string.Empty : ("+" + levelSum); } this.SetupIcon(); this.SetupSkillPopUp(); }
private void SetupSelectSkillDetailView(Transform trans, AvatarSkillDataItem selectedSkillData) { trans.Find("Content/NameText").GetComponent <Text>().text = selectedSkillData.SkillName; trans.Find("Content/DescText").GetComponent <Text>().text = selectedSkillData.SkillInfo; if (string.IsNullOrEmpty(selectedSkillData.SkillStep)) { trans.Find("Content/Step").gameObject.SetActive(false); } else { trans.Find("Content/Step").gameObject.SetActive(true); trans.Find("Content/Step/Table").GetComponent <MonoAvatarSkillStep>().SetupView(this._avatarData, selectedSkillData.SkillStep); } }
public void SetupView(FriendDetailDataItem userData, AvatarSkillDataItem selectedSkillData = null) { this._isRemoteAvatar = true; this._userData = userData; this._avatarData = this._userData.leaderAvatar; base.transform.Find("ListPanel/Info/Content/SkillPoint").gameObject.SetActive(false); if (selectedSkillData != null) { this.SetupSelectSkillView(selectedSkillData); } else { this.SetupSkillListView(); } }
public void SetupView(AvatarDataItem avatarData, AvatarSkillDataItem selectedSkillData = null) { this._isRemoteAvatar = false; this._avatarData = avatarData; base.transform.Find("ListPanel/Info/Content/SkillPoint").gameObject.SetActive(true); this.SetupSkillPoint(); if (selectedSkillData != null) { this.SetupSelectSkillView(selectedSkillData); } else { this.SetupSkillListView(); } }
public FriendBriefDataItem(PlayerFriendBriefData briefData) { this.uid = (int)briefData.get_uid(); this._nickName = briefData.get_nickname(); this.level = (int)briefData.get_level(); this.showAvatarID = (int)briefData.get_avatar_id(); this.avatarCombat = (int)briefData.get_avatar_combat(); this.avatarStar = (int)briefData.get_avatar_star(); this.avatarLevel = (int)briefData.get_avatar_level(); if (this.avatarLevel == 0) { this.avatarLevel = 1; } this.AvatarLeaderSkill = new AvatarDataItem(this.showAvatarID, 1, 0).GetLeaderSkill(); this.AvatarLeaderSkill.UnLocked = (this.avatarLevel >= this.AvatarLeaderSkill.UnLockLv) && (this.avatarStar >= this.AvatarLeaderSkill.UnLockStar);
private void SetupDefaultSkillList() { this.skillDataList = new List <AvatarSkillDataItem>(); this._skillDataMap = new Dictionary <int, AvatarSkillDataItem>(); foreach (int num in this._metaData.skillList) { AvatarSkillDataItem item = new AvatarSkillDataItem(num, this.avatarID); this.skillDataList.Add(item); this._skillDataMap.Add(num, item); if (item.IsLeaderSkill) { this._leaderSkillId = item.skillID; } } }
private static bool CheckUnlockBySkillID(ConfigAvatarAbilityUnlock unlockConfig, AvatarDataItem avatarDataItem, bool useLeaderSkill) { for (int i = 0; i < avatarDataItem.skillDataList.Count; i++) { AvatarSkillDataItem item = avatarDataItem.skillDataList[i]; if ((item.skillID == unlockConfig.UnlockBySkillID) && item.UnLocked) { if (item.IsLeaderSkill) { return(useLeaderSkill); } return(true); } } return(false); }
private static bool CheckUnlockBySubSkillIDAndAddParam(ConfigAvatarAbilityUnlock unlockConfig, AvatarDataItem avatarDataItem, out AvatarSubSkillDataItem outSubSkillItem, bool useLeaderSkill) { for (int i = 0; i < avatarDataItem.skillDataList.Count; i++) { AvatarSkillDataItem item = avatarDataItem.skillDataList[i]; if (!item.IsLeaderSkill || useLeaderSkill) { for (int j = 0; j < item.avatarSubSkillList.Count; j++) { AvatarSubSkillDataItem item2 = item.avatarSubSkillList[j]; if ((item2.subSkillID == unlockConfig.UnlockBySubSkillID) && item2.UnLocked) { outSubSkillItem = item2; return(true); } } } } outSubSkillItem = null; return(false); }
public void SetupView(AvatarDataItem avatarDataItem, AvatarSkillDataItem skillData, AvatarSubSkillDataItem subSkillData, bool isRemoteAvatar) { this._avatarData = avatarDataItem; this._skillData = skillData; this._subSkillData = subSkillData; this._isRemoteAvatar = isRemoteAvatar; base.transform.Find("Row/NameText").GetComponent <Text>().text = this._subSkillData.Name; base.transform.Find("RowText/DescText").GetComponent <Text>().text = this._subSkillData.Info; this.SetupIcon(); Transform transform = base.transform.Find("SkillIcon/UnLockInfo"); bool flag = this._avatarData.level < this._subSkillData.UnlockLv; bool flag2 = this._avatarData.star < this._subSkillData.UnlockStar; transform.gameObject.SetActive(!this._subSkillData.UnLocked); if (!this._subSkillData.UnLocked) { Transform transform2 = transform.Find("UnLockStar"); Transform transform3 = transform.Find("UnLockLv"); base.transform.Find("SkillIcon/Icon").GetComponent <Image>().color = MiscData.GetColor("SkillBtnGrey"); if (flag2) { transform2.gameObject.SetActive(true); transform3.gameObject.SetActive(false); transform2.Find("Star").GetComponent <MonoAvatarStar>().SetupView(this._subSkillData.UnlockStar); } else if (flag) { transform2.gameObject.SetActive(false); transform3.gameObject.SetActive(true); transform3.Find("Lv").GetComponent <Text>().text = "Lv." + this._subSkillData.UnlockLv; } else { transform2.gameObject.SetActive(false); transform3.gameObject.SetActive(false); base.transform.Find("SkillIcon/Icon").GetComponent <Image>().color = MiscData.GetColor("Blue"); } } Transform transform4 = base.transform.Find("RowText/NextLv"); Transform transform5 = base.transform.Find("RowText/NextStar"); transform4.gameObject.SetActive(false); transform5.gameObject.SetActive(false); if (this._subSkillData.UnLocked && (this._subSkillData.level < this._subSkillData.MaxLv)) { bool flag3 = this._avatarData.level < this._subSkillData.LvUpNeedAvatarLevel; if (this._avatarData.star < this._subSkillData.GetUpLevelStarNeed()) { transform4.gameObject.SetActive(false); transform5.gameObject.SetActive(true); transform5.Find("Star").GetComponent <MonoAvatarStar>().SetupView(this._subSkillData.GetUpLevelStarNeed()); } else if (flag3) { transform4.gameObject.SetActive(true); transform5.gameObject.SetActive(false); transform4.Find("Lv").GetComponent <Text>().text = "Lv." + this._subSkillData.LvUpNeedAvatarLevel; } } Text component = base.transform.Find("Row/AddPtText").GetComponent <Text>(); component.gameObject.SetActive(this._subSkillData.UnLocked); if (this._subSkillData.level == this._subSkillData.MaxLv) { component.text = "MAX"; } else { component.text = (this._subSkillData.level <= 0) ? string.Empty : string.Format("+{0}", this._subSkillData.level); } this.SetupSubSkillPopUp(); if (this._subSkillData.level == this._subSkillData.MaxLv) { base.transform.Find("SkillIcon/PopUp").gameObject.SetActive(false); } base.transform.Find("SkillIcon/Max").gameObject.SetActive(this._subSkillData.level == this._subSkillData.MaxLv); base.transform.Find("SkillIcon/Upgradable").gameObject.SetActive(((!this._isRemoteAvatar && this._subSkillData.UnLocked) && ((this._subSkillData.level < this._subSkillData.MaxLv) && (this._avatarData.level >= this._subSkillData.LvUpNeedAvatarLevel))) && (this._avatarData.star >= this._subSkillData.GetUpLevelStarNeed())); }