Exemplo n.º 1
0
    public void ClickType2(IUIObject obj)
    {
        Toggle toggle = (Toggle)obj;

        if (null == toggle)
        {
            return;
        }
        if (!toggle.Value)
        {
            return;
        }
        if (toggle.Value)
        {
            this.m_nType = 2;
        }
        if (this.m_Excute)
        {
            StoryChatDlg storyChatDlg = NrTSingleton <FormsManager> .Instance.GetForm(G_ID.STORYCHAT_DLG) as StoryChatDlg;

            if (storyChatDlg != null)
            {
                storyChatDlg.SelectToolbar(1);
            }
        }
    }
Exemplo n.º 2
0
    private void ReqWebUserStoryChatImageCallback(Texture2D txtr, object _param)
    {
        long i64PersonID = (long)_param;

        if (txtr != null)
        {
            this.m_PortraitTexutre = txtr;
            if (NrTSingleton <FormsManager> .Instance.IsForm(G_ID.STORYCHAT_DLG))
            {
                StoryChatDlg storyChatDlg = NrTSingleton <FormsManager> .Instance.GetForm(G_ID.STORYCHAT_DLG) as StoryChatDlg;

                storyChatDlg.UpdateUserPersonID(i64PersonID);
            }
        }
        else
        {
            this.m_PortraitTexutre = null;
        }
    }
Exemplo n.º 3
0
    private void ReqWebUserImageCallback(Texture2D txtr, object _param)
    {
        if (txtr != null)
        {
            this.UserPortrait = txtr;
        }
        else
        {
            this.UserPortrait = null;
        }
        if (NrTSingleton <FormsManager> .Instance.IsForm(G_ID.COMMUNITY_DLG))
        {
            CommunityUI_DLG communityUI_DLG = NrTSingleton <FormsManager> .Instance.GetForm(G_ID.COMMUNITY_DLG) as CommunityUI_DLG;

            if (communityUI_DLG != null)
            {
                communityUI_DLG.UpdateCommunity_Friend(this);
            }
            if (NrTSingleton <FormsManager> .Instance.IsForm(G_ID.DLG_OTHER_CHAR_DETAIL))
            {
                DLG_OtherCharDetailInfo dLG_OtherCharDetailInfo = NrTSingleton <FormsManager> .Instance.GetForm(G_ID.DLG_OTHER_CHAR_DETAIL) as DLG_OtherCharDetailInfo;

                if (dLG_OtherCharDetailInfo != null)
                {
                    dLG_OtherCharDetailInfo.UpsateSoldierList();
                }
            }
        }
        if (NrTSingleton <FormsManager> .Instance.IsForm(G_ID.STORYCHAT_DLG))
        {
            StoryChatDlg storyChatDlg = NrTSingleton <FormsManager> .Instance.GetForm(G_ID.STORYCHAT_DLG) as StoryChatDlg;

            if (storyChatDlg != null)
            {
                storyChatDlg.UpdateUserCommunity(this.i64PersonID);
            }
        }
    }
    public void SetStoryChatLikeList(StoryChatLike_Info[] array)
    {
        string textFromInterface = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("302");

        string empty = string.Empty;

        NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[]
        {
            textFromInterface,
            "likenum",
            array.Length.ToString()
        });

        this.m_Title.Text = empty;
        NrMyCharInfo myCharInfo = NrTSingleton <NkCharManager> .Instance.GetMyCharInfo();

        if (myCharInfo == null)
        {
            return;
        }
        this.m_StoryChatLikeList.Clear();
        for (int i = 0; i < array.Length; i++)
        {
            bool flag = false;
            if (array[i].nPersonID == myCharInfo.m_PersonID)
            {
                flag = true;
            }
            bool flag2 = false;
            foreach (USER_FRIEND_INFO uSER_FRIEND_INFO in myCharInfo.m_kFriendInfo.GetFriendInfoValues())
            {
                if (uSER_FRIEND_INFO.nPersonID == array[i].nPersonID)
                {
                    flag2 = true;
                    break;
                }
            }
            NewListItem newListItem = new NewListItem(this.m_StoryChatLikeList.ColumnNum, true, string.Empty);
            Texture2D   texture2D   = null;
            if (NrTSingleton <FormsManager> .Instance.IsForm(G_ID.STORYCHAT_DLG))
            {
                StoryChatDlg storyChatDlg = NrTSingleton <FormsManager> .Instance.GetForm(G_ID.STORYCHAT_DLG) as StoryChatDlg;

                if (storyChatDlg != null)
                {
                    texture2D = storyChatDlg.GetFriendPortraitPersonID(array[i].nPersonID);
                }
            }
            if (texture2D != null)
            {
                newListItem.SetListItemData(1, texture2D, null, null, null, null);
            }
            else
            {
                EVENT_HERODATA eventHeroCharFriendCode = NrTSingleton <NrTableEvnetHeroManager> .Instance.GetEventHeroCharFriendCode(array[i].nCharKind);

                if (eventHeroCharFriendCode != null)
                {
                    newListItem.SetListItemData(0, "Win_I_EventSol", null, null, null);
                    newListItem.EventMark = true;
                }
                newListItem.SetListItemData(1, new CostumeDrawTextureInfo
                {
                    charKind            = array[i].nCharKind,
                    costumePortraitPath = NrTSingleton <NrCharCostumeTableManager> .Instance.GetCostumePortraitPath(array[i].nFaceCharCostumeUnique),
                    grade = -1
                }, null, null, null);
            }
            string text = TKString.NEWString(array[i].szName);
            newListItem.SetListItemData(2, text, null, null, null);
            newListItem.SetListItemData(3, NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("152") + array[i].nLevel.ToString(), null, null, null);
            if (!flag)
            {
                newListItem.SetListItemData(4, string.Empty, array[i].nPersonID, new EZValueChangedDelegate(this.ClickUserInfo), null);
            }
            else
            {
                newListItem.SetListItemEnable(4, false);
            }
            if (!flag2 && !flag)
            {
                newListItem.SetListItemData(5, string.Empty, text, new EZValueChangedDelegate(this.ClickAddFriend), null);
            }
            else
            {
                newListItem.SetListItemEnable(5, false);
            }
            newListItem.SetListItemData(12, false);
            newListItem.Data = array[i];
            this.m_StoryChatLikeList.Add(newListItem);
        }
        this.m_StoryChatLikeList.RepositionItems();
    }
Exemplo n.º 5
0
    public void SetStoryCommentList(byte canLike, StoryComment_Info[] array)
    {
        if (canLike == 0)
        {
            this.m_Like.controlIsEnabled = false;
        }
        if (array == null)
        {
            return;
        }
        if (this.m_DetailList.ChangeLineHeight)
        {
            this.m_DetailList.ChangeLineHeight = false;
            this.m_DetailList.LineHeight       = 114f;
            this.m_DetailList.SetColumnData("Mobile/DLG/StoryChat/NLB_News01_ColumnData" + NrTSingleton <UIDataManager> .Instance.AddFilePath);
        }
        string     b     = string.Empty;
        NrCharBase @char = NrTSingleton <NkCharManager> .Instance.GetChar(1);

        if (@char != null)
        {
            b = @char.GetCharName();
        }
        int num = 0;

        for (int i = array.Length - 1; i >= 0; i--)
        {
            if (array[i].nStoryCommentID != 0L)
            {
                NewListItem newListItem = new NewListItem(this.m_DetailList.ColumnNum, true, string.Empty);
                Texture2D   texture2D   = null;
                if (NrTSingleton <FormsManager> .Instance.IsForm(G_ID.STORYCHAT_DLG))
                {
                    StoryChatDlg storyChatDlg = NrTSingleton <FormsManager> .Instance.GetForm(G_ID.STORYCHAT_DLG) as StoryChatDlg;

                    if (storyChatDlg != null)
                    {
                        texture2D = storyChatDlg.GetFriendPortraitPersonID(array[i].nPersonID);
                    }
                }
                if (texture2D != null)
                {
                    newListItem.SetListItemData(1, texture2D, null, null, null, null);
                }
                else
                {
                    EVENT_HERODATA eventHeroCharFriendCode = NrTSingleton <NrTableEvnetHeroManager> .Instance.GetEventHeroCharFriendCode(array[i].nCharKind);

                    if (eventHeroCharFriendCode != null)
                    {
                        newListItem.SetListItemData(0, "Win_I_EventSol", null, null, null);
                        newListItem.EventMark = true;
                    }
                    newListItem.SetListItemData(1, new CostumeDrawTextureInfo
                    {
                        charKind            = array[i].nCharKind,
                        grade               = -1,
                        costumePortraitPath = NrTSingleton <NrCharCostumeTableManager> .Instance.GetCostumePortraitPath(array[i].nFaceCharCostumeUnique)
                    }, null, null, null);
                }
                string text = TKString.NEWString(array[i].szName);
                newListItem.SetListItemData(2, NrTSingleton <UIDataManager> .Instance.GetString(text, "(", NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("152"), array[i].nLevel.ToString(), ")"), null, null, null);
                DateTime dueDate           = PublicMethod.GetDueDate(array[i].nTime);
                string   textFromInterface = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("301");

                string empty = string.Empty;
                NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[]
                {
                    textFromInterface,
                    "month",
                    dueDate.Month,
                    "day",
                    dueDate.Day,
                    "hour",
                    dueDate.Hour,
                    "min",
                    dueDate.Minute
                });

                newListItem.SetListItemData(3, empty, null, null, null);
                string text2 = TKString.NEWString(array[i].szMessage);
                newListItem.SetListItemData(4, text2, null, null, null);
                newListItem.SetListItemData(5, string.Empty, text, new EZValueChangedDelegate(this.ClickUser), null);
                if (this.m_bMyStoryChat || text == b)
                {
                    newListItem.SetListItemData(6, string.Empty, array[i].nStoryCommentID, new EZValueChangedDelegate(this.DeleteStoryComment), null);
                }
                else
                {
                    newListItem.SetListItemData(6, false);
                }
                newListItem.Data = array[i];
                if (!this.m_bAddComment)
                {
                    this.m_DetailList.Add(newListItem);
                    TsLog.LogError("m_bAddComment ={0} CommentID:{1} Message:{2}", new object[]
                    {
                        this.m_bAddComment,
                        array[i].nStoryCommentID,
                        text2
                    });
                }
                else
                {
                    this.m_DetailList.InsertAdd(1 + num++, newListItem);
                    TsLog.LogError("InsertAdd m_bAddComment ={0} Count = {3} CommentID:{1} Message:{2}", new object[]
                    {
                        this.m_bAddComment,
                        array[i].nStoryCommentID,
                        text2,
                        num
                    });
                }
                this.m_nCommentCount++;
            }
        }
        this.m_DetailList.RepositionItems();
        this.m_bAddComment    = true;
        this.m_nLastCommentID = array[array.Length - 1].nStoryCommentID;
        TsLog.LogError("m_nCommentCount ={0} m_nLastCommentID ={1}", new object[]
        {
            this.m_nCommentCount,
            this.m_nLastCommentID
        });
    }
Exemplo n.º 6
0
    public void SetStoryChat(StoryChat_Info info, bool battleReplay)
    {
        GS_STORYCOMMENT_GET_REQ gS_STORYCOMMENT_GET_REQ = new GS_STORYCOMMENT_GET_REQ();

        gS_STORYCOMMENT_GET_REQ.nStoryChatID    = info.nStoryChatID;
        gS_STORYCOMMENT_GET_REQ.nStoryCommentID = 0L;
        gS_STORYCOMMENT_GET_REQ.nLoadCount      = 10;
        SendPacket.GetInstance().SendObject(eGAME_PACKET_ID.GS_STORYCOMMENT_GET_REQ, gS_STORYCOMMENT_GET_REQ);
        this.m_CurrentStoryChat = info;
        string textFromInterface = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("322");

        string text  = string.Empty;
        string text2 = TKString.NEWString(info.szName);

        if (!battleReplay)
        {
            NrTSingleton <CTextParser> .Instance.ReplaceParam(ref text, new object[]
            {
                textFromInterface,
                "targetname",
                text2
            });
        }
        else if (info.nCharKind == 8)
        {
            text = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1307");
        }
        else if (info.nCharKind == 6)
        {
            text = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("436");
        }
        else if (info.nCharKind == 5)
        {
            text = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("43");
        }
        this.m_Title.Text = text;
        this.m_DetailList.ChangeLineHeight = true;
        this.m_DetailList.LineHeight       = 160f;
        this.m_DetailList.Clear();
        NewListItem newListItem = new NewListItem(this.m_DetailList.ColumnNum, true, string.Empty);

        if (!battleReplay)
        {
            Texture2D texture2D = null;
            if (NrTSingleton <FormsManager> .Instance.IsForm(G_ID.STORYCHAT_DLG))
            {
                StoryChatDlg storyChatDlg = NrTSingleton <FormsManager> .Instance.GetForm(G_ID.STORYCHAT_DLG) as StoryChatDlg;

                if (storyChatDlg != null)
                {
                    texture2D = storyChatDlg.GetFriendPortraitPersonID(info.nPersonID);
                }
            }
            if (texture2D != null)
            {
                newListItem.SetListItemData(1, texture2D, null, null, null, null);
            }
            else
            {
                EVENT_HERODATA eventHeroCharFriendCode = NrTSingleton <NrTableEvnetHeroManager> .Instance.GetEventHeroCharFriendCode(info.nCharKind);

                if (eventHeroCharFriendCode != null)
                {
                    newListItem.SetListItemData(0, "Win_I_EventSol", null, null, null);
                    newListItem.EventMark = true;
                }
                newListItem.SetListItemData(1, new CostumeDrawTextureInfo
                {
                    charKind            = info.nCharKind,
                    grade               = -1,
                    costumePortraitPath = NrTSingleton <NrCharCostumeTableManager> .Instance.GetCostumePortraitPath(info.nFaceCharCostumeUnique)
                }, null, null, null);
            }
            newListItem.SetListItemData(3, NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("152") + info.nLevel.ToString(), null, null, null);
            string text3 = TKString.NEWString(info.szMessage);
            text3 = text3.Replace("\n", "\r\n");
            newListItem.SetListItemData(6, text3, null, null, null);
            NrCharBase @char = NrTSingleton <NkCharManager> .Instance.GetChar(1);

            if (@char != null)
            {
                if (text2 == @char.GetCharName())
                {
                    this.m_bMyStoryChat = true;
                }
                else
                {
                    newListItem.SetListItemData(13, false);
                    this.m_bMyStoryChat = false;
                }
            }
        }
        else
        {
            char[] separator = new char[]
            {
                '/'
            };
            string[] array = TKString.NEWString(info.szMessage).Split(separator);
            if (info.nCharKind == 8)
            {
                newListItem.SetListItemData(1, NrTSingleton <UIImageInfoManager> .Instance.FindUIImageDictionary("Win_I_Challenge02"), null, null, null);
                string empty = string.Empty;
                NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[]
                {
                    NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1956"),
                    "targetname1",
                    array[1],
                    "targetname2",
                    array[2]
                });

                newListItem.SetListItemData(6, empty, null, null, null);
            }
            else if (info.nCharKind == 6)
            {
                newListItem.SetListItemData(1, NrTSingleton <UIImageInfoManager> .Instance.FindUIImageDictionary("Win_I_Challenge02"), null, null, null);
                string empty2 = string.Empty;
                NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty2, new object[]
                {
                    NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1957"),
                    "targetname1",
                    array[1],
                    "targetname2",
                    array[2]
                });

                newListItem.SetListItemData(6, empty2, null, null, null);
            }
            else if (info.nCharKind == 5)
            {
                newListItem.SetListItemData(1, NrTSingleton <UIImageInfoManager> .Instance.FindUIImageDictionary("Win_I_Challenge02"), null, null, null);
                string empty3 = string.Empty;
                NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty3, new object[]
                {
                    NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1957"),
                    "targetname1",
                    array[1],
                    "targetname2",
                    array[2]
                });

                newListItem.SetListItemData(6, empty3, null, null, null);
            }
            newListItem.SetListItemData(3, false);
            newListItem.SetListItemData(13, false);
            this.m_bMyStoryChat = false;
        }
        newListItem.SetListItemData(2, text2, null, null, null);
        DateTime dueDate = PublicMethod.GetDueDate(info.nTime);

        textFromInterface = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("301");

        text = string.Empty;
        NrTSingleton <CTextParser> .Instance.ReplaceParam(ref text, new object[]
        {
            textFromInterface,
            "month",
            dueDate.Month,
            "day",
            dueDate.Day,
            "hour",
            dueDate.Hour,
            "min",
            dueDate.Minute
        });

        newListItem.SetListItemData(4, text, null, null, null);
        newListItem.SetListItemData(9, info.nLikeCount.ToString(), null, null, null);
        newListItem.SetListItemData(10, info.nCommentCount.ToString(), null, null, null);
        newListItem.SetListItemData(11, string.Empty, info.nStoryChatID, new EZValueChangedDelegate(this.ClickLikeList), null);
        newListItem.SetListItemData(12, string.Empty, text2, new EZValueChangedDelegate(this.ClickUser), null);
        this.m_DetailList.Add(newListItem);
        this.m_DetailList.RepositionItems();
    }
Exemplo n.º 7
0
    public void SetCommentList(long _CommentID)
    {
        if (this.m_CurrentCommentInfo == null)
        {
            return;
        }
        NewListItem newListItem = new NewListItem(this.m_DetailList.ColumnNum, true, string.Empty);
        Texture2D   texture2D   = null;

        if (NrTSingleton <FormsManager> .Instance.IsForm(G_ID.STORYCHAT_DLG))
        {
            StoryChatDlg storyChatDlg = NrTSingleton <FormsManager> .Instance.GetForm(G_ID.STORYCHAT_DLG) as StoryChatDlg;

            if (storyChatDlg != null)
            {
                texture2D = storyChatDlg.GetFriendPortraitPersonID(this.m_CurrentCommentInfo.nPersonID);
            }
        }
        if (texture2D != null)
        {
            newListItem.SetListItemData(1, texture2D, null, null, null, null);
        }
        else
        {
            EVENT_HERODATA eventHeroCharFriendCode = NrTSingleton <NrTableEvnetHeroManager> .Instance.GetEventHeroCharFriendCode(this.m_CurrentCommentInfo.nCharKind);

            if (eventHeroCharFriendCode != null)
            {
                newListItem.SetListItemData(0, "Win_I_EventSol", null, null, null);
                newListItem.EventMark = true;
            }
            newListItem.SetListItemData(1, new CostumeDrawTextureInfo
            {
                charKind            = this.m_CurrentCommentInfo.nCharKind,
                grade               = -1,
                costumePortraitPath = NrTSingleton <NrCharCostumeTableManager> .Instance.GetCostumePortraitPath(this.m_CurrentCommentInfo.nFaceCharCostumeUnique)
            }, null, null, null);
        }
        string text = TKString.NEWString(this.m_CurrentCommentInfo.szName);

        newListItem.SetListItemData(2, NrTSingleton <UIDataManager> .Instance.GetString(text, "(", NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("152"), this.m_CurrentCommentInfo.nLevel.ToString(), ")"), null, null, null);
        DateTime nowTime           = PublicMethod.GetNowTime();
        string   textFromInterface = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("301");

        string empty = string.Empty;

        NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[]
        {
            textFromInterface,
            "month",
            nowTime.Month,
            "day",
            nowTime.Day,
            "hour",
            nowTime.Hour,
            "min",
            nowTime.Minute
        });

        newListItem.SetListItemData(3, empty, null, null, null);
        newListItem.SetListItemData(4, TKString.NEWString(this.m_CurrentCommentInfo.szMessage), null, null, null);
        newListItem.SetListItemData(5, string.Empty, text, new EZValueChangedDelegate(this.ClickUser), null);
        NrCharBase @char = NrTSingleton <NkCharManager> .Instance.GetChar(1);

        if (@char != null)
        {
            if (text == @char.GetCharName())
            {
                newListItem.SetListItemData(6, string.Empty, _CommentID, new EZValueChangedDelegate(this.DeleteStoryComment), null);
            }
            else
            {
                newListItem.SetListItemData(6, false);
            }
        }
        else
        {
            newListItem.SetListItemData(6, false);
        }
        newListItem.Data = _CommentID;
        this.m_nCommentCount++;
        this.m_DetailList.InsertAdd(this.m_DetailList.Count, newListItem);
        this.m_DetailList.RepositionItems();
        this.m_DetailList.ScrollPosition = 1f;
        this.m_CurrentCommentInfo        = null;
    }