Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        public int UpdateLogItem(ChatLogParam param, int num = 0)
        {
            // ISSUE: object of a compiler-generated type is created
            // ISSUE: variable of a compiler-generated type
            ChatWindow.\u003CUpdateLogItem\u003Ec__AnonStorey23D itemCAnonStorey23D = new ChatWindow.\u003CUpdateLogItem\u003Ec__AnonStorey23D();
            // ISSUE: reference to a compiler-generated field
            itemCAnonStorey23D.param = param;
            // ISSUE: reference to a compiler-generated field
            itemCAnonStorey23D.\u003C\u003Ef__this = this;
            GameObject gameObject = num >= this.mItems.Count ? (GameObject)null : this.mItems[num];

            // ISSUE: reference to a compiler-generated field
            if (itemCAnonStorey23D.param == null)
            {
                if (Object.op_Inequality((Object)gameObject, (Object)null))
                {
                    gameObject.SetActive(false);
                }
                return(-1);
            }
            gameObject.SetActive(true);
            ChatLogItem component1 = (ChatLogItem)gameObject.GetComponent <ChatLogItem>();

            if (Object.op_Equality((Object)component1, (Object)null))
            {
                return(-1);
            }
            ChatWindow.MessageTemplateType type = ChatWindow.MessageTemplateType.OtherUser;
            // ISSUE: reference to a compiler-generated field
            if (string.IsNullOrEmpty(itemCAnonStorey23D.param.fuid))
            {
                type = ChatWindow.MessageTemplateType.Official;
            }
            else
            {
                // ISSUE: reference to a compiler-generated field
                if (this.gm.Player.FUID == itemCAnonStorey23D.param.fuid)
                {
                    type = ChatWindow.MessageTemplateType.User;
                }
            }
            // ISSUE: reference to a compiler-generated field
            component1.Refresh(itemCAnonStorey23D.param, type);
            SRPG_Button component2 = (SRPG_Button)component1.GetIcon.GetComponent <SRPG_Button>();

            // ISSUE: reference to a compiler-generated field
            if (Object.op_Inequality((Object)component2, (Object)null) && itemCAnonStorey23D.param.fuid != this.gm.Player.FUID)
            {
                // ISSUE: method pointer
                ((UnityEvent)component2.get_onClick()).AddListener(new UnityAction((object)itemCAnonStorey23D, __methodptr(\u003C\u003Em__255)));
            }
            else
            {
                ((UnityEventBase)component2.get_onClick()).RemoveAllListeners();
            }
            // ISSUE: reference to a compiler-generated field
            return(itemCAnonStorey23D.param.id);
        }
Exemplo n.º 3
0
        private void RefreshPushLog()
        {
            if (this.mCurrentChatTab == ChatWindow.SelectChatTab.Offical)
            {
                return;
            }
            ChatLogParam message = this.mChatLogOffical.messages[this.mChatLogOffical.messages.Count - 1];

            if (this.mLastIDOffical == message.id)
            {
                return;
            }
            Transform   transform = this.PushOfficalMessage.get_transform().Find("item");
            ChatLogItem component = (ChatLogItem)((Component)transform).GetComponent <ChatLogItem>();

            if (!Object.op_Inequality((Object)component, (Object)null))
            {
                return;
            }
            ((Component)transform).get_gameObject().SetActive(true);
            component.RefreshPushMessage(message, ChatWindow.MessageTemplateType.Official);
        }
Exemplo n.º 4
0
        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));
            }
        }
Exemplo n.º 5
0
        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));
            }
        }
Exemplo n.º 6
0
        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));
        }