using System; using System.Collections.Generic; using KKSG; using UILib; using UnityEngine; using XMainClient.UI; using XMainClient.UI.UICommon; using XUtliPoolLib; namespace XMainClient { internal class XOtherPlayerInfoView : DlgBase { public override string fileName { get { return "GameSystem/OtherPlayerInfo"; } } public override int group { get { return 1; } } public override bool autoload { get { return true; } } private XOtherPlayerInfoDocument _doc = null; private ArtifactBagDocument m_doc = null; private EquipFusionDocument m_equipfusionDoc; private ulong m_PlayerId; private string m_PlayerName; private uint m_PlayerProfession; private uint m_PowerPoint; private List m_setid = new List(); private uint m_PlayerLevel; public const int FUNC_NUM = 8; public const int EQUIP_NUM = 10; public const int AVATAR_NUM = 10; public const int EMBLEM_NUM = 16; public const int ARTIFACT_NUM = 4; private XDummy _PlayerDummy = null; private XSpriteAvatarHandler[] _SpriteAvatarHandler = new XSpriteAvatarHandler[4]; private ArtifactQuanlityFx[] m_fuseBreakFx = new ArtifactQuanlityFx[10]; private XAttributes m_Attributes = null; private float _EclipsedTime = 0f; public List m_InfoCheck = new List(); private Dictionary m_InfoDic = new Dictionary(); private Dictionary m_ItemDic = new Dictionary(); private Dictionary _skillLevel = new Dictionary(); private HashSet _bindsSkills = new HashSet(); private ArtifactQuanlityFx[] m_artifactQuanlityFx = new ArtifactQuanlityFx[XBagDocument.ArtifactMax]; private XBodyBag m_EquipBag = new XBodyBag(XBagDocument.EquipMax); private XBodyBag m_artifactBag = new XBodyBag(XBagDocument.ArtifactMax); private List m_FashionBag = new List(); private XPetSkillHandler m_SkillHandler; private XCharacterAttrView m_CharacterAttrHandler; private XEmbleAttrView m_EmbleAttrHandler; private XArtifactAttrView m_artifactAttrHandler; private uint[] allParts = new uint[10]; private uint lastPetID = 0u; private bool hasPetInfo = false; protected override void Init() { this._doc = XDocuments.GetSpecificDocument(XOtherPlayerInfoDocument.uuID); this._doc.OtherPlayerInfoView = this; this.m_doc = ArtifactBagDocument.Doc; this.m_equipfusionDoc = EquipFusionDocument.Doc; IXUIButton ixuibutton = base.uiBehaviour.transform.Find("backclick").GetComponent("XUIButton") as IXUIButton; ixuibutton.RegisterClickEventHandler(new ButtonClickEventHandler(this.ClickClosePanel)); ixuibutton = (base.uiBehaviour.transform.Find("Bg/InfoPanel/backclick").GetComponent("XUIButton") as IXUIButton); ixuibutton.RegisterClickEventHandler(new ButtonClickEventHandler(this.ClickClosePanel)); this.m_InfoCheck.Clear(); base.uiBehaviour.m_FunctionBtns.ReturnAll(false); string[] array = new string[] { XStringDefineProxy.GetString("EQUIP"), XStringDefineProxy.GetString("SKILL"), XStringDefineProxy.GetString("FASHION"), XStringDefineProxy.GetString("EMBLEM"), XStringDefineProxy.GetString("CHAT_GUILD"), XStringDefineProxy.GetString("PET"), XStringDefineProxy.GetString("Sprite"), XStringDefineProxy.GetString("Artifact") }; for (int i = 0; i < 8; i++) { GameObject gameObject = base.uiBehaviour.m_FunctionBtns.FetchGameObject(false); gameObject.transform.localPosition = new Vector3(base.uiBehaviour.m_FunctionBtns.TplPos.x, base.uiBehaviour.m_FunctionBtns.TplPos.y - (float)(i * base.uiBehaviour.m_FunctionBtns.TplHeight), base.uiBehaviour.m_FunctionBtns.TplPos.z); IXUICheckBox ixuicheckBox = gameObject.transform.Find("Bg").GetComponent("XUICheckBox") as IXUICheckBox; ixuicheckBox.RegisterOnCheckEventHandler(new CheckBoxOnCheckEventHandler(this.ShowPlayerInfo)); ixuicheckBox.ID = (ulong)((long)(i + 1)); this.m_InfoCheck.Add(ixuicheckBox); IXUILabel ixuilabel = gameObject.transform.Find("name").GetComponent("XUILabel") as IXUILabel; IXUILabel ixuilabel2 = gameObject.transform.Find("nameSelected").GetComponent("XUILabel") as IXUILabel; ixuilabel.SetText(array[i]); ixuilabel2.SetText(array[i]); } for (int j = 0; j < XBagDocument.ArtifactMax; j++) { this.m_artifactQuanlityFx[j] = new ArtifactQuanlityFx(); } this.m_InfoDic[Player_Info.Avatar] = base.uiBehaviour.m_AvatarLayer; this.m_InfoDic[Player_Info.Equip] = base.uiBehaviour.m_EquipLayer; this.m_InfoDic[Player_Info.Emblem] = base.uiBehaviour.m_EmblemLayer; this.m_InfoDic[Player_Info.Guild] = base.uiBehaviour.m_GuildLayer; this.m_InfoDic[Player_Info.Pet] = base.uiBehaviour.m_PetLayer; this.m_InfoDic[Player_Info.Sprite] = base.uiBehaviour.m_SpriteLayer; this.m_InfoDic[Player_Info.Skill] = base.uiBehaviour.m_SkillLayer; this.m_InfoDic[Player_Info.Artifact] = base.uiBehaviour.m_artifactLayer; DlgHandlerBase.EnsureCreate(ref this.m_SkillHandler, base.uiBehaviour.m_PetSkillFrame.gameObject, null, true); for (int k = 0; k < 4; k++) { Transform parent = base.uiBehaviour.m_SpriteLayer.gameObject.transform.Find(string.Format("Avatar{0}", k)); DlgHandlerBase.EnsureCreate(ref this._SpriteAvatarHandler[k], parent, true, this); } DlgHandlerBase.EnsureCreate>(ref this.m_CharacterAttrHandler, base.uiBehaviour.m_EquipLayer.gameObject.transform.Find("AttrFrame"), true, null); DlgHandlerBase.EnsureCreate>(ref this.m_EmbleAttrHandler, base.uiBehaviour.m_EmblemLayer.gameObject.transform.Find("AttrFrame"), true, null); DlgHandlerBase.EnsureCreate>(ref this.m_artifactAttrHandler, base.uiBehaviour.m_artifactLayer.gameObject.transform.Find("AttrFrame"), true, null); } public override void RegisterEvent() { } protected override void OnShow() { base.OnShow(); this.InitGuildInfo(); this.InitEquipAndAvatar(); base.Alloc3DAvatarPool("XOtherPlayerInfoView"); this.SetSpriteAvatarHandlerVisible(true); } protected override void OnHide() { base.OnHide(); base.Return3DAvatarPool(); this._PlayerDummy = null; this.SetSpriteAvatarHandlerVisible(false); this.RestQuanlityFx(); this.hasPetInfo = false; } private void SetSpriteAvatarHandlerVisible(bool visible) { for (int i = 0; i < this._SpriteAvatarHandler.Length; i++) { this._SpriteAvatarHandler[i].SetVisible(visible); if (visible) { this._SpriteAvatarHandler[i].HideAvatar(); } } } protected override void OnUnload() { base.Return3DAvatarPool(); this._doc = null; this.hasPetInfo = false; for (int i = 0; i < XBagDocument.ArtifactMax; i++) { bool flag = this.m_artifactQuanlityFx[i] != null; if (flag) { this.m_artifactQuanlityFx[i].Reset(); } } for (int j = 0; j < 10; j++) { bool flag2 = this.m_fuseBreakFx[j] != null; if (flag2) { this.m_fuseBreakFx[j].Reset(); this.m_fuseBreakFx[j] = null; } } DlgHandlerBase.EnsureUnload(ref this.m_SkillHandler); for (int k = 0; k < this._SpriteAvatarHandler.Length; k++) { DlgHandlerBase.EnsureUnload(ref this._SpriteAvatarHandler[k]); } DlgHandlerBase.EnsureUnload>(ref this.m_CharacterAttrHandler); DlgHandlerBase.EnsureUnload>(ref this.m_EmbleAttrHandler); DlgHandlerBase.EnsureUnload>(ref this.m_artifactAttrHandler); base.OnUnload(); } public override void StackRefresh() { base.StackRefresh(); base.Alloc3DAvatarPool("XOtherPlayerInfoView"); } public bool OnCloseClicked(IXUIButton sp) { this.SetVisible(false, true); return true; } public void SetPlayerInfo(ulong uid, string name, List setid, uint powerpoint = 0u, uint profession = 1u) { this.m_PlayerId = uid; this.m_PlayerName = name; this.m_setid = setid; this.m_PowerPoint = powerpoint; this.m_PlayerProfession = profession; } public void ShowMenuUI(ulong uid, string name, List menuName, List clickHandle, uint powerpoint = 0u, uint profession = 1u) { bool flag = base.IsVisible() && this.m_PlayerId == uid; if (!flag) { DlgBase.singleton.SetVisibleWithAnimation(true, null); this.SetPlayerInfo(uid, name, new List(), powerpoint, profession); base.uiBehaviour.m_MenuPanel.SetVisible(true); base.uiBehaviour.m_InfoPanel.SetVisible(false); base.uiBehaviour.m_MenuPlayerName.SetText(name); base.uiBehaviour.m_MenuPool.ReturnAll(false); float x = base.uiBehaviour.m_MenuPool.TplPos.x; float num = base.uiBehaviour.m_MenuPool.TplPos.y; bool flag2 = menuName.Count > 0; if (flag2) { num += (float)((menuName.Count - 1) * base.uiBehaviour.m_MenuPool.TplHeight / 2); } float z = base.uiBehaviour.m_MenuPool.TplPos.z; int spriteHeight = base.uiBehaviour.m_MenuPool.TplHeight * menuName.Count + 10; for (int i = 0; i < menuName.Count; i++) { GameObject gameObject = base.uiBehaviour.m_MenuPool.FetchGameObject(false); gameObject.transform.localPosition = new Vector3(x, num - (float)(base.uiBehaviour.m_MenuPool.TplHeight * i), z); IXUIButton ixuibutton = gameObject.transform.Find("button").GetComponent("XUIButton") as IXUIButton; IXUILabel ixuilabel = gameObject.transform.Find("button/name").GetComponent("XUILabel") as IXUILabel; ixuibutton.RegisterClickEventHandler(clickHandle[i]); ixuilabel.SetText(menuName[i]); } base.uiBehaviour.m_MenuPanel.spriteHeight = spriteHeight; } } public void InitMenuWithBasicInfo(ulong uid, string name, uint powerpoint = 0u, uint professional = 1u) { bool flag = DlgBase.singleton.IsMyFriend(uid); bool flag2 = DlgBase.singleton.IsBlock(uid); List list = new List(); list.Add(XStringDefineProxy.GetString("OTHERPLAYERINFO_MENU_VIEW")); bool flag3 = flag; if (flag3) { list.Add(XStringDefineProxy.GetString("OTHERPLAYERINFO_MENU_DELETEFRIEND")); } else { bool flag4 = !flag2; if (flag4) { bool flag5 = XSingleton.singleton.IsSystemOpened(XSysDefine.XSys_Friends); if (flag5) { list.Add(XStringDefineProxy.GetString("OTHERPLAYERINFO_MENU_ADDFRIEND")); } } } bool flag6 = !flag2; if (flag6) { list.Add(XStringDefineProxy.GetString("OTHERPLAYERINFO_MENU_PRIVATECHAT")); list.Add(XStringDefineProxy.GetString("OTHERPLAYERINFO_MENU_BLOCK")); list.Add(XStringDefineProxy.GetString("OTHERPLAYERINFO_MENU_SENDFLOWER")); } else { list.Add(XStringDefineProxy.GetString("OTHERPLAYERINFO_MENU_UNBLOCK")); } List list2 = new List(); list2.Add(new ButtonClickEventHandler(this.ShowDetailInfo)); bool flag7 = flag; if (flag7) { list2.Add(new ButtonClickEventHandler(this.RemoveFriend)); } else { bool flag8 = !flag2; if (flag8) { bool flag9 = XSingleton.singleton.IsSystemOpened(XSysDefine.XSys_Friends); if (flag9) { list2.Add(new ButtonClickEventHandler(this.AddFriend)); } } } bool flag10 = !flag2; if (flag10) { list2.Add(new ButtonClickEventHandler(this.PrivateChat)); list2.Add(new ButtonClickEventHandler(this.Block)); list2.Add(new ButtonClickEventHandler(this.SendFlower)); } else { list2.Add(new ButtonClickEventHandler(this.UnBlock)); } this.ShowMenuUI(uid, name, list, list2, powerpoint, professional); } public void InitGuildMenu(ulong guildid, string guildname) { this.ShowMenuUI(guildid, guildname, new List { XStringDefineProxy.GetString("CHAT_LOOKUP_GUILD") }, new List { new ButtonClickEventHandler(DlgBase.singleton.OnShowGuildInfo) }, 0u, 1u); } public void InitContentArea(Player_Info option, ulong param1 = 0UL, ulong param2 = 0UL) { float realtimeSinceStartup = Time.realtimeSinceStartup; bool flag = (double)Mathf.Abs(realtimeSinceStartup - this._EclipsedTime) <= 0.1; if (flag) { XSingleton.singleton.AddLog("Time too short", null, null, null, null, null, XDebugColor.XDebug_None); } else { this._EclipsedTime = realtimeSinceStartup; foreach (KeyValuePair keyValuePair in this.m_InfoDic) { bool flag2 = keyValuePair.Key == option; if (flag2) { keyValuePair.Value.SetVisible(true); this.ShowOtherHandler(keyValuePair.Key); } else { keyValuePair.Value.SetVisible(false); } } base.uiBehaviour.m_InfoPlayerName.SetText(string.Concat(new object[] { "Lv.", this.m_PlayerLevel, " ", this.m_PlayerName })); this.m_uiBehaviour.m_CurrentSnapshot = null; switch (option) { case Player_Info.Equip: case Player_Info.Avatar: this.m_uiBehaviour.m_CurrentSnapshot = ((option == Player_Info.Avatar) ? this.m_uiBehaviour.m_AvatarSnapshot : this.m_uiBehaviour.m_EquipSnapshot); this.RequirePlayerInfo(); break; case Player_Info.Skill: this.SetupSkillFrame(); break; case Player_Info.Emblem: this.RefreshEmblemInfo(this._doc.m_Appearance); break; case Player_Info.Guild: { this.InitGuildInfo(); RpcC2M_GetOtherGuildBriefNew rpcC2M_GetOtherGuildBriefNew = new RpcC2M_GetOtherGuildBriefNew(); rpcC2M_GetOtherGuildBriefNew.oArg.roleid = this.m_PlayerId; XSingleton.singleton.Send(rpcC2M_GetOtherGuildBriefNew); break; } case Player_Info.Pet: this.m_uiBehaviour.m_CurrentSnapshot = this.m_uiBehaviour.m_PetSnapshot; this.RequirePetInfo(param1, param2); break; case Player_Info.Sprite: for (int i = 0; i < 4; i++) { this._SpriteAvatarHandler[i].HideAvatar(); } base.uiBehaviour.m_SpriteLayer.gameObject.transform.Find("Empty").gameObject.SetActive(false); this.RequireSpriteInfo(); break; case Player_Info.Artifact: this.RefreshArtifactInfo(this._doc.m_Appearance); break; } } } private void ShowOtherHandler(Player_Info type) { if (type != Player_Info.Emblem) { if (type == Player_Info.Artifact) { this.m_artifactAttrHandler.SetBaseData(this._doc.GetOtherArtifactInfoList()); } } else { this.m_EmbleAttrHandler.SetBaseData(this._doc.GetOtherEmblemInfoList()); } } private void InitEquipAndAvatar() { for (int i = 0; i < 10; i++) { GameObject gameObject = base.uiBehaviour.transform.Find("Bg/InfoPanel/EquipLayer/EquipFrame/Part" + i.ToString()).gameObject; XSingleton.singleton.normalItemDrawer.DrawItem(gameObject, null, 0, false); } IXUILabel ixuilabel = base.uiBehaviour.transform.Find("Bg/InfoPanel/EquipLayer/CharacterInfoFrame/CharacterFrame/PowerPoint").GetComponent("XUILabel") as IXUILabel; ixuilabel.SetText("0"); base.uiBehaviour.m_InfoPlayerName.SetText(""); for (int j = 0; j < 10; j++) { GameObject gameObject2 = base.uiBehaviour.transform.Find("Bg/InfoPanel/AvatarLayer/EquipFrame/Part" + (11 + j).ToString()).gameObject; XSingleton.singleton.normalItemDrawer.DrawItem(gameObject2, null, 0, false); } for (int k = 0; k < 16; k++) { GameObject gameObject3 = base.uiBehaviour.m_EmblemBg[k]; XSingleton.singleton.normalItemDrawer.DrawItem(gameObject3, null, 0, false); gameObject3.SetActive(true); } } public XAttributes GetAttrByUnitAppearance(UnitAppearance data) { return XSingleton.singleton.InitAttrFromServer(data.uID, data.nickid, data.unitType, data.unitName, data.attributes, data.fightgroup, data.isServerControl, data.skills, data.bindskills, new XOutLookAttr(data.outlook), data.level, 0u); } private void _FillCharacterInfoFrame(UnitAppearance data) { bool flag = !base.IsVisible(); if (!flag) { this._FillInitEquip(data); this._FillInitInfos(data); this._FillInitAvatar(data); this.RefreshEmblemInfo(data); this._FillRoleDummy(data); this._FillInitSkillData(data); this.RefreshArtifactInfo(data); } } private void _FillInitEquip(UnitAppearance data) { foreach (XItem xitem in this.m_ItemDic.Values) { xitem.Recycle(); } this.m_ItemDic.Clear(); int num = 0; while (num < 10 && num < data.equip.Count) { Item kksgitem = data.equip[num]; XItem xitem2 = XBagDocument.MakeXItem(kksgitem); this.m_EquipBag[num] = xitem2; this.m_ItemDic[xitem2.itemID] = xitem2; GameObject gameObject = base.uiBehaviour.transform.Find("Bg/InfoPanel/EquipLayer/EquipFrame/Part" + num.ToString()).gameObject; IXUISprite ixuisprite = gameObject.transform.Find("Icon").GetComponent("XUISprite") as IXUISprite; bool flag = xitem2 != null && xitem2.itemID > 0; if (flag) { ixuisprite.ID = (ulong)((long)xitem2.itemID); ixuisprite.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnClickItemBg)); XEquipItem xequipItem = xitem2 as XEquipItem; this.SetEquipEffect(gameObject, xequipItem.fuseInfo.BreakNum, num); } else { this.SetEquipEffect(gameObject, 0u, num); } XItemDrawerMgr.Param.bHideBinding = true; XItemDrawerMgr.Param.Profession = data.unitType % 10u; XSingleton.singleton.DrawItem(gameObject, xitem2); num++; } bool flag2 = data.equip.Count > 10; if (flag2) { for (int i = data.equip.Count; i < 10; i++) { GameObject gameObject2 = base.uiBehaviour.transform.Find("Bg/InfoPanel/EquipLayer/EquipFrame/Part" + i.ToString()).gameObject; this.SetEquipEffect(gameObject2, 0u, i); } } } private void SetEquipEffect(GameObject go, uint breakLevel, int slot) { bool flag = slot >= this.m_fuseBreakFx.Length; if (!flag) { bool flag2 = go == null; if (!flag2) { ArtifactQuanlityFx artifactQuanlityFx = this.m_fuseBreakFx[slot]; bool flag3 = artifactQuanlityFx == null; if (flag3) { artifactQuanlityFx = new ArtifactQuanlityFx(); this.m_fuseBreakFx[slot] = artifactQuanlityFx; } string path; bool flag4 = !this.m_equipfusionDoc.GetEffectPath(breakLevel, out path); if (flag4) { artifactQuanlityFx.Reset(); } else { bool flag5 = !artifactQuanlityFx.IsCanReuse((ulong)breakLevel); if (flag5) { artifactQuanlityFx.SetData((ulong)breakLevel, go.transform.Find("Icon/Icon/Effects"), path); } } } } } private void RestQuanlityFx() { for (int i = 0; i < 10; i++) { bool flag = this.m_fuseBreakFx[i] != null; if (flag) { this.m_fuseBreakFx[i].Reset(); } } } private void _FillInitInfos(UnitAppearance data) { this.m_PlayerProfession = data.unitType; IXUILabel ixuilabel = base.uiBehaviour.transform.Find("Bg/InfoPanel/EquipLayer/CharacterInfoFrame/CharacterFrame/PowerPoint").GetComponent("XUILabel") as IXUILabel; ixuilabel.SetText(data.PowerPoint.ToString()); this.m_PlayerLevel = data.level; base.uiBehaviour.m_InfoPlayerName.SetText(string.Concat(new object[] { "Lv.", this.m_PlayerLevel, " ", this.m_PlayerName })); IXUILabel ixuilabel2 = base.uiBehaviour.transform.Find("Bg/InfoPanel/AvatarLayer/CharacterInfoFrame/CharacterFrame/PowerPoint").GetComponent("XUILabel") as IXUILabel; ixuilabel2.SetText(data.PowerPoint.ToString()); this.m_Attributes = this.GetAttrByUnitAppearance(data); this.m_CharacterAttrHandler.SetAttributes(this.m_Attributes); } private void _FillInitAvatar(UnitAppearance data) { int i = 0; int num = this.allParts.Length; while (i < num) { this.allParts[i] = 0u; i++; } bool flag = data.outlook != null && data.outlook.display_fashion != null; if (flag) { i = 0; num = data.outlook.display_fashion.display_fashions.Count; while (i < num) { uint num2 = data.outlook.display_fashion.display_fashions[i]; FashionList.RowData fashionConf = XBagDocument.GetFashionConf((int)num2); bool flag2 = fashionConf == null || (int)fashionConf.EquipPos >= this.allParts.Length; if (!flag2) { this.allParts[(int)fashionConf.EquipPos] = num2; } i++; } } i = 0; while (i < 10 && i < this.allParts.Length) { uint num3 = this.allParts[i]; GameObject gameObject = base.uiBehaviour.transform.Find("Bg/InfoPanel/AvatarLayer/EquipFrame/Part" + (11 + i).ToString()).gameObject; IXUISprite ixuisprite = gameObject.transform.Find("Icon").GetComponent("XUISprite") as IXUISprite; ixuisprite.ID = (ulong)num3; ixuisprite.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnClickOutLookBg)); XItemDrawerMgr.Param.bHideBinding = true; XItemDrawerMgr.Param.Profession = data.unitType % 10u; XSingleton.singleton.normalItemDrawer.DrawItem(gameObject, (int)num3, 0, false); i++; } } private void OnClickOutLookBg(IXUISprite sprite) { int num = (int)sprite.ID; bool flag = num == 0; if (!flag) { XSingleton.singleton.ShowTooltipDialog(num, null, this.m_PlayerProfession % 10u); } } private void _FillInitSkillData(UnitAppearance data) { this._bindsSkills.Clear(); this._skillLevel.Clear(); for (int i = 0; i < data.bindskills.Count; i++) { this._bindsSkills.Add(data.bindskills[i]); } for (int j = 0; j < data.skills.Count; j++) { this._skillLevel[data.skills[j].skillHash] = data.skills[j].skillLevel; } } private void _FillRoleDummy(UnitAppearance data) { bool flag = data.uID > 0UL; if (flag) { this._PlayerDummy = XSingleton.singleton.CreateCommonRoleDummy(this.m_dummPool, data.uID, data.unitType, data.outlook, this.m_uiBehaviour.m_CurrentSnapshot, this._PlayerDummy); } } private void RefreshEmblemInfo(UnitAppearance data) { bool flag = data == null; if (!flag) { for (int i = 0; i < 16; i++) { GameObject gameObject = base.uiBehaviour.m_EmblemBg[i]; bool flag2 = data.emblem.Count > i; if (flag2) { Item item = data.emblem[i]; bool flag3 = item.ItemID > 0u; if (flag3) { XItem xitem = XBagDocument.MakeXItem(item); this.m_ItemDic[xitem.itemID] = xitem; XItemDrawerMgr.Param.bHideBinding = true; XItemDrawerMgr.Param.Profession = data.unitType % 10u; XSingleton.singleton.DrawItem(gameObject, xitem); gameObject.SetActive(true); IXUISprite ixuisprite = gameObject.transform.Find("Icon").GetComponent("XUISprite") as IXUISprite; bool flag4 = xitem != null; if (flag4) { ixuisprite.ID = (ulong)((long)xitem.itemID); ixuisprite.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnClickItemBg)); } } else { gameObject.SetActive(false); } } else { gameObject.SetActive(false); } } } } private void RefreshArtifactInfo(UnitAppearance data) { bool flag = data == null; if (!flag) { for (int i = 0; i < 4; i++) { GameObject gameObject = base.uiBehaviour.m_artifactGo[i]; bool flag2 = data.artifact.Count > i; if (flag2) { Item item = data.artifact[i]; XItem xitem = XBagDocument.MakeXItem(item); this.m_artifactBag[i] = xitem; bool flag3 = item.ItemID > 0u; if (flag3) { this.m_ItemDic[xitem.itemID] = xitem; XItemDrawerMgr.Param.bHideBinding = true; XSingleton.singleton.DrawItem(gameObject, xitem); bool flag4 = xitem != null && xitem.itemConf != null; if (flag4) { this.SetArtifactEffect(gameObject, xitem.itemID, i); } gameObject.SetActive(true); gameObject.transform.Find("Icon/RedPoint").gameObject.SetActive(false); IXUISprite ixuisprite = gameObject.transform.Find("Icon").GetComponent("XUISprite") as IXUISprite; bool flag5 = xitem != null; if (flag5) { ixuisprite.ID = (ulong)((long)xitem.itemID); ixuisprite.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnClickItemBg)); } } else { gameObject.SetActive(false); } } else { gameObject.SetActive(false); } } } } private void SetArtifactEffect(GameObject go, int itemId, int slot) { bool flag = slot >= this.m_artifactQuanlityFx.Length; if (!flag) { bool flag2 = go == null; if (!flag2) { ItemList.RowData itemConf = XBagDocument.GetItemConf(itemId); bool flag3 = itemConf == null; if (!flag3) { ArtifactListTable.RowData artifactListRowData = ArtifactDocument.GetArtifactListRowData((uint)itemId); bool flag4 = artifactListRowData == null; if (!flag4) { ArtifactQuanlityFx artifactQuanlityFx = this.m_artifactQuanlityFx[slot]; bool flag5 = artifactQuanlityFx == null; if (flag5) { artifactQuanlityFx = new ArtifactQuanlityFx(); this.m_artifactQuanlityFx[slot] = artifactQuanlityFx; } ulong key = this.m_doc.MakeKey((uint)itemConf.ItemQuality, artifactListRowData.AttrType); string path; bool flag6 = !this.m_doc.GetArtifactEffectPath(key, out path); if (flag6) { artifactQuanlityFx.Reset(); } else { bool flag7 = !artifactQuanlityFx.IsCanReuse(key); if (flag7) { artifactQuanlityFx.SetData(key, go.transform.Find("Icon/Icon/Effects"), path); } } } } } } } public void InitGuildInfo() { base.uiBehaviour.m_GuildLogo.SetSprite(""); base.uiBehaviour.m_GuildName.SetText(""); base.uiBehaviour.m_GuildMasterName.SetText(""); base.uiBehaviour.m_GuildLevel.SetText("0"); base.uiBehaviour.m_GuildNumber.SetText("0/0"); base.uiBehaviour.m_GuildContent.SetText(""); base.uiBehaviour.m_GuildLogo.SetVisible(false); } public void RefreshGuildInfo(GetOtherGuildBriefRes res) { bool flag = res.icon == 0u; if (flag) { base.uiBehaviour.m_GuildLogo.SetSprite(""); base.uiBehaviour.m_GuildLogo.SetVisible(false); } else { base.uiBehaviour.m_GuildLogo.SetSprite(XGuildDocument.GetPortraitName((int)res.icon)); base.uiBehaviour.m_GuildLogo.SetVisible(true); } base.uiBehaviour.m_GuildName.SetText(res.guildname); base.uiBehaviour.m_GuildMasterName.SetText(res.leadername); base.uiBehaviour.m_GuildLevel.SetText(res.guildlevel.ToString()); base.uiBehaviour.m_GuildNumber.SetText(res.currentcount.ToString() + "/" + res.allcount.ToString()); base.uiBehaviour.m_GuildContent.SetText(res.announcement); } public void RefreshPetInfo(UnitAppearance data) { bool flag = !base.IsVisible() || base.uiBehaviour == null || base.uiBehaviour.m_PetLayer == null || !base.uiBehaviour.m_PetLayer.IsVisible(); if (!flag) { this.m_PlayerLevel = data.level; bool flag2 = base.uiBehaviour.m_InfoPlayerName != null; if (flag2) { base.uiBehaviour.m_InfoPlayerName.SetText(string.Concat(new object[] { "Lv.", this.m_PlayerLevel, " ", this.m_PlayerName })); } bool flag3 = data.pet == null; if (flag3) { bool flag4 = base.uiBehaviour.m_PetInfo != null; if (flag4) { base.uiBehaviour.m_PetInfo.gameObject.SetActive(false); } bool flag5 = base.uiBehaviour.m_PetEmpty != null; if (flag5) { base.uiBehaviour.m_PetEmpty.gameObject.SetActive(true); } } else { XPet xpet = new XPet(); xpet.Init(data.pet, PetChange.None); bool flag6 = base.uiBehaviour.m_PetInfo != null; if (flag6) { base.uiBehaviour.m_PetInfo.gameObject.SetActive(true); } bool flag7 = base.uiBehaviour.m_PetEmpty != null; if (flag7) { base.uiBehaviour.m_PetEmpty.gameObject.SetActive(false); } this.m_SkillHandler.Refresh(xpet); this.RefreshPetDummy(xpet.ID); this.RefreshAttribute(xpet); } } } private void RefreshAttribute(XPet pet) { bool flag = pet == null; if (!flag) { PetInfoTable.RowData petInfo = XPetDocument.GetPetInfo(pet.ID); BuffTable.RowData buffData = XSingleton.singleton.GetBuffData((int)petInfo.SpeedBuff, 1); bool flag2 = buffData == null || 1201 != (int)buffData.BuffChangeAttribute[0, 0]; if (flag2) { XSingleton.singleton.AddErrorLog("Buff No Find XAttr_RUN_SPEED_Percent.\nSp BuffId:" + petInfo.SpeedBuff, null, null, null, null, null); } else { base.uiBehaviour.m_SpeedUp.SetText(string.Format("{0}%", (buffData.BuffChangeAttribute[0, 1] + 100f).ToString())); } DlgBase.singleton.SetPetSex(base.uiBehaviour.m_PetSex, pet.Sex); base.uiBehaviour.m_PetName.SetText(pet.Name); base.uiBehaviour.m_PetPPT.SetText(pet.PPT.ToString()); base.uiBehaviour.m_PetLevel.SetText(string.Format("(Lv.{0})", pet.showLevel.ToString())); PetLevelTable.RowData petLevel = XPetDocument.GetPetLevel(pet); PetLevelTable.RowData petLevel2 = XPetDocument.GetPetLevel(pet.ID, pet.Level + 1); base.uiBehaviour.m_AttributePool.ReturnAll(false); int num = 0; while ((long)num < (long)((ulong)XPetMainView.ATTRIBUTE_NUM_MAX)) { bool flag3 = num >= petLevel.PetsAttributes.Count; if (!flag3) { GameObject gameObject = base.uiBehaviour.m_AttributePool.FetchGameObject(false); int spriteHeight = (gameObject.transform.GetComponent("XUISprite") as IXUISprite).spriteHeight; IXUILabel ixuilabel = gameObject.transform.Find("AttributeName").GetComponent("XUILabel") as IXUILabel; IXUILabel ixuilabel2 = gameObject.transform.Find("AttributeName/AttributeVal").GetComponent("XUILabel") as IXUILabel; IXUILabel ixuilabel3 = gameObject.transform.Find("AttributeName/GrowUp").GetComponent("XUILabel") as IXUILabel; gameObject.transform.localPosition = new Vector3(0f, (float)(-(float)spriteHeight * num), 0f); string attrStr = XAttributeCommon.GetAttrStr((int)petLevel.PetsAttributes[num, 0]); ixuilabel.SetText(attrStr); uint num2 = 0u; for (int i = 1; i <= pet.Level; i++) { PetLevelTable.RowData petLevel3 = XPetDocument.GetPetLevel(pet.ID, i); num2 += petLevel3.PetsAttributes[num, 1]; } ixuilabel2.SetText(XAttributeCommon.GetAttrValueStr(petLevel.PetsAttributes[num, 0], num2, false)); bool flag4 = petLevel2 != null; if (flag4) { ixuilabel3.SetText(string.Format("+{0}", petLevel2.PetsAttributes[num, 1].ToString())); } else { ixuilabel3.SetText(""); } } num++; } } } public void RefreshPetDummy(uint petID) { bool flag = petID > 0u; if (flag) { this.lastPetID = petID; } this._PlayerDummy = XSingleton.singleton.CreateCommonEntityDummy(this.m_dummPool, XPetDocument.GetPresentID(this.lastPetID), this.m_uiBehaviour.m_CurrentSnapshot, this._PlayerDummy, 1f); DlgBase.singleton.PetActionChange(XPetActionFile.IDLE, this.lastPetID, this._PlayerDummy, false); } public void RefreshPlayerInfo(UnitAppearance data) { this._FillCharacterInfoFrame(data); } public void RefreshSpriteInfo(uint level, List list, UnitAppearance data) { bool flag = !base.IsVisible() || !base.uiBehaviour.m_SpriteLayer.IsVisible(); if (!flag) { this.m_PlayerLevel = level; base.uiBehaviour.m_InfoPlayerName.SetText(string.Concat(new object[] { "Lv.", this.m_PlayerLevel, " ", this.m_PlayerName })); bool flag2 = list.Count != 4; if (flag2) { XSingleton.singleton.AddErrorLog("Get OtherPlayerInfo 's SpriteInfo 's cout is not 4.", null, null, null, null, null); } else { bool flag3 = false; for (int i = 0; i < 4; i++) { bool flag4 = list[i] == null || list[i].SpriteID == 0u; if (flag4) { this._SpriteAvatarHandler[i].SetSpriteInfo(null, null, 0, false, true); this._SpriteAvatarHandler[i].HideAvatar(); } else { flag3 = true; XAttributes attrByUnitAppearance = this.GetAttrByUnitAppearance(data); this._SpriteAvatarHandler[i].SetSpriteInfo(list[i], attrByUnitAppearance, i + 7, true, true); } } base.uiBehaviour.m_SpriteLayer.gameObject.transform.Find("Empty").gameObject.SetActive(!flag3); } } } public void ShowTab(Player_Info type, ulong param1 = 0UL, ulong param2 = 0UL) { base.uiBehaviour.m_MenuPanel.SetVisible(false); base.uiBehaviour.m_InfoPanel.SetVisible(true); int num = XFastEnumIntEqualityComparer.ToInt(type) - 1; bool flag = num < this.m_InfoCheck.Count; if (flag) { this.m_InfoCheck[num].bChecked = true; this.InitContentArea(type, param1, param2); } } public bool ShowDetailInfo(IXUIButton sp) { this.ShowTab(Player_Info.Equip, 0UL, 0UL); return true; } public bool AddFriend(IXUIButton sp) { base.uiBehaviour.m_MenuPanel.SetVisible(false); DlgBase.singleton.SetVisibleWithAnimation(false, null); DlgBase.singleton.AddFriendById(this.m_PlayerId); return true; } public bool RemoveFriend(IXUIButton sp) { base.uiBehaviour.m_MenuPanel.SetVisible(false); DlgBase.singleton.SetVisibleWithAnimation(false, null); DlgBase.singleton.RemoveFriend(this.m_PlayerId); return true; } public bool SendFlower(IXUIButton sp) { base.uiBehaviour.m_MenuPanel.SetVisible(false); DlgBase.singleton.SetVisibleWithAnimation(false, null); DlgBase.singleton.ShowBoard(this.m_PlayerId, this.m_PlayerName); return true; } public bool PrivateChat(IXUIButton sp) { bool flag = sp != null; if (flag) { base.uiBehaviour.m_MenuPanel.SetVisible(false); DlgBase.singleton.SetVisibleWithAnimation(false, null); } bool flag2 = DlgBase.singleton.IsBlock(this.m_PlayerId); if (flag2) { XSingleton.singleton.ShowSystemTip(XStringDefineProxy.GetString("CHAT_BLOCK_2"), "fece00"); } else { ChatFriendData chatFriendData = new ChatFriendData(); chatFriendData.name = this.m_PlayerName; chatFriendData.roleid = this.m_PlayerId; chatFriendData.powerpoint = this.m_PowerPoint; chatFriendData.profession = this.m_PlayerProfession; chatFriendData.isfriend = DlgBase.singleton.IsMyFriend(this.m_PlayerId); chatFriendData.msgtime = DateTime.Now; chatFriendData.viplevel = 0u; chatFriendData.setid = this.m_setid; XEntity entity = XSingleton.singleton.GetEntity(this.m_PlayerId); bool flag3 = entity != null; if (flag3) { XRoleAttributes xroleAttributes = (XRoleAttributes)entity.Attributes; chatFriendData.profession = (uint)xroleAttributes.Profession; } DlgBase.singleton.PrivateChatTo(chatFriendData); } return true; } public void OnClickItemBg(IXUISprite sp) { int key = (int)sp.ID; XItem xitem = null; this.m_ItemDic.TryGetValue(key, out xitem); bool flag = xitem != null; if (flag) { ItemType type = xitem.Type; if (type != ItemType.EQUIP) { if (type != ItemType.FASHION) { if (type == ItemType.ARTIFACT) { XSingleton.singleton.BodyBag = this.m_artifactBag; } } else { XSingleton.singleton.FashionOnBody = this.m_FashionBag; } } else { XSingleton.singleton.BodyBag = this.m_EquipBag; } XSingleton.singleton.mainAttributes = this.m_Attributes; XSingleton.singleton.ShowTooltipDialog(xitem, null, sp, false, this.m_PlayerProfession % 10u); } } public bool Block(IXUIButton sp) { base.uiBehaviour.m_MenuPanel.SetVisible(false); DlgBase.singleton.AddBlockFriend(this.m_PlayerId); DlgBase.singleton.SetVisibleWithAnimation(false, null); return true; } public bool UnBlock(IXUIButton sp) { base.uiBehaviour.m_MenuPanel.SetVisible(false); DlgBase.singleton.RemoveBlockFriend(this.m_PlayerId); DlgBase.singleton.SetVisibleWithAnimation(false, null); return true; } public void RequirePlayerInfo() { bool flag = this.m_PlayerId == 0UL; if (!flag) { RpcC2M_GetUnitAppearanceNew rpcC2M_GetUnitAppearanceNew = new RpcC2M_GetUnitAppearanceNew(); rpcC2M_GetUnitAppearanceNew.oArg.roleid = this.m_PlayerId; rpcC2M_GetUnitAppearanceNew.oArg.mask = 558063; rpcC2M_GetUnitAppearanceNew.oArg.type = 2u; XSingleton.singleton.Send(rpcC2M_GetUnitAppearanceNew); } } public void RequireSpriteInfo() { bool flag = this.m_PlayerId == 0UL; if (!flag) { RpcC2M_GetUnitAppearanceNew rpcC2M_GetUnitAppearanceNew = new RpcC2M_GetUnitAppearanceNew(); rpcC2M_GetUnitAppearanceNew.oArg.roleid = this.m_PlayerId; rpcC2M_GetUnitAppearanceNew.oArg.mask = 17335023; rpcC2M_GetUnitAppearanceNew.oArg.type = 5u; XSingleton.singleton.Send(rpcC2M_GetUnitAppearanceNew); } } public void RequirePetInfo(ulong playerId, ulong petUID) { bool flag = this.m_PlayerId == 0UL; if (!flag) { bool flag2 = this.hasPetInfo; if (flag2) { this.RefreshPetDummy(0u); } else { this.hasPetInfo = true; bool flag3 = playerId == 0UL; if (flag3) { playerId = this.m_PlayerId; } RpcC2M_GetUnitAppearanceNew rpcC2M_GetUnitAppearanceNew = new RpcC2M_GetUnitAppearanceNew(); rpcC2M_GetUnitAppearanceNew.oArg.roleid = playerId; rpcC2M_GetUnitAppearanceNew.oArg.mask = XFastEnumIntEqualityComparer.ToInt(UnitAppearanceField.UNIT_PETS); rpcC2M_GetUnitAppearanceNew.oArg.type = 6u; rpcC2M_GetUnitAppearanceNew.oArg.petId = petUID; XSingleton.singleton.Send(rpcC2M_GetUnitAppearanceNew); } } } public bool ShowPlayerInfo(IXUICheckBox iXUICheckBox) { Player_Info option = (Player_Info)iXUICheckBox.ID; bool bChecked = iXUICheckBox.bChecked; if (bChecked) { this.InitContentArea(option, 0UL, 0UL); } return true; } public bool ClickClosePanel(IXUIButton sp) { this.SetPlayerInfo(0UL, "", new List(), 0u, 1u); this.SetVisible(false, true); return true; } private void SetupSkillFrame() { int num = 10; IXUICheckBox ixuicheckBox = null; base.uiBehaviour.m_SkillTabs.ReturnAll(false); Vector3 tplPos = base.uiBehaviour.m_SkillTabs.TplPos; int num2 = 0; int i = (int)this.m_PlayerProfession; while (i != 0) { i /= 10; num2++; } for (int j = 0; j < num2; j++) { int profID = (int)(this.m_PlayerProfession % (uint)num); GameObject gameObject = base.uiBehaviour.m_SkillTabs.FetchGameObject(false); gameObject.transform.localPosition = new Vector3(tplPos.x, tplPos.y - (float)(j * base.uiBehaviour.m_SkillTabs.TplHeight)); IXUILabel ixuilabel = gameObject.transform.Find("TextLabel").GetComponent("XUILabel") as IXUILabel; ixuilabel.SetText(XSingleton.singleton.GetProfName(profID)); IXUILabel ixuilabel2 = gameObject.transform.Find("SelectedTextLabel").GetComponent("XUILabel") as IXUILabel; ixuilabel2.SetText(XSingleton.singleton.GetProfName(profID)); IXUICheckBox ixuicheckBox2 = gameObject.GetComponent("XUICheckBox") as IXUICheckBox; ixuicheckBox2.ForceSetFlag(false); ixuicheckBox2.ID = (ulong)((long)j); ixuicheckBox2.RegisterOnCheckEventHandler(new CheckBoxOnCheckEventHandler(this.OnSkillTabsClick)); bool flag = j == 0; if (flag) { ixuicheckBox = ixuicheckBox2; } num *= 10; } ixuicheckBox.bChecked = true; this.SetupSkillTree(0); } private bool OnSkillTabsClick(IXUICheckBox icb) { bool flag = !icb.bChecked; bool result; if (flag) { result = true; } else { this.SetupSkillTree((int)icb.ID); result = true; } return result; } private void SetupSkillTree(int promote) { base.uiBehaviour.m_SkillScrollView.SetPosition(0f); base.uiBehaviour.m_Skills.ReturnAll(false); base.uiBehaviour.m_SkillArrow.ReturnAll(false); int num = 10; for (int i = 0; i < promote; i++) { num *= 10; } List profSkillID = XSingleton.singleton.GetProfSkillID((int)(this.m_PlayerProfession % (uint)num)); int num2 = 0; for (int j = 0; j < profSkillID.Count; j++) { GameObject gameObject = base.uiBehaviour.m_Skills.FetchGameObject(false); gameObject.name = string.Format("Skill{0}", ++num2); this.SetupSkill(gameObject, profSkillID[j]); } } private void SetupSkill(GameObject go, uint skillID) { uint num = 0u; this._skillLevel.TryGetValue(skillID, out num); SkillList.RowData skillConfig = XSingleton.singleton.GetSkillConfig(skillID, num); uint skillID2 = XSingleton.singleton.GetSkillID(skillConfig.PreSkill, 0u); SkillList.RowData skillConfig2 = XSingleton.singleton.GetSkillConfig(skillID2, 0u); int skillMaxLevel = XSingleton.singleton.GetSkillMaxLevel(skillID, 0u); SkillTypeEnum skillType = (SkillTypeEnum)skillConfig.SkillType; IXUISprite ixuisprite = go.transform.Find("Icon").GetComponent("XUISprite") as IXUISprite; IXUISprite ixuisprite2 = go.transform.Find("Icon/P").GetComponent("XUISprite") as IXUISprite; IXUILabel ixuilabel = go.transform.Find("Text").GetComponent("XUILabel") as IXUILabel; IXUISprite ixuisprite3 = go.transform.Find("Tip").GetComponent("XUISprite") as IXUISprite; ixuisprite3.SetVisible(this._bindsSkills.Contains(skillID)); go.transform.localPosition = new Vector3(base.uiBehaviour.m_Skills.TplPos.x + (float)((int)(skillConfig.XPostion - 1) * base.uiBehaviour.m_Skills.TplWidth), (float)skillConfig.YPostion); ixuisprite.SetSprite(skillConfig.Icon, skillConfig.Atlas, false); ixuilabel.SetText(num + "/" + skillMaxLevel); SkillTypeEnum skillTypeEnum = skillType; if (skillTypeEnum != SkillTypeEnum.Skill_Big) { if (skillTypeEnum != SkillTypeEnum.Skill_Buff) { ixuisprite2.SetSprite("JN_dk"); } else { ixuisprite2.SetSprite("JN_dk_buff"); } } else { ixuisprite2.SetSprite("JN_dk_0"); } bool flag = skillConfig2 != null; if (flag) { Vector3 localPosition = go.transform.localPosition; Vector3 vector; vector= new Vector3(base.uiBehaviour.m_Skills.TplPos.x + (float)((int)(skillConfig2.XPostion - 1) * base.uiBehaviour.m_Skills.TplWidth), (float)skillConfig2.YPostion); Vector3 vector2 = (localPosition + vector) / 2f; GameObject gameObject = base.uiBehaviour.m_SkillArrow.FetchGameObject(false); IXUISprite ixuisprite4 = gameObject.GetComponent("XUISprite") as IXUISprite; bool flag2 = skillConfig.XPostion == skillConfig2.XPostion || skillConfig.YPostion == skillConfig2.YPostion; if (flag2) { bool flag3 = skillConfig.XPostion == skillConfig2.XPostion; if (flag3) { ixuisprite4.SetSprite("SkillTree_3"); ixuisprite4.spriteHeight = (int)((float)(skillConfig2.YPostion - skillConfig.YPostion) - (float)ixuisprite.spriteHeight * 1.5f); ixuisprite4.spriteWidth = base.uiBehaviour.m_SkillArrow.TplWidth; gameObject.transform.localPosition = vector2; gameObject.transform.localScale = new Vector3(1f, 1f); gameObject.transform.localRotation = Quaternion.identity; } else { ixuisprite4.SetSprite("SkillTree_3"); int num2 = (skillConfig.XPostion < skillConfig2.XPostion) ? 1 : -1; ixuisprite4.spriteHeight = (int)((float)((int)(skillConfig2.XPostion - skillConfig.XPostion) * (num2 * base.uiBehaviour.m_Skills.TplWidth)) - (float)ixuisprite.spriteWidth * 1.5f); ixuisprite4.spriteWidth = base.uiBehaviour.m_SkillArrow.TplWidth; gameObject.transform.localPosition = vector2; gameObject.transform.localScale = new Vector3(1f, 1f); gameObject.transform.localRotation = Quaternion.Euler(0f, 0f, (float)(-(float)num2 * 90)); } } else { ixuisprite4.SetSprite("SkillTree_4"); ixuisprite4.spriteHeight = (int)Math.Abs(localPosition.y - vector.y) - ixuisprite.spriteHeight / 2; ixuisprite4.spriteWidth = (int)Math.Abs(localPosition.x - vector.x) - ixuisprite.spriteWidth / 2; int num3 = (skillConfig.XPostion < skillConfig2.XPostion) ? 1 : -1; gameObject.transform.localPosition = vector2 + new Vector3((float)(ixuisprite.spriteWidth / 2 * -(float)num3), (float)(ixuisprite.spriteHeight / 2)); gameObject.transform.localScale = new Vector3((float)num3, 1f); gameObject.transform.localRotation = Quaternion.identity; } } ixuisprite.SetEnabled(num > 0u); ixuisprite2.SetEnabled(num > 0u); } } }