public void Refresh(ChatBlackListParam param) { if (param == null) { return; } if (Object.op_Inequality((Object)this.Name, (Object)null)) { this.Name.set_text(param.name); } if (Object.op_Inequality((Object)this.Lv, (Object)null)) { this.Lv.set_text(PlayerData.CalcLevelFromExp(param.exp).ToString()); } if (Object.op_Inequality((Object)this.LastLogin, (Object)null)) { this.LastLogin.set_text(ChatLogItem.GetPostAt(param.lastlogin)); } if (!Object.op_Inequality((Object)this.Icon, (Object)null) || param.unit == null) { return; } UnitData data = new UnitData(); data.Deserialize(param.unit); DataSource.Bind <UnitData>(((Component)this).get_gameObject(), data); }
public void Refresh(ChatBlackListParam param) { if (param == null) { return; } if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Name, (UnityEngine.Object)null)) { this.Name.set_text(param.name); } if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Lv, (UnityEngine.Object)null)) { this.Lv.set_text(PlayerData.CalcLevelFromExp(param.exp).ToString()); } if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.LastLogin, (UnityEngine.Object)null)) { this.LastLogin.set_text(ChatLogItem.GetPostAt(param.lastlogin)); } if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Icon, (UnityEngine.Object)null)) { return; } UnitParam unitParam = MonoSingleton <GameManager> .Instance.MasterParam.GetUnitParam(param.icon); if (unitParam == null) { return; } if (!string.IsNullOrEmpty(param.skin_iname)) { ArtifactParam skin = Array.Find <ArtifactParam>(MonoSingleton <GameManager> .Instance.MasterParam.Artifacts.ToArray(), (Predicate <ArtifactParam>)(p => p.iname == param.skin_iname)); MonoSingleton <GameManager> .Instance.ApplyTextureAsync(this.Icon, AssetPath.UnitSkinIconSmall(unitParam, skin, param.job_iname)); } else { MonoSingleton <GameManager> .Instance.ApplyTextureAsync(this.Icon, AssetPath.UnitIconSmall(unitParam, param.job_iname)); } }
public void Refresh(ChatLogParam param, ChatWindow.MessageTemplateType type) { if (param == null) { return; } if (this.mCoroutine != null) { this.StopCoroutine(this.mCoroutine); this.mCoroutine = (Coroutine)null; } if (UnityEngine.Object.op_Equality((UnityEngine.Object) this.mRoot, (UnityEngine.Object)null)) { if (!UnityEngine.Object.op_Inequality((UnityEngine.Object)((Component)this).get_transform().get_parent(), (UnityEngine.Object)null)) { return; } this.mRoot = ((Component)((Component)this).get_transform().get_parent()).get_gameObject(); } this.MessageIcon.SetActive(false); this.MessageLog.SetActive(false); this.MyMessageIcon.SetActive(false); this.MyMessageLog.SetActive(false); this.SystemMessageRootObj.SetActive(false); switch (type) { case ChatWindow.MessageTemplateType.OtherUser: this.MessageIcon.SetActive(true); this.MessageLog.SetActive(true); this.mStampRoot = !UnityEngine.Object.op_Inequality((UnityEngine.Object) this.AnyStampObj, (UnityEngine.Object)null) ? (Transform)null : this.AnyStampObj.get_transform(); this.mNameObj = this.AnyNameObj; this.mFuIDObj = this.AnyFuIDObj; this.mPostAtObj = this.AnyPostAtObj; this.mStampImageObj = this.AnyStampImageObj; this.mMessageObj = this.AnyMessageTextObj; this.mLogRoot = this.AnyLogRoot; this.mLogImg = (Image)((Component)this.AnyLogRoot).GetComponent <Image>(); break; case ChatWindow.MessageTemplateType.User: this.MyMessageIcon.SetActive(true); this.MyMessageLog.SetActive(true); this.mStampRoot = !UnityEngine.Object.op_Inequality((UnityEngine.Object) this.MyStampObj, (UnityEngine.Object)null) ? (Transform)null : this.MyStampObj.get_transform(); this.mNameObj = this.MyNameObj; this.mFuIDObj = this.MyFuIDObj; this.mPostAtObj = this.MyPostAtObj; this.mStampImageObj = this.MyStampImageObj; this.mMessageObj = this.MyMessageTextObj; this.mLogRoot = this.MyLogRoot; this.mLogImg = (Image)((Component)this.MyLogRoot).GetComponent <Image>(); break; case ChatWindow.MessageTemplateType.System: this.SystemMessageRootObj.SetActive(true); this.SystemMessageTextObj.set_text(param.message); this.mCoroutine = this.StartCoroutine(this.RefreshTextLine(param.message)); return; } if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Icon, (UnityEngine.Object)null) && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.LeftIcon, (UnityEngine.Object)null) && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.RightIcon, (UnityEngine.Object)null)) { RawImage target = type != ChatWindow.MessageTemplateType.User ? this.LeftIcon : this.RightIcon; UnitParam unitParam = MonoSingleton <GameManager> .Instance.MasterParam.GetUnitParam(param.icon); if (unitParam != null) { if (!string.IsNullOrEmpty(param.skin_iname) && UnityEngine.Object.op_Inequality((UnityEngine.Object)target, (UnityEngine.Object)null)) { ArtifactParam skin = Array.Find <ArtifactParam>(MonoSingleton <GameManager> .Instance.MasterParam.Artifacts.ToArray(), (Predicate <ArtifactParam>)(p => p.iname == param.skin_iname)); MonoSingleton <GameManager> .Instance.ApplyTextureAsync(target, AssetPath.UnitSkinIconSmall(unitParam, skin, param.job_iname)); } else { MonoSingleton <GameManager> .Instance.ApplyTextureAsync(target, AssetPath.UnitIconSmall(unitParam, param.job_iname)); } } } if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.mNameObj, (UnityEngine.Object)null)) { this.mNameObj.set_text(param.name); } if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.mFuIDObj, (UnityEngine.Object)null)) { this.mFuIDObj.set_text(LocalizedText.Get("sys.TEXT_CHAT_FUID", new object[1] { (object)param.fuid.Substring(param.fuid.Length - 4, 4) })); } if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.mPostAtObj, (UnityEngine.Object)null)) { this.mPostAtObj.set_text(ChatLogItem.GetPostAt(param.posted_at)); } if ((int)param.message_type == 1) { if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.mRoot, (UnityEngine.Object)null) || !this.mRoot.get_activeInHierarchy()) { return; } if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.mStampRoot, (UnityEngine.Object)null)) { ((Component)this.mStampRoot).get_gameObject().SetActive(false); } this.mCoroutine = this.StartCoroutine(this.RefreshTextLine(param.message)); } else { if ((int)param.message_type != 2 || !UnityEngine.Object.op_Inequality((UnityEngine.Object) this.mRoot, (UnityEngine.Object)null) || !this.mRoot.get_activeInHierarchy()) { return; } if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.mStampRoot, (UnityEngine.Object)null)) { ((Component)this.mStampRoot).get_gameObject().SetActive(true); } if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Element, (UnityEngine.Object)null)) { int stampSize = this.STAMP_SIZE; VerticalLayoutGroup component = (VerticalLayoutGroup)((Component)this.mLogRoot).GetComponent <VerticalLayoutGroup>(); this.Element.set_minHeight((float)(stampSize + ((LayoutGroup)component).get_padding().get_top() + ((LayoutGroup)component).get_padding().get_bottom() + (int)Mathf.Abs((float)this.mLogRoot.get_anchoredPosition().y))); } ((Behaviour)this.mLogImg).set_enabled(false); this.mCoroutine = this.StartCoroutine(this.RefreshStamp(param.stamp_id)); } }
public void RefreshPushMessage(ChatLogParam param, ChatWindow.MessageTemplateType type) { if (param == null) { return; } if (this.mCoroutine != null) { this.StopCoroutine(this.mCoroutine); this.mCoroutine = (Coroutine)null; } if (Object.op_Equality((Object)this.mRoot, (Object)null)) { if (!Object.op_Inequality((Object)((Component)this).get_transform().get_parent(), (Object)null)) { return; } this.mRoot = ((Component)((Component)this).get_transform().get_parent()).get_gameObject(); } this.MessageIcon.SetActive(false); this.MessageLog.SetActive(false); this.MyMessageIcon.SetActive(false); this.MyMessageLog.SetActive(false); this.AdminMessageLog.SetActive(false); Transform transform = this.mMessageRoot.Find("status"); ((Text)((Component)transform.Find("name").Find("text")).GetComponent <Text>()).set_text(param.name); ((Text)((Component)transform.Find("fuid").Find("text")).GetComponent <Text>()).set_text(LocalizedText.Get("sys.TEXT_CHAT_FUID", new object[1] { (object)param.fuid.Substring(param.fuid.Length - 4, 4) })); ((Text)((Component)transform.Find("postat").Find("text")).GetComponent <Text>()).set_text(ChatLogItem.GetPostAt(param.posted_at)); this.TextRootObject = (RectTransform)((Component)this.mMessageRoot.Find("messages")).GetComponent <RectTransform>(); if (!Object.op_Inequality((Object)this.mRoot, (Object)null) || !this.mRoot.get_activeInHierarchy()) { return; } this.StartCoroutine(this.RefreshTextLine(param.message)); }